function show_form($param = '') { global $msg, $pmb_lecteurs_localises; //paramètres pré-enregistré $lst_opt = array(); if ($param['chk_reader']) { foreach ($param['chk_reader'] as $elem) { $lst_opt[$elem] = $elem; } } $loc_selected = $param["empr_location_id"] ? $param["empr_location_id"] : ""; $statut_selected = $param["empr_statut_edit"] ? $param["empr_statut_edit"] : ""; //Choix de l'action à réaliser $form_task .= "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='loan'>" . $this->msg["planificateur_reader_abon"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>\n\t\t\t<input type='checkbox' name='chk_reader[]' value='reader_abon_fin_proche' " . ($lst_opt["reader_abon_fin_proche"] == "reader_abon_fin_proche" ? "checked" : "") . "/>" . $this->msg["planificateur_reader_abon_fin_proche"] . "\n\t\t\t\t<br /><input type='checkbox' name='chk_reader[]' value='reader_abon_depasse' " . ($lst_opt["reader_abon_depasse"] == "reader_abon_depasse" ? "checked" : "") . "/>" . $this->msg["planificateur_reader_abon_depasse"] . ""; // <input type='checkbox' name='chk_reader[]' value='reader_abon_fin_proche_mail' ".(($lst_opt["reader_abon_fin_proche_mail"] == "reader_abon_fin_proche_mail") ? "checked" : "")."/>".$this->msg["planificateur_reader_abon_fin_proche_mail"]." // <br /><input type='checkbox' name='chk_reader[]' value='reader_abon_fin_proche_pdf' ".(($lst_opt["reader_abon_fin_proche_pdf"] == "reader_abon_fin_proche_pdf") ? "checked" : "")."/>".$this->msg["planificateur_reader_abon_fin_proche_pdf"]." // <br /><input type='checkbox' name='chk_reader[]' value='reader_abon_depasse_mail' ".(($lst_opt["reader_abon_depasse_mail"] == "reader_abon_depasse_mail") ? "checked" : "")."/>".$this->msg["planificateur_reader_abon_depasse_mail"]." // <br /><input type='checkbox' name='chk_reader[]' value='reader_abon_depasse_pdf' ".(($lst_opt["reader_abon_depasse_pdf"] == "reader_abon_depasse_pdf") ? "checked" : "")."/>".$this->msg["planificateur_reader_abon_depasse_pdf"]." $form_task .= "</div>\n\t\t</div>\n\t\t<div class='row'> </div>"; //Choix de la localisation if ($pmb_lecteurs_localises) { $form_task .= "\n\t\t\t<div class='row'>\n\t\t\t\t<div class='colonne3'>\n\t\t\t\t\t<label for='loan'>" . $this->msg["planificateur_reader_loc"] . "</label>\n\t\t\t\t</div>\n\t\t\t\t<div class='colonne_suite'>" . docs_location::gen_combo_box_empr($loc_selected) . "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='row'> </div>"; } //Choix du statut $form_task .= "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='loan'>" . $this->msg["planificateur_reader_statut"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>" . gen_liste("select idstatut, statut_libelle from empr_statut", "idstatut", "statut_libelle", "empr_statut_edit", "", $statut_selected, "", "", 0, $msg["all_statuts_empr"]) . "\n\t\t\t</div>\n\t\t</div>"; return $form_task; }
function show_import_choix_fichier($dbh) { global $msg, $deflt2docs_location; global $current_module, $PMBuserid; print "\n\t<script type='text/javascript'>\n\nfunction display_part(type)\n{\n\tvar type_import = document.getElementById('div_ensae');\n\tif(type == 'ensae')\n\t{\n\t\tvar div_ensae = document.getElementById('div_ensae');\n\t\tdiv_ensae.style.display = 'table-cell';\n\t\tvar div_ensai = document.getElementById('div_ensai');\n\t\tdiv_ensai.style.display = 'none';\t\n\t\ttype_import.value='maj_complete';\n\t\t\n\t} else {\n\t\tvar div_ensae = document.getElementById('div_ensae');\n\t\tdiv_ensae.style.display = 'none';\n\t\tvar div_ensai = document.getElementById('div_ensai');\n\t\tdiv_ensai.style.display = 'table-cell';\n\t\ttype_import.value='insert_or_update';\n\t}\n\t\n} \n</script>\n\t\n\t<form class='form-{$current_module}' name='form1' ENCTYPE=\"multipart/form-data\" method='post' action=\"./admin.php?categ=empr&sub=implec&action=1\">\n\t<h3>Choix du fichier d'import des élèves GENES</h3>\n\t<div class='form-contenu'>\n\t\t<div class='row'>\n\t\t\t<label class='etiquette' for='import_lec'>" . $msg["import_lec_fichier"] . "</label>\n\t <input name='import_lec' id='import_lec' accept='text/plain' type='file' class='saisie-80em' size='80'>\n\t\t\t</div>\n\t\t<div class='row'>\n\t <label class='etiquette' for='Sep_Champs'>" . $msg["import_lec_separateur"] . "</label>\n\t <select name='Sep_Champs' id='Sep_Champs'>\n\t <option value=';' selected>;</option>\n\t <option value='.'>.</option>\n\t </select>\n\t </div>\n\t <div class='row'>\n\t <label class='etiquette' for='file_format'>Format du fichier</label>\n\t <select name='file_format' id='file_format' onchange='display_part(this.value);'>\n\t <option value='ensae' selected>ENSAE</option>\n\t <option value='ensai'>ENSAI</option>\n\t </select>\n\t </div>\n\t <br />\n\t <div style='display:table'>\n\t \t<div style='display:table-row'>\n\t\t \t<div id=div_ensae style='display:table-cell;width:50%'>\n\t\t \t\t<div class='row'>\n\t\t\t\t\t\t<p>L'ordre des colonnes dans votre fichier doit être :<br />\n\t\t\t\t\t\t<font size='1'>Identifiant de l'étudiant ; Code-barres ; Voie ; Nom ; Prénom ; Mail ; Mail perso ; Numéro de casier ; Civilité ; Année de date de naissance ; Téléphone 1 ; Téléphone 2 ; Identifiant OPAC</font>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t <input type=hidden name='type_import' id='type_import' value='maj_complete' />\n\t\t\t\t <label class='etiquette' for='type_import'>Mise à jour complète</label>\n\t\t\t\t Marquer les lecteurs appartenant aux groupes ci-dessous et ayant pour catégorie et localisation les choix ci-dessous\n\t\t\t\t <blockquote>" . "\n\t\t\t\t Et les placer dans le panier suivant: "; $requete = "SELECT idemprcaddie, name FROM empr_caddie where (autorisations='{$PMBuserid}' or autorisations like '{$PMBuserid} %' or autorisations like '% {$PMBuserid} %' or autorisations like '% {$PMBuserid}') order by name "; print gen_liste($requete, "idemprcaddie", "name", "idemprcaddie", "", "", "", "", "", "", 0); print "</blockquote>\n\t\t\t\t </div>\n\t\t\t\t <div class='row'>\n\t\t\t\t\t <blockquote>\n\t\t\t\t\t \t<div class='colonne3'>"; $requete = "SELECT id_groupe, libelle_groupe FROM groupe left join empr_groupe on id_groupe=groupe_id group by id_groupe, libelle_groupe ORDER BY libelle_groupe "; $groupe_form_aff = gen_liste_multiple($requete, "id_groupe", "libelle_groupe", "id_groupe", "id_grp[]", "", $id, 0, $msg[empr_form_aucungroupe], 0, "", 60); print "<div class='row'>\n\t\t\t\t\t\t\t\t\t<label for='form_ajoutgroupe' class='etiquette'>Groupes :</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='row'>" . $groupe_form_aff . "</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='colonne3'>"; $requete = "SELECT id_categ_empr, libelle FROM empr_categ ORDER BY libelle "; $categ_form_aff = gen_liste($requete, "id_categ_empr", "libelle", "id_categ_empr", "", 36, "", "", "", "", 0); print "<div class='row'>\n\t\t\t\t\t\t\t\t\t<label for='form_categ_empr' class='etiquette'>Catégorie de lecteurs :</label>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='row'>" . $categ_form_aff . "</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='colonne_suite'>"; print "<div class='row'>\n\t\t\t\t\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t\t\t\t\t<label for='form_empr_location' class='etiquette'>{$msg['empr_location']}:</label>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t\t\t\t\t\t" . docs_location::gen_combo_box_empr($deflt2docs_location, 0) . "\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</blockquote>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id=div_ensai style='display:table-cell;width:50%;display:none'>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t<p>L'ordre des colonnes dans votre fichier doit être :<br />\n\t\t\t\t\t\t<font size='1'>Nom ; Prénom ; Mail ; Mail perso ; Catégorie ; Groupe 1 ; Groupe 2 ; Groupe 3 ; Libellé du statut ; Libellé de la localisation ; Pays ; Date d'adhésion du lecteur ; Date d'expiration du lecteur ; Code-barres ; Identifiant OPAC ; Téléphone 1 ; Téléphone 2</font>\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class='row'>\n\t\t\t\t \n\t\t\t\t <label class='etiquette' for='type_import_1'>Insertion uniquement</label>\n\t\t\t\t </div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row'> </div>\n\t</div>\n\t<div class='row'>\n\t\t<input name='imp_elv' type='submit' class='bouton' value='Import des élèves'/>\n\t</div>\n\t</form>"; }
function get_cb_dsi($title_form, $message, $form_action, $form_cb = "") { global $dsi_search_tmpl; global $deflt2docs_location, $empr_location_id, $pmb_lecteurs_localises; $dsi_search_tmpl = str_replace("!!titre_formulaire!!", $title_form, $dsi_search_tmpl); $dsi_search_tmpl = str_replace("!!form_action!!", $form_action, $dsi_search_tmpl); $dsi_search_tmpl = str_replace("!!message!!", $message, $dsi_search_tmpl); $dsi_search_tmpl = str_replace("!!cb_initial!!", $form_cb, $dsi_search_tmpl); if ((string) $empr_location_id == "") { $empr_location_id = $deflt2docs_location; } if ($pmb_lecteurs_localises) { $dsi_search_tmpl = str_replace("!!restrict_location!!", docs_location::gen_combo_box_empr($empr_location_id), $dsi_search_tmpl); } else { $dsi_search_tmpl = str_replace("!!restrict_location!!", "", $dsi_search_tmpl); } return $dsi_search_tmpl; }
function show_form($param = '') { global $msg, $pmb_transferts_actif, $pmb_location_reservation; //paramètres pré-enregistré $lst_opt = array(); if ($param['chk_resa']) { foreach ($param['chk_resa'] as $elem) { $lst_opt[$elem] = $elem; } } $empr_location_id = $param['empr_location_id']; //Choix de l'action à réaliser $form_task .= "\n\t\t<div class='row'>\n\t\t\t<div class='colonne3'>\n\t\t\t\t<label for='resa'>" . $this->msg["planificateur_resa_empr"] . "</label>\n\t\t\t</div>\n\t\t\t<div class='colonne_suite'>\n\t\t\t\t<input type='checkbox' name='chk_resa[]' value='resa_en_cours_noconf' " . ($lst_opt["resa_en_cours_noconf"] == "resa_en_cours_noconf" ? "checked" : "") . " />" . $this->msg["resa_en_cours_noconf"] . "\n\t\t\t\t<br /><input type='checkbox' name='chk_resa[]' value='resa_depassee_noconf' " . ($lst_opt["resa_depassee_noconf"] == "resa_depassee_noconf" ? "checked" : "") . " />" . $this->msg["resa_depassee_noconf"] . "\n\t\t\t</div>\n\t\t</div>\n\t\t<div class='row' > </div>"; if ($pmb_transferts_actif == "1" || $pmb_location_reservation) { //Choix de la localisation $form_task .= "\n\t\t\t<div class='row'>\n\t\t\t\t<div class='colonne3'>\n\t\t\t\t\t<label for='resa'>" . $this->msg["planificateur_resa_loc"] . "</label>\n\t\t\t\t</div>\n\t\t\t\t<div class='colonne_suite'>" . docs_location::gen_combo_box_empr($empr_location_id) . "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='row' > </div>"; } return $form_task; }
function generate_form_inscription() { global $subs_form_create, $msg; global $f_nom, $f_prenom, $f_email; global $f_msg, $f_adr1, $f_adr2, $f_cp, $f_ville, $f_pays, $f_tel1; $subs_form_create = str_replace("!!f_nom!!", stripslashes($f_nom), $subs_form_create); $subs_form_create = str_replace("!!f_prenom!!", stripslashes($f_prenom), $subs_form_create); $subs_form_create = str_replace("!!f_email!!", stripslashes($f_email), $subs_form_create); $subs_form_create = str_replace("!!f_login!!", stripslashes($f_login), $subs_form_create); $subs_form_create = str_replace("!!f_password!!", "", $subs_form_create); $subs_form_create = str_replace("!!f_passwordv!!", "", $subs_form_create); $subs_form_create = str_replace("!!f_adr1!!", stripslashes($f_adr1), $subs_form_create); $subs_form_create = str_replace("!!f_adr2!!", stripslashes($f_adr2), $subs_form_create); $subs_form_create = str_replace("!!f_cp!!", stripslashes($f_cp), $subs_form_create); $subs_form_create = str_replace("!!f_ville!!", stripslashes($f_ville), $subs_form_create); $subs_form_create = str_replace("!!f_pays!!", stripslashes($f_pays), $subs_form_create); $subs_form_create = str_replace("!!f_tel1!!", stripslashes($f_tel1), $subs_form_create); $subs_form_create = str_replace("!!f_msg!!", stripslashes($f_msg), $subs_form_create); $subs_form_create = str_replace("!!f_loc!!", docs_location::gen_combo_box_empr("", 0), $subs_form_create); $subs_form_create = str_replace("!!others_informations!!", prepare_post_others_informations(), $subs_form_create); return $subs_form_create; }
function show_serial_info($serial_id, $page, $nbr_lignes) { global $serial_action_bar; global $dbh; global $msg; global $nb_per_page_a_search; global $charset; global $deflt_collstate_location, $location; global $pmb_etat_collections_localise, $pmb_droits_explr_localises, $explr_invisible, $explr_visible_unmod; // barre de restriction des bulletins affichés global $aff_bulletins_restrict_numero, $aff_bulletins_restrict_date, $aff_bulletins_restrict_periode; global $view; global $sort_children; global $pmb_opac_url; if ($pmb_etat_collections_localise) { if ($view == "collstate") { global $id; if (isset($id) && $deflt_collstate_location === "0") { //Affiche tous les états de collection après création/modification $location = $deflt_collstate_location; } else { $location = (string) $location == "" ? $deflt_collstate_location : $location; } } else { $location = (string) $location == "" ? $deflt_collstate_location : $location; } } // lien d'ajout d'une notice mère à un caddie $selector_prop = "toolbar=no, dependent=yes, width=500, height=400, resizable=yes, scrollbars=yes"; $cart_click_noti = "onClick=\"openPopUp('./cart.php?object_type=NOTI&item=!!item!!', 'cart', 600, 700, -2, -2, '{$selector_prop}')\""; $cart_link = "<img src='./images/basket_small_20x20.gif' align='middle' alt='basket' title=\"{$msg[400]}\" {$cart_click_noti}>"; if ($current !== false) { $print_action = " <a href='#' onClick=\"openPopUp('./print.php?current_print={$current}¬ice_id=" . $serial_id . "&action_print=print_prepare','print',500,600,-2,-2,'scrollbars=yes,menubar=0'); w.focus(); return false;\"><img src='./images/print.gif' border='0' align='center' alt=\"" . $msg["histo_print"] . "\" title=\"" . $msg["histo_print"] . "\"/></a>"; } $visualise_click_notice = "\n\t<script type=\"text/javascript\" src='./javascript/select.js'></script>\n\t\n\t<a href='#' onClick='show_frame(\"{$pmb_opac_url}" . "notice_view.php?id={$serial_id}\")'><img src='./images/search.gif' align='middle' title=\"{$msg["noti_see_gestion"]}\" name='imEx' border='0' /></a>"; $base_url = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}"; $serial_action_bar = str_replace('!!serial_id!!', $serial_id, $serial_action_bar); if ($serial_id) { $myQuery = pmb_mysql_query("SELECT * FROM notices WHERE notice_id={$serial_id} ", $dbh); } if ($serial_id && pmb_mysql_num_rows($myQuery)) { //Bulletins $myPerio = pmb_mysql_fetch_object($myQuery); // 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 ) { $isbd = new serial_display($myPerio, 5, "", "", "", "", "./catalog.php?categ=serials&sub=explnum_form&serial_id=!!serial_id!!&explnum_id=!!explnum_id!!"); $perio_header = $isbd->header; // isbd du périodique $perio_isbd = $isbd->isbd; $isbd->get_etat_periodique(); $perio_isbd .= $isbd->print_etat_periodique(); global $avis_quoifaire, $valid_id_avis; $perio_isbd = str_replace('<!-- !!avis_notice!! -->', avis_notice($serial_id, $avis_quoifaire, $valid_id_avis), $perio_isbd); if (!$page) { $page = 1; } $debut = ($page - 1) * $nb_per_page_a_search; switch ($view) { case "abon": $base_url = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}&view=abon"; require_once "views/view_abon.inc.php"; break; case "modele": require_once "views/view_modeles.inc.php"; break; case "collstate": $base_url = "./catalog.php?categ=serials&sub=view&serial_id={$serial_id}&view=collstate"; require_once "views/view_collstate.inc.php"; break; default: // barre de restriction des bulletins affichés $clause = ""; if ($aff_bulletins_restrict_numero) { $clause = " and bulletin_numero like '%" . str_replace("*", "%", $aff_bulletins_restrict_numero) . "%' "; $base_url .= "&aff_bulletins_restrict_numero=" . urlencode($aff_bulletins_restrict_numero); } if ($aff_bulletins_restrict_date) { $aff_bulletins_restrict_date_traite = str_replace("*", "%", $aff_bulletins_restrict_date); $tab_bulletins_restrict_date = explode($msg[format_date_input_separator], $aff_bulletins_restrict_date_traite); if (count($tab_bulletins_restrict_date) == 3) { $aff_bulletins_restrict_date_traite = $tab_bulletins_restrict_date[2] . "-" . $tab_bulletins_restrict_date[1] . "-" . $tab_bulletins_restrict_date[0]; } if (count($tab_bulletins_restrict_date) == 2) { $aff_bulletins_restrict_date_traite = $tab_bulletins_restrict_date[1] . "-" . $tab_bulletins_restrict_date[0]; } if (count($tab_bulletins_restrict_date) == 1) { $aff_bulletins_restrict_date_traite = $tab_bulletins_restrict_date[0]; } $clause .= " and date_date like '%" . $aff_bulletins_restrict_date_traite . "%'"; $base_url .= "&aff_bulletins_restrict_date=" . urlencode($aff_bulletins_restrict_date); } if ($aff_bulletins_restrict_periode) { $aff_bulletins_restrict_periode_traite = str_replace("*", "%", $aff_bulletins_restrict_periode); $clause .= " and mention_date like '%" . $aff_bulletins_restrict_periode_traite . "%'"; $base_url .= "&aff_bulletins_restrict_periode=" . urlencode($aff_bulletins_restrict_periode); } //On compte les expl de la localisation $rqt = "SELECT COUNT(1) FROM bulletins " . ($location ? ", exemplaires" : "") . " WHERE " . ($location ? "(expl_bulletin=bulletin_id and expl_location='{$location}' or expl_location is null) and " : "") . " bulletin_notice='{$serial_id}' "; $myQuery = pmb_mysql_query($rqt, $dbh); $nb_expl_loc = pmb_mysql_result($myQuery, 0, 0); //On compte les bulletins de la localisation $rqt = "SELECT count(distinct bulletin_id) FROM bulletins " . ($location ? ",exemplaires " : "") . " WHERE " . ($location ? "(expl_bulletin=bulletin_id and expl_location='{$location}') and " : "") . " bulletin_notice='{$serial_id}' "; $myQuery = pmb_mysql_query($rqt, $dbh); if ($execute_query && pmb_mysql_num_rows($myQuery)) { $nb_bull_loc = pmb_mysql_result($myQuery, 0, 0); } //On compte les bulletinsà afficher $rqt = "SELECT count(distinct bulletin_id) FROM bulletins " . ($location ? ", exemplaires" : "") . " WHERE " . ($location ? "(expl_bulletin=bulletin_id and expl_location='{$location}' or expl_location is null) and " : "") . " bulletin_notice='{$serial_id}' {$clause} "; $myQuery = pmb_mysql_query($rqt, $dbh); $nbr_lignes = pmb_mysql_result($myQuery, 0, 0); require_once "views/view_bulletins.inc.php"; break; } // Gestion de la supression de la notice si les droits de modification des exemplaires sont localisés. $flag_no_delete_notice = 0; //visibilité des exemplaires if ($pmb_droits_explr_localises) { global $explr_visible_mod; $explr_tab_modif = explode(",", $explr_visible_mod); $requete = "SELECT expl_location from exemplaires, bulletins,notices where\n\t\t\t\texpl_bulletin=bulletin_id and bulletin_notice=notice_id and notice_id= {$serial_id}"; $execute_query = pmb_mysql_query($requete); if ($execute_query && pmb_mysql_num_rows($execute_query)) { while ($r = pmb_mysql_fetch_object($execute_query)) { if (!in_array($r->expl_location, $explr_tab_modif)) { $flag_no_delete_notice = 1; } } } } if (!$flag_no_delete_notice) { $serial_action_bar = str_replace('!!delete_serial_button!!', "<input type='button' class='bouton' onclick=\"confirm_serial_delete();\" value='{$msg['63']}' />", $serial_action_bar); } else { $serial_action_bar = str_replace('!!delete_serial_button!!', "", $serial_action_bar); } $serial_action_bar = str_replace('!!issn!!', $myPerio->code, $serial_action_bar); // action_bar : serials.tpl.php... // mise à jour des info du javascript $serial_action_bar = str_replace('!!nb_bulletins!!', $isbd->serial_nb_bulletins, $serial_action_bar); $serial_action_bar = str_replace('!!nb_articles!!', $isbd->serial_nb_articles, $serial_action_bar); $serial_action_bar = str_replace('!!nb_expl!!', $isbd->serial_nb_exemplaires, $serial_action_bar); $serial_action_bar = str_replace('!!nb_etat_coll!!', $isbd->serial_nb_etats_collection, $serial_action_bar); $serial_action_bar = str_replace('!!nb_abo!!', $isbd->serial_nb_abo_actif, $serial_action_bar); // titre général du périodique print pmb_bidi("<div class='row'>\n\t \t\t\t<div class='notice-perio'>{$isbd->aff_statut}\n\t\t\t\t\t<h2 style='display: inline;'>" . str_replace('!!item!!', $serial_id, $cart_link) . $print_action . $visualise_click_notice . " " . $perio_header . "</h2>\n\t \t\t\t\t\t<div class='row'>{$perio_isbd}</div>\n\t\t\t\t\t\t\t<div class='row'>{$collections_state}</div>\n\t \t\t\t\t<hr />\n\t \t\t\t\t<div class='row'>\n\t \t\t\t\t\t{$serial_action_bar}\n\t \t\t\t\t\t</div>\n\t \t\t\t\t</div>\n\t \t\t\t</div>"); // bulletinage $onglets = "\n\t\t<div id='content_onglet_perio'>\n\t\t\t<span class='" . (!$view ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\" onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "'\">" . $msg["abts_onglet_bull"] . "</a></span>\n\t\t\t<span class='" . ($view == "abon" ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\" onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "&view=abon'\">" . $msg["abts_onglet_abt"] . "</a></span>\n\t\t\t<span class='" . ($view == "modele" ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\" onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "&view=modele'\">" . $msg["abts_onglet_modele"] . "</a></span>\n\t\t\t<span class='" . ($view == "collstate" ? "onglet-perio-selected'>" : "onglets-perio'>") . "<a href=\"#\" onClick=\"document.location='catalog.php?categ=serials&sub=view&serial_id=" . $serial_id . "&view=collstate'\">" . $msg["abts_onglet_collstate"] . "</a></span>\n\t\t</div>\n\t\t"; print $onglets; $totaux_loc = ""; $temp_location = 0; $list_locs = ""; switch ($view) { case "modele": $list_locs = ""; break; case "abon": if ($location) { $temp_location = $location; } $list_locs = docs_location::gen_combo_box_empr($temp_location, 1, "document.filter_form.location.value=this.options[this.selectedIndex].value; document.filter_form.submit();"); $link_bulletinage = "<a href='./catalog.php?categ=serials&sub=pointage&serial_id={$serial_id}&location_view={$location}'>" . $msg["link_notice_to_bulletinage"] . "</a>"; break; case "collstate": if ($pmb_etat_collections_localise) { if ($location) { $temp_location = $location; } $list_locs = docs_location::gen_combo_box_empr($temp_location, 1, "document.filter_form.location.value=this.options[this.selectedIndex].value; document.filter_form.submit();"); } $link_bulletinage = "<input type='button' class='bouton' value='" . $msg["collstate_add_collstate"] . "' \n\t\t\t\tonClick=\"document.location='./catalog.php?categ=serials&sub=collstate_form&serial_id={$serial_id}&id=';\">"; break; default: if ($location) { $temp_location = $location; } $list_locs = docs_location::gen_combo_box_empr($temp_location, 1, "document.filter_form.location.value=this.options[this.selectedIndex].value; document.filter_form.submit();"); $link_bulletinage = "<a href='./catalog.php?categ=serials&sub=pointage&serial_id={$serial_id}&location_view={$location}'>" . $msg["link_notice_to_bulletinage"] . "</a>"; if ($nb_bull_loc) { if ($temp_location && $list_locs) { $totaux_loc = "<strong>{$nb_bull_loc}</strong> " . $msg["serial_nb_bulletin"] . "\n\t\t\t\t\t\t<strong>{$nb_expl_loc}</strong> " . $msg["bulletin_nb_ex"]; } } break; } print pmb_bidi("\n\t\t<div class='bulletins-perio'>\n\t\t\t<div class='row'>\n\t\t\t\t<h3>" . ($view == "abon" ? $msg["perio_abts_title"] : ($view == "modele" ? $msg["perio_modeles_title"] : ($view == "collstate" ? $msg["abts_onglet_collstate"] : $msg["4001"]))) . " {$list_locs}\n\t\t\t\t{$link_bulletinage}\n\t\t\t\t</h3>\n\t\t\t\t{$totaux_loc}\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<div align='center'>\n\t\t\t\t\t{$pages_display}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t{$bulletins}\n\t\t\t</div>\n\t\t\t<div class='row'>\n\t\t\t\t<div align='center'>\n\t\t\t\t\t{$pages_display}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>"); } }
function traite_exemplaires() { global $msg, $dbh; global $prix, $notice_id, $info_995, $typdoc_995, $tdoc_codage, $book_lender_id, $section_995, $sdoc_codage, $book_statut_id, $locdoc_codage, $codstatdoc_995, $statisdoc_codage, $cote_mandatory; global $info_461, $bulletin_ex; // lu en 010$d de la notice $price = $prix[0]; // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ $expl['cb'] = $info_995[$nb_expl]['f']; if ($bulletin_ex && is_array($info_461)) { $expl['bulletin'] = $bulletin_ex; $expl['notice'] = 0; } else { $expl['notice'] = $notice_id; $expl['bulletin'] = 0; } $data_doc = array(); $data_doc['duree_pret'] = 0; /* valeur par défaut */ $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['r']; $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']; $data_doc['tdoc_owner'] = 0; $expl['typdoc'] = docs_type::import($data_doc); $expl['cote'] = $info_995[$nb_expl]['k']; if (!trim($expl['cote'])) { $expl['cote'] = "INDETERMINE"; } $data_doc = array(); if (!$info_995[$nb_expl]['q']) { $info_995[$nb_expl]['q'] = "INDETERMINE"; } $data_doc['section_libelle'] = $info_995[$nb_expl]['q']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['q']; $data_doc['sdoc_owner'] = 0; $expl['section'] = docs_section::import($data_doc); $expl['statut'] = $book_statut_id; $data_doc = array(); $data_doc['location_libelle'] = "CDI"; $data_doc['locdoc_codage_import'] = "CDI"; $data_doc['locdoc_owner'] = 0; $expl['location'] = docs_location::import($data_doc); $data_doc = array(); if (!$info_995[$nb_expl]['q']) { $info_995[$nb_expl]['q'] = "IN"; } $data_doc['codestat_libelle'] = $info_995[$nb_expl]['q']; $data_doc['statisdoc_codage_import'] = $info_995[$nb_expl]['q']; $data_doc['statisdoc_owner'] = 0; $expl['codestat'] = docs_codestat::import($data_doc); $expl['note'] = $info_995[$nb_expl]['u']; $expl['prix'] = $price; $expl['expl_owner'] = $book_lender_id; $expl['cote_mandatory'] = $cote_mandatory; $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } //debug : affichage zone 995 /* echo "995\$a =".$info_995[$nb_expl]['a']."<br />"; echo "995\$b =".$info_995[$nb_expl]['b']."<br />"; echo "995\$c =".$info_995[$nb_expl]['c']."<br />"; echo "995\$d =".$info_995[$nb_expl]['d']."<br />"; echo "995\$f =".$info_995[$nb_expl]['f']."<br />"; echo "995\$k =".$info_995[$nb_expl]['k']."<br />"; echo "995\$m =".$info_995[$nb_expl]['m']."<br />"; echo "995\$n =".$info_995[$nb_expl]['n']."<br />"; echo "995\$o =".$info_995[$nb_expl]['o']."<br />"; echo "995\$q =".$info_995[$nb_expl]['q']."<br />"; echo "995\$r =".$info_995[$nb_expl]['r']."<br />"; echo "995\$u =".$info_995[$nb_expl]['u']."<br /><br />"; */ } // fin for }
function show_empr_form($form_action, $form_cancel, $link, $id, $cb, $duplicate_empr_from_id = "") { global $empr_form; global $dbh, $msg, $charset; global $biblio_email; global $aff_list_empr; global $deflt2docs_location; global $pmb_lecteurs_localises; global $pmb_gestion_abonnement, $pmb_gestion_financiere, $empr_abonnement_default_debit; global $empr_prolong_calc_date_adhes_depassee; global $database_window_title; global $lang; global $pmb_rfid_activate, $pmb_rfid_serveur_url; global $pmb_opac_view_activate; // si $id est fourni, il s'agit d'une modification. on recupere les donnees dans $link if ($id) { // modification echo window_title($database_window_title . $msg[55]); $entete = $msg[55]; if ($pmb_rfid_activate == 1 && $pmb_rfid_serveur_url) { $script_rfid_encode = "if(script_rfid_encode()==false) return false;"; } else { $script_rfid_encode = ''; } $empr_form = str_replace("!!questionrfid!!", $script_rfid_encode, $empr_form); $requete = "SELECT * FROM empr WHERE id_empr='{$id}' "; $res = mysql_query($requete, $link); if ($res) { $empr = mysql_fetch_object($res); } else { error_message($msg[53], $msg[54], 0); } } else { // création $empr = new stdClass(); $entete = $msg[15]; $empr_form = str_replace("!!questionrfid!!", '', $empr_form); } if ($duplicate_empr_from_id) { $empr_form = str_replace("!!id!!", "", $empr_form); $empr_form = str_replace("!!entete!!", $msg["empr_duplicate"], $empr_form); } else { $empr_form = str_replace("!!id!!", $id, $empr_form); $empr_form = str_replace("!!entete!!", $entete, $empr_form); } $empr_form = str_replace("!!form_action!!", $form_action, $empr_form); if ($empr->empr_cb) { //Si il y a un code lecteur if (!$duplicate_empr_from_id) { $empr_form = str_replace("!!cb!!", $empr->empr_cb, $empr_form); } else { $empr_form = str_replace("!!cb!!", $cb, $empr_form); } $date_adhesion = !$duplicate_empr_from_id ? $empr->empr_date_adhesion : date('Y-m-d'); $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=empr_form&date_caller=" . preg_replace('/-/', '', $date_adhesion) . "¶m1=form_adhesion¶m2=form_adhesion_lib&auto_submit=NO&date_anterieure=YES', 'date_adhesion', 250, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" "; $adhesion = "\n\t\t\t\t<input type='hidden' name='form_adhesion' value='" . preg_replace('/-/', '', $date_adhesion) . "' />\n\t\t\t\t<input class='bouton' type='button' name='form_adhesion_lib' value='" . formatdate($date_adhesion) . "' " . $date_clic . " />"; $empr_form = str_replace("!!adhesion!!", $adhesion, $empr_form); $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=empr_form&date_caller=" . preg_replace('/-/', '', $empr->empr_date_expiration) . "¶m1=form_expiration¶m2=form_expiration_lib&auto_submit=NO&date_anterieure=YES', 'date_adhesion', 205, 300, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" "; $expiration = "\n\t\t\t\t<input type='hidden' id='form_expiration' name='form_expiration' value='" . preg_replace('/-/', '', $empr->empr_date_expiration) . "' />\n\t\t\t\t<input class='bouton' type='button' id='form_expiration_lib' name='form_expiration_lib' value='" . formatdate($empr->empr_date_expiration) . "' " . $date_clic . " />"; $empr_form = str_replace("!!expiration!!", $expiration, $empr_form); // ajout ici des trucs sur la relance adhésion $empr_temp = new emprunteur($id, '', FALSE, 0); $aff_relance = ""; if ($empr_temp->adhesion_renouv_proche() || $empr_temp->adhesion_depassee()) { if ($empr_temp->adhesion_depassee()) { $mess_relance = $msg[empr_date_depassee]; } else { $mess_relance = $msg[empr_date_renouv_proche]; } $rqt = "select duree_adhesion from empr_categ where id_categ_empr='{$empr_temp->categ}'"; $res_dur_adhesion = mysql_query($rqt, $dbh); $row = mysql_fetch_row($res_dur_adhesion); $nb_jour_adhesion_categ = $row[0]; if ($empr_prolong_calc_date_adhes_depassee && $empr_temp->adhesion_depassee()) { $rqt_date = "select date_add(curdate(),INTERVAL 1 DAY) as nouv_date_debut,\n\t\t\t\t\t\tdate_add(curdate(),INTERVAL {$nb_jour_adhesion_categ} DAY) as nouv_date_fin "; } else { $rqt_date = "select date_add('{$empr_temp->date_expiration}',INTERVAL 1 DAY) as nouv_date_debut,\n\t\t\t\t\t\tdate_add('{$empr_temp->date_expiration}',INTERVAL {$nb_jour_adhesion_categ} DAY) as nouv_date_fin "; } $resultatdate = mysql_query($rqt_date) or die("<br /> {$rqt_date} " . mysql_error()); $resdate = mysql_fetch_object($resultatdate); $nouv_date_debut = $resdate->nouv_date_debut; $nouv_date_fin = $resdate->nouv_date_fin; $nouv_date_debut_formatee = formatdate($nouv_date_debut); $nouv_date_fin_formatee = formatdate($nouv_date_fin); // on conserve la date d'adhésion initiale $action_prolonger = "this.form.form_expiration.value = '{$nouv_date_fin}';\n\t\t\t\tthis.form.form_expiration_lib.value = '{$nouv_date_fin_formatee}';\n\t\t\t\t"; $action_relance_courrier = "openPopUp('./pdf.php?pdfdoc=lettre_relance_adhesion&id_empr={$id}', 'lettre', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes'); return(false) "; $aff_relance = "<div class='row'>\n\t\t\t\t\t\t<span class='erreur'>{$mess_relance}</span><br />\n\t\t\t\t\t\t<input class='bouton' type='button' value=\"" . $msg[prolonger] . "\" onClick=\"{$action_prolonger}\" /> \n\t\t\t\t\t\t<input class='bouton' type='button' value=\"" . $msg[prolong_courrier] . "\" onClick=\"{$action_relance_courrier}\" />"; if ($empr_temp->mail && $biblio_email) { $action_relance_mail = "if (confirm('" . $msg["mail_retard_confirm"] . "')) {openPopUp('./mail.php?type_mail=mail_relance_adhesion&id_empr={$id}', 'mail', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes, scrollbars=yes'); } return(false) "; $aff_relance .= " <input class='bouton' type='button' value=\"" . $msg['prolong_mail'] . "\" onClick=\"{$action_relance_mail}\" />"; } $aff_relance .= "</div>"; if ($pmb_gestion_financiere && $pmb_gestion_abonnement) { $aff_relance .= "<div class='row'><input type='radio' name='debit' value='0' id='debit_0' " . (!$empr_abonnement_default_debit ? "checked" : "") . " /><label for='debit_0'>" . $msg["finance_abt_no_debit"] . "</label> <input type='radio' name='debit' value='1' id='debit_1' " . ($empr_abonnement_default_debit == 1 ? "checked" : "") . " />"; $aff_relance .= "<label for='debit_1'>" . $msg["finance_abt_debit_wo_caution"] . "</label> "; if ($pmb_gestion_abonnement == 2) { $aff_relance .= "<input type='radio' name='debit' value='2' id='debit_2' " . ($empr_abonnement_default_debit == 2 ? "checked" : "") . " /><label for='debit_2'>" . $msg["finance_abt_debit_wt_caution"] . "</label>"; } $aff_relance .= "</div>"; } } $empr_form = str_replace("!!adhesion_proche_depassee!!", $aff_relance, $empr_form); //Liste des types d'abonnement $list_type_abt = ""; if ($pmb_gestion_abonnement == 2 && $pmb_gestion_financiere) { $requete = "select * from type_abts order by type_abt_libelle "; $resultat_abt = mysql_query($requete); $user_loc = $deflt2docs_location; $t_type_abt = array(); while ($res_abt = mysql_fetch_object($resultat_abt)) { $locs = explode(",", $res_abt->localisations); $as = array_search($user_loc, $locs); if ($as !== false && $as !== null || !$res_abt->localisations) { $t_type_abt[] = $res_abt; } } if (count($t_type_abt)) { $list_type_abt = "<div class='row'>\n<label for='type_abt'>" . $msg["finance_type_abt"] . "</label></div>\n<div class='row'>\n<select name='type_abt' id='type_abt'>\n"; for ($i = 0; $i < count($t_type_abt); $i++) { $list_type_abt .= "<option value='" . $t_type_abt[$i]->id_type_abt . "'"; if ($empr->type_abt == $t_type_abt[$i]->id_type_abt) { $list_type_abt .= " selected"; } $list_type_abt .= ">" . htmlentities($t_type_abt[$i]->type_abt_libelle, ENT_QUOTES, $charset) . "</option>\n"; } $list_type_abt .= "</select></div>"; } } $empr_form = str_replace("!!typ_abonnement!!", $list_type_abt, $empr_form); } else { // création de lecteur $empr->empr_date_adhesion = today(); $empr_form = str_replace('!!cb!!', $cb, $empr_form); $date_clic = "onClick=\"openPopUp('./select.php?what=calendrier&caller=empr_form&date_caller=" . preg_replace('/-/', '', $empr->empr_date_adhesion) . "¶m1=form_adhesion¶m2=form_adhesion_lib&auto_submit=NO&date_anterieure=YES', 'date_adhesion', 250, 260, -2, -2, 'toolbar=no, dependent=yes, resizable=yes')\" "; $adhesion = "{$msg['1401']}{$msg['1901']}\n\t\t\t\t<input type='hidden' name='form_adhesion' value='" . preg_replace('/-/', '', $empr->empr_date_adhesion) . "'>\n\t\t\t\t<input class='bouton' type='button' name='form_adhesion_lib' value='" . formatdate($empr->empr_date_adhesion) . "' " . $date_clic . " />"; $empr_form = str_replace("!!adhesion!!", $adhesion, $empr_form); $empr_form = str_replace("!!adhesion_proche_depassee!!", "", $empr_form); $empr_form = str_replace("!!expiration!!", "<input type='hidden' name='form_expiration' value=''>", $empr_form); //Liste des types d'abonnement $list_type_abt = ""; if ($pmb_gestion_abonnement == 2 && $pmb_gestion_financiere) { $requete = "select * from type_abts"; $resultat_abt = mysql_query($requete); $user_loc = $deflt2docs_location; $t_type_abt = array(); while ($res_abt = mysql_fetch_object($resultat_abt)) { $locs = explode(",", $res_abt->localisations); $as = array_search($user_loc, $locs); if ($as !== false && $as !== null || !$res_abt->localisations) { $t_type_abt[] = $res_abt; } } if (count($t_type_abt)) { $list_type_abt = "<div class='row'>\n<label for='type_abt'>" . $msg["finance_type_abt"] . "</label></div>\n<div class='row'>\n<select name='type_abt' id='type_abt'>\n"; for ($i = 0; $i < count($t_type_abt); $i++) { $list_type_abt .= "<option value='" . $t_type_abt[$i]->id_type_abt . "'>" . htmlentities($t_type_abt[$i]->type_abt_libelle, ENT_QUOTES, $charset) . "</option>\n"; } $list_type_abt .= "</select></div>"; } } $empr_form = str_replace("!!typ_abonnement!!", $list_type_abt, $empr_form); } $empr_form = str_replace("!!nom!!", htmlentities($empr->empr_nom, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!prenom!!", htmlentities($empr->empr_prenom, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!adr1!!", htmlentities($empr->empr_adr1, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!adr2!!", htmlentities($empr->empr_adr2, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!cp!!", htmlentities($empr->empr_cp, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!ville!!", htmlentities($empr->empr_ville, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!pays!!", htmlentities($empr->empr_pays, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!mail!!", htmlentities($empr->empr_mail, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!tel1!!", htmlentities($empr->empr_tel1, ENT_QUOTES, $charset), $empr_form); if (!$empr->empr_sms) { $empr_sms_chk = ''; } else { $empr_sms_chk = "checked='checked'"; } $empr_form = str_replace('!!sms!!', $empr_sms_chk, $empr_form); $empr_form = str_replace("!!tel2!!", htmlentities($empr->empr_tel2, ENT_QUOTES, $charset), $empr_form); $empr_form = str_replace("!!prof!!", htmlentities($empr->empr_prof, ENT_QUOTES, $charset), $empr_form); if ($empr->empr_year != 0) { $empr_form = str_replace("!!year!!", htmlentities($empr->empr_year, ENT_QUOTES, $charset), $empr_form); } else { $empr_form = str_replace("!!year!!", "", $empr_form); } if (!$empr->empr_lang) { $empr->empr_lang = $lang; } $empr_form = str_replace('!!combo_empr_lang!!', make_empr_lang_combo($empr->empr_lang), $empr_form); if (!$duplicate_empr_from_id) { $empr_form = str_replace('!!empr_login!!', $empr->empr_login, $empr_form); $empr_form = str_replace("!!empr_msg!!", htmlentities($empr->empr_msg, ENT_QUOTES, $charset), $empr_form); } else { $empr_form = str_replace('!!empr_login!!', "", $empr_form); $empr_form = str_replace("!!empr_msg!!", "", $empr_form); } // on récupère le select catégorie $requete = "SELECT id_categ_empr, libelle, duree_adhesion FROM empr_categ ORDER BY libelle "; $res = mysql_query($requete, $link); $nbr_lignes = mysql_num_rows($res); $categ_content = ''; $empr_grille_categ = "<select id='empr_grille_categ' style='display:none;'><option value='0' selected='selected' >" . $msg['all_categories_empr'] . "</value>"; for ($i = 0; $i < $nbr_lignes; $i++) { $row = mysql_fetch_row($res); $categ_content .= "<option value='{$row['0']}'"; if ($row[0] == $empr->empr_categ) { $categ_content .= " selected='selected'"; } $categ_content .= ">{$row['1']}</option>"; $empr_grille_categ .= "<option value='{$row['0']}'>{$row['1']}</option>"; } $empr_grille_categ .= '</select>'; $empr_form = str_replace("!!categ!!", $categ_content, $empr_form); // Ajout des categories et localisations pour edition des grilles $empr_form = str_replace("<!-- empr_grille_categ -->", $empr_grille_categ, $empr_form); if ($pmb_lecteurs_localises) { $empr_grille_location = docs_location::get_html_select(array(0), array('id' => 0, 'msg' => $msg['all_locations_empr']), array('id' => 'empr_grille_location', 'class' => 'saisie-20em', 'style' => 'display:none;')); } else { $empr_grille_location = "<input type='hidden' id='empr_grille_location' value='0' />"; } $empr_form = str_replace("<!-- empr_grille_location -->", $empr_grille_location, $empr_form); $requete = "SELECT id_categ_empr, libelle, duree_adhesion FROM empr_categ ORDER BY libelle "; $res = mysql_query($requete, $link); $grille_categ = "<option value='0' selected='selected'>" . $msg['all_categories_empr'] . "</value>"; for ($i = 0; $i < $nbr_lignes; $i++) { $row = mysql_fetch_row($res); $categ_content .= "<option value='{$row['0']}'"; if ($row[0] == $empr->empr_categ) { $categ_content .= " selected='selected'"; } $categ_content .= ">{$row['1']}</option>"; $grille_categ .= "<option value='{$row['0']}'>{$row['1']}</option>"; } $empr_form = str_replace("!!categ!!", $categ_content, $empr_form); // on récupère le select statut $requete = "SELECT idstatut, statut_libelle FROM empr_statut ORDER BY statut_libelle "; //Si il n'y a pas de statut on prend celui définit pour l'utilisateur if (!$empr->empr_statut) { global $deflt_empr_statut; $empr->empr_statut = $deflt_empr_statut; } $res = mysql_query($requete, $link); $nbr_lignes = mysql_num_rows($res); for ($i = 0; $i < $nbr_lignes; $i++) { $row = mysql_fetch_row($res); $statut_content .= "<option value='{$row['0']}'"; if ($row[0] == $empr->empr_statut) { $statut_content .= " selected='selected'"; } $statut_content .= ">{$row['1']}</option>"; } $empr_form = str_replace("!!statut!!", $statut_content, $empr_form); // et le select code stat // on récupère le select cod stat $requete = "SELECT idcode, libelle FROM empr_codestat ORDER BY libelle "; $res = mysql_query($requete, $link); $nbr_lignes = mysql_num_rows($res); for ($i = 0; $i < $nbr_lignes; $i++) { $row = mysql_fetch_row($res); $cstat_content .= "<option value='{$row['0']}'"; if ($row[0] == $empr->empr_codestat) { $cstat_content .= " selected='selected'"; } $cstat_content .= ">{$row['1']}</option>"; } // mise à jour du sexe switch ($empr->empr_sexe) { case 1: $empr_form = str_replace("sexe_select_1", 'selected', $empr_form); break; case 2: $empr_form = str_replace("sexe_select_2", 'selected', $empr_form); break; default: $empr_form = str_replace("sexe_select_0", 'selected', $empr_form); break; } $empr_form = preg_replace("/sexe_select_[0-2]/m", '', $empr_form); $empr_form = str_replace("!!cstat!!", $cstat_content, $empr_form); // mise à jour du groupe if ($id) { $requete = "SELECT id_groupe, libelle_groupe, ifnull(empr_id,0) as inscription FROM groupe left join empr_groupe on (id_groupe=groupe_id and empr_id=" . $id . ") ORDER BY libelle_groupe"; } else { $requete = "SELECT id_groupe, libelle_groupe, 0 as inscription FROM groupe ORDER BY libelle_groupe"; } $groupe_form_aff = gen_liste_multiple($requete, "id_groupe", "libelle_groupe", "inscription", "id_grp[]", "", $id, 0, $msg[empr_form_aucungroupe], 0, $msg[empr_form_nogroupe], 5); $empr_form = str_replace("!!groupe_ajout!!", $groupe_form_aff, $empr_form); $empr_form = str_replace('!!cancel!!', $form_cancel, $empr_form); // ldap MaxMan if ($empr->empr_ldap) { $form_ldap = "checked"; } else { $form_ldap = ""; } //$empr_form = str_replace('!!empr_password!!', $empr_password, $empr_form); $empr_form = str_replace("!!ldap!!", $form_ldap, $empr_form); $empr_form = str_replace('!!empr_password!!', '', $empr_form); if (!$empr->empr_location) { $empr->empr_location = $deflt2docs_location; } if ($pmb_lecteurs_localises) { $loc = "\n\t\t<div class='row' id='g2_r1' etirable='yes' recept='yes' recepttype='circrow' highlight='circrow_highlight' downlight='circrow_downlight' >\n\t\t\t<div class='colonne4' id='g2_r1_f0' movable='yes' draggable='yes' dragtype='circcell' recept='yes' recepttype='circcell' highlight='circcell_highlight' downlight='circcell_downlight' title='" . htmlentities($msg['empr_location'], ENT_QUOTES, $charset) . "'>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<label for='form_empr_location' class='etiquette'>" . $msg['empr_location'] . "</label>\n\t\t\t\t\t</div>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t!!localisation!!\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t<div class='row'></div>\n\t\t</div>"; //$loc = str_replace('!!localisation!!', docs_location::gen_combo_box_empr($empr->empr_location, 0), $loc); $loc = str_replace('!!localisation!!', docs_location::get_html_select(array($empr->empr_location), array(), array('id' => 'empr_location_id', 'name' => 'empr_location_id')), $loc); } else { $loc = "<input type='hidden' name='empr_location_id' id='empr_location_id' value='" . $empr->empr_location . "'>"; $empr_form = str_replace('<!-- !!localisation!! -->', $loc, $empr_form); } $empr_form = str_replace('<!-- !!localisation!! -->', $loc, $empr_form); if ($pmb_opac_view_activate) { $opac_view_tpl = "\n\t\t\t<div class='row' id='g4_r1_f0' movable='yes' draggable='yes' dragtype='circcell' recept='yes' recepttype='circcell' highlight='circcell_highlight' downlight='circcell_downlight' title='" . htmlentities($msg['empr_form_opac_view'], ENT_QUOTES, $charset) . "'>\t\t\t\t\n\t\t\t\t\t!!opac_view!!\n\t\t\t</div>"; $opac_view = new opac_view(0, $id); $opac_view_tpl = str_replace("!!opac_view!!", gen_plus("opac_view", $msg["empr_form_opac_view"], $opac_view->do_sel_list(), 0), $opac_view_tpl); } $empr_form = str_replace('<!-- !!opac_view!! -->', $opac_view_tpl, $empr_form); //Champs persos $p_perso = new parametres_perso("empr"); $perso_ = $p_perso->show_editable_fields($id); if (count($perso_["FIELDS"])) { $perso = "<div class='row'></div>"; } else { $perso = ""; } $class = "colonne2"; for ($i = 0; $i < count($perso_["FIELDS"]); $i++) { $p = $perso_["FIELDS"][$i]; $perso .= "<div class='{$class}' id='g6_r0_f" . $i . "' movable='yes' draggable='yes' dragtype='circcell' recept='yes' recepttype='circcell' highlight='circcell_highlight' downlight='circcell_downlight' title='" . htmlentities($p['TITRE'], ENT_QUOTES, $charset) . "' >"; $perso .= "<div class='row'><label for='" . $p["NAME"] . "' class='etiquette'>" . $p["TITRE"] . "</label></div>\n"; $perso .= "<div class='row'>"; $perso .= $p["AFF"] . "</div>"; $perso .= "</div>"; if ($class == "colonne2") { $class = "colonne_suite"; } else { $class = "colonne2"; } } if ($class == "colonne_suite") { $perso .= "<div class='{$class}'> </div>"; } $perso .= $perso_["CHECK_SCRIPTS"]; $empr_form = str_replace("!!champs_perso!!", $perso, $empr_form); $empr_form = str_replace('!!empr_notice_override!!', get_rights_form($id), $empr_form); print pmb_bidi($empr_form); }
/** * Formulaire de saisie des suggestions multiples */ function display_form() { global $dbh, $multi_sug_form, $charset, $msg, $src_liste; global $PMBusernom; global $PMBuserprenom; global $origine_id, $type_origine, $acquisition_sugg_categ, $acquisition_sugg_localises; $req = "select * from suggestions_source order by libelle_source"; $res = pmb_mysql_query($req, $dbh); $option = "<option value='0' selected>" . htmlentities($msg['acquisition_sugg_no_src'], ENT_QUOTES, $charset) . "</option>"; $select = ""; while ($src = pmb_mysql_fetch_object($res)) { $select = $src_liste == $src->id_source ? "selected" : ""; $option .= "<option value='" . $src->id_source . "' {$select} >" . htmlentities($src->libelle_source, ENT_QUOTES, $charset) . "</option>"; } if (!$this->liste_sugg) { $multi_sug_form = str_replace("!!max_lignes!!", "1", $multi_sug_form); $ligne = "<tr id='sugg_0'>\n\t\t\t\t\t<td><input type='texte' name='sugg_tit_0' id='sugg_tit_0' value='' disabled /></td>\n\t\t\t\t\t<td><input type='texte' name='sugg_aut_0' id='sugg_aut_0' value=''disabled /></td>\n\t\t\t\t\t<td><input type='texte' name='sugg_edi_0' id='sugg_edi_0' value='' disabled /></td>\n\t\t\t\t\t<td><input type='texte' name='sugg_code_0' id='sugg_code_0' value='' disabled /></td>\n\t\t\t\t\t<td><input type='texte' name='sugg_prix_0' id='sugg_prix_0' value='' disabled /></td>\n\t\t\t\t\t<td><input type='texte' name='sugg_url_0' id='sugg_url_0' value='' disabled /></td>\n\t\t\t\t\t<td><textarea name='sugg_com_0' id='sugg_com_0' disabled ></textarea></td>\n\t\t\t\t\t<td><textarea name='sugg_com_gestion_0' id='sugg_com_gestion_0' disabled ></textarea></td>\n\t\t\t\t\t<td><input type='texte' name='sugg_date_0' id='sugg_date_0' value='' disabled /></td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select id='sugg_src_0' name='sugg_src_0' disabled>\n\t\t\t\t\t\t\t{$option}\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t\t<td><input type='texte' name='sugg_qte_0' id='sugg_qte_0' value='1' disabled /></td>\n\t\t\t\t\t<td id='act_btn_0'><input type='button' class='bouton' name='add_line_0' id='add_line_0' value='+' onclick=\"add_line(0);\"/></td>\n\t\t\t\t</tr>"; } else { $multi_sug_form = str_replace("!!max_lignes!!", count($this->liste_sugg), $multi_sug_form); for ($i = 0; $i <= count($this->liste_sugg); $i++) { if ($this->liste_sugg[$i]) { $ligne .= "<tr id='sugg_{$i}'>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_tit_{$i}' id='sugg_tit_{$i}' value='" . htmlentities($this->liste_sugg[$i]['titre'], ENT_QUOTES, $charset) . "' /></td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_aut_{$i}' id='sugg_aut_{$i}' value='" . htmlentities($this->liste_sugg[$i]['auteur'], ENT_QUOTES, $charset) . "' /></td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_edi_{$i}' id='sugg_edi_{$i}' value='" . htmlentities($this->liste_sugg[$i]['editeur'], ENT_QUOTES, $charset) . "' /></td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_code_{$i}' id='sugg_code_{$i}' value='" . htmlentities($this->liste_sugg[$i]['code'], ENT_QUOTES, $charset) . "' /></td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_prix_{$i}' id='sugg_prix_{$i}' value='" . $this->liste_sugg[$i]['prix'] . "' /></td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_url_{$i}' id='sugg_url_{$i}' value='" . htmlentities($this->liste_sugg[$i]['url'], ENT_QUOTES, $charset) . "' /></td>\n\t\t\t\t\t\t<td><textarea name='sugg_com_{$i}' id='sugg_com_{$i}'></textarea></td>\n\t\t\t\t\t\t<td><textarea name='sugg_com_gestion_{$i}' id='sugg_com_gestion_{$i}'></textarea></td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_date_{$i}' id='sugg_date_{$i}' value='" . htmlentities($this->liste_sugg[$i]['date'], ENT_QUOTES, $charset) . "' /></td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<select id='sugg_src_{$i}' name='sugg_src_{$i}'>\n\t\t\t\t\t\t\t\t{$option}\n\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td><input type='texte' name='sugg_qte_{$i}' id='sugg_qte_{$i}' value='1' /></td>"; if ($i == count($this->liste_sugg)) { $ligne .= "<td id='act_btn_{$i}'><input type='button' class='bouton' name='add_line_{$i}' id='add_line_{$i}' value='+' onclick=\"add_line({$i});\"/></td>"; } else { $ligne .= "<td id='act_btn_{$i}'><input type='button' class='bouton' name='del_line_{$i}' id='del_line_{$i}' value='X' onclick=\"del_line({$i});\"/></td>"; } if ($this->liste_sugg[$i]['id_uni']) { $ligne .= "<input type='hidden' name='id_unimarc_{$i}' id='id_unimarc_{$i}' value='" . $this->liste_sugg[$i]['id_uni'] . "'/> "; } $ligne .= "</tr>"; } } } $multi_sug_form = str_replace('!!ligne!!', $ligne, $multi_sug_form); if (!$origine_id) { $multi_sug_form = str_replace('!!id_user!!', SESSuserid, $multi_sug_form); $multi_sug_form = str_replace('!!type_user!!', 0, $multi_sug_form); $multi_sug_form = str_replace('!!user_txt!!', $PMBusernom . ", " . $PMBuserprenom, $multi_sug_form); } else { $multi_sug_form = str_replace('!!id_user!!', $origine_id, $multi_sug_form); $multi_sug_form = str_replace('!!type_user!!', $type_origine, $multi_sug_form); if ($type_origine) { $req = "select concat(empr_prenom,' ',empr_nom) as nom from empr where id_empr='" . $origine_id . "'"; } else { $req = "select concat(prenom,' ',nom) as nom from users where userid='" . $origine_id . "'"; } $res = pmb_mysql_query($req, $dbh); $empr = pmb_mysql_fetch_object($res); $multi_sug_form = str_replace('!!user_txt!!', $empr->nom, $multi_sug_form); } //Selecteur Affecter a une categorie if ($acquisition_sugg_categ == '1') { $sel_categ = "<label class='etiquette' >" . htmlentities($msg['acquisition_sug_sel_categ'], ENT_QUOTES, $charset) . "</label> "; $tab_categ = suggestions_categ::getCategList(); $sel_categ .= "<select class='saisie-25em' id='num_categ' name='num_categ'>"; $sel_categ .= "<option value='-1'>" . htmlentities($msg['acquisition_sug_tous'], ENT_QUOTES, $charset) . "</option>"; foreach ($tab_categ as $id_categ => $lib_categ) { $sel_categ .= "<option value='" . $id_categ . "' > "; $sel_categ .= htmlentities($lib_categ, ENT_QUOTES, $charset) . "</option>"; } $sel_categ .= "</select>"; } else { $sel_categ = ""; } //Selecteur de localisation if ($acquisition_sugg_localises) { $list_locs .= "<label class='etiquette' >" . htmlentities($msg['acquisition_sug_sel_localisation'], ENT_QUOTES, $charset) . "</label> "; if ($sugg_location_id) { $temp_location = $sugg_location_id; } else { $temp_location = 0; } $locs = new docs_location(); $list_locs .= $locs->gen_combo_box_sugg($temp_location, 1); } else { $list_locs = ''; } $multi_sug_form = str_replace('!!categorie!!', $sel_categ, $multi_sug_form); $multi_sug_form = str_replace('!!localisation!!', $list_locs, $multi_sug_form); return $multi_sug_form; }
function show_form_sug($update_action) { global $dbh, $msg, $charset; global $id_bibli, $id_sug; global $sug_map; global $sug_modif_form; global $acquisition_poids_sugg, $lk_url_sug; global $acquisition_sugg_categ, $acquisition_sugg_categ_default; global $orig_form_mod; global $orig_champ_modif; global $id_notice; global $acquisition_sugg_localises; global $deflt_docs_location; global $sugg_location_id; global $javascript_path; $form = $sug_modif_form; //Récupération des pondérations de suggestions $tab_poids = explode(",", $acquisition_poids_sugg); $tab_poids[0] = substr($tab_poids[0], 2); //utilisateur $tab_poids[1] = substr($tab_poids[1], 2); //abonné $tab_poids[2] = substr($tab_poids[2], 2); //visiteur if (!$id_sug) { //Création de suggestion $titre = htmlentities($msg['acquisition_sug_cre'], ENT_QUOTES, $charset); //Récupération de l'utilisateur $requete_user = "******" . SESSlogin . "' limit 1 "; $res_user = pmb_mysql_query($requete_user, $dbh); $row_user = pmb_mysql_fetch_row($res_user); $orig = $row_user[0]; $lib_orig = $row_user[1]; if ($row_user[2]) { $lib_orig .= $row_user[2] . ", " . $row_user[1]; } $form = str_replace('!!lib_orig!!', $orig_form_mod, $form); $form = str_replace('!!dat_cre!!', formatdate(today()), $form); $form = str_replace('!!orig!!', $orig, $form); $form = str_replace('!!lib_orig!!', htmlentities($lib_orig, ENT_QUOTES, $charset), $form); $form = str_replace('!!typ!!', '0', $form); $form = str_replace('!!poi!!', $tab_poids[0], $form); $form = str_replace('!!poi_tot!!', $tab_poids[0], $form); $statut = $sug_map->getFirstStateId(); $form = str_replace('!!statut!!', $statut, $form); $form = str_replace('!!lib_statut!!', $sug_map->getHtmlComment($statut), $form); $form = str_replace('!!list_user!!', '', $form); $form = str_replace('!!creator_ajout!!', '', $form); $form = str_replace('!!lien!!', '', $form); if ($acquisition_sugg_categ != '1') { $sel_categ = ""; } else { if (suggestions_categ::exists($acquisition_sugg_categ_default)) { $sugg_categ = new suggestions_categ($acquisition_sugg_categ_default); } else { $sugg_categ = new suggestions_categ('1'); } $tab_categ = suggestions_categ::getCategList(); $sel_categ = "<select class='saisie-25em' id='num_categ' name='num_categ'>"; foreach ($tab_categ as $id_categ => $lib_categ) { $sel_categ .= "<option value='" . $id_categ . "' "; if ($id_categ == $sugg_categ->id_categ) { $sel_categ .= "selected='selected' "; } $sel_categ .= ">"; $sel_categ .= htmlentities($lib_categ, ENT_QUOTES, $charset) . "</option>"; } $sel_categ .= "</select>"; } $form = str_replace('!!nombre_expl!!', '1', $form); $list_locs = ''; if ($acquisition_sugg_localises) { $sugg_location_id = (string) $sugg_location_id == "" ? $deflt_docs_location : $sugg_location_id; if ($sugg_location_id) { $temp_location = $sugg_location_id; } else { $temp_location = 0; } $locs = new docs_location(); $list_locs = $locs->gen_combo_box_sugg($temp_location, 1, ""); } $form = str_replace('<!-- sel_location -->', $list_locs, $form); // si suggestion concernant une notice avec $id_notice en parametre, on pre-rempli les champs if ($id_notice) { $notice = new notice($id_notice); $tit = htmlentities($notice->tit1, ENT_QUOTES, $charset); $edi = htmlentities($notice->ed1, ENT_QUOTES, $charset); $prix = $notice->prix; $cod = $notice->code; $url_sug = $notice->lien; $as = array_search("0", $notice->responsabilites["responsabilites"]); if ($as !== FALSE && $as !== NULL) { $auteur_0 = $notice->responsabilites["auteurs"][$as]; $auteur = new auteur($auteur_0["id"]); } $aut = htmlentities($auteur->display, ENT_QUOTES, $charset); $form = str_replace('!!id_notice!!', $id_notice, $form); } else { $form = str_replace('!!id_notice!!', 0, $form); } $form = str_replace('!!categ!!', $sel_categ, $form); $form = str_replace('!!tit!!', $tit, $form); $form = str_replace('!!edi!!', $edi, $form); $form = str_replace('!!aut!!', $aut, $form); $form = str_replace('!!cod!!', $cod, $form); $form = str_replace('!!pri!!', $prix, $form); $form = str_replace('!!com!!', '', $form); $form = str_replace('!!com_gestion!!', '', $form); $form = str_replace('!!url_sug!!', $url_sug, $form); //Affichage du selecteur de source $req = "select * from suggestions_source order by libelle_source"; $res = pmb_mysql_query($req, $dbh); $option = "<option value='0' selected>" . htmlentities($msg['acquisition_sugg_no_src'], ENT_QUOTES, $charset) . "</option>"; while ($src = pmb_mysql_fetch_object($res)) { $option .= "<option value='" . $src->id_source . "' {$selected} >" . htmlentities($src->libelle_source, ENT_QUOTES, $charset) . "</option>"; $selected = ""; } $selecteur = "<select id='sug_src' name='sug_src'>" . $option . "</select>"; $form = str_replace('!!liste_source!!', $selecteur, $form); $form = str_replace('!!date_publi!!', '', $form); $pj = "<div class='row'>\n\t\t\t\t\t<input type='file' id='piece_jointe_sug' name='piece_jointe_sug' class='saisie-80em' size='60' />\n\t\t\t </div>"; $form = str_replace('!!div_pj!!', $pj, $form); } else { //Modification de suggestion $titre = htmlentities($msg['acquisition_sug_mod'], ENT_QUOTES, $charset); $sug = new suggestions($id_sug); $q = suggestions_origine::listOccurences($id_sug); $list_orig = pmb_mysql_query($q, $dbh); $orig = 0; $poids_tot = 0; $users = array(); while ($row_orig = pmb_mysql_fetch_object($list_orig)) { if (!$orig) { $orig = $row_orig->origine; $typ = $row_orig->type_origine; $poids = $tab_poids[$row_orig->type_origine]; } array_push($users, $row_orig); $poids_tot = $poids_tot + $tab_poids[$row_orig->type_origine]; } //On parcourt tous les créateurs de suggestions for ($i = 0; $i < sizeof($users); $i++) { $orig = $users[$i]->origine; $typ = $users[$i]->type_origine; //Récupération du nom du créateur de la suggestion switch ($typ) { default: case '0': $requete_user = "******" . $orig . "'"; $res_user = pmb_mysql_query($requete_user, $dbh); $row_user = pmb_mysql_fetch_row($res_user); $lib_orig = $row_user[1]; if ($row_user[2]) { $lib_orig .= ", " . $row_user[2]; } if (empty($premier_user) || !isset($premier_user)) { $premier_user = $lib_orig; } else { $list_user .= $lib_orig . "<br />"; } break; case '1': $requete_empr = "SELECT id_empr, empr_nom, empr_prenom FROM empr where id_empr = '" . $orig . "'"; $res_empr = pmb_mysql_query($requete_empr, $dbh); $row_empr = pmb_mysql_fetch_row($res_empr); $lib_orig = $row_empr[1]; if ($row_empr[2]) { $lib_orig .= ", " . $row_empr[2]; } if (empty($premier_user) || !isset($premier_user)) { $premier_user = $lib_orig; } else { $list_user .= $lib_orig . "<br />"; } break; case '2': if ($orig) { $lib_orig = $orig; } else { $lib_orig = $msg['suggest_anonyme']; } if (empty($premier_user) || !isset($premier_user)) { $premier_user = $lib_orig; } else { $list_user .= $lib_orig . "<br />"; } break; } } //Récupération du statut de la suggestion $lib_statut = $sug_map->getHtmlComment($sug->statut); $form = str_replace('!!dat_cre!!', formatdate($sug->date_creation), $form); $form = str_replace('!!orig!!', $orig, $form); //Ajout du champ de saisie du nouveau créateur $ajout_create = "<input id='creator_orig_id' type='hidden' name='creator_orig_id'>\n\t\t<input type='text' id='creator_lib_orig' name='creator_lib_orig' class='saisie-10emr'/>\n\t\t<input type='button' class='bouton_small' value='...' onclick=\"openPopUp('./select.php?what=origine&caller=sug_modif_form¶m1=creator_orig_id¶m2=creator_lib_orig¶m3=typ¶m4=¶m5=¶m6=&deb_rech=', 'select_creator_orig', 400, 400, -2, -2, 'scrollbars=yes, toolbar=no, dependent=yes, resizable=yes')\" />"; if (sizeof($users) > 1) { //on ajoute le champ à la liste $list_user .= $ajout_create; $form = str_replace('!!creator_ajout!!', '', $form); } else { $form = str_replace('!!creator_ajout!!', "<br />" . $ajout_create, $form); } //Menu dépliant $deroul_user = gen_plus('ori', $msg['suggest_creator'] . " (" . (sizeof($users) - 1) . ")", $list_user, 0); if ($lib_orig) { $form = str_replace('!!lib_orig!!', htmlentities($premier_user, ENT_QUOTES, $charset), $form); if (sizeof($users) > 1) { $form = str_replace('!!list_user!!', $deroul_user, $form); } else { $form = str_replace('!!list_user!!', '', $form); } } else { $form = str_replace('!!lib_orig!!', ' ', $form); $form = str_replace('!!list_user!!', '', $form); } $form = str_replace('!!typ!!', $typ, $form); $form = str_replace('!!poi!!', $poids, $form); $form = str_replace('!!poi_tot!!', $poids_tot, $form); $form = str_replace('!!statut!!', $sug->statut, $form); $form = str_replace('!!lib_statut!!', $lib_statut, $form); if ($acquisition_sugg_categ != '1') { $sel_categ = ""; } else { $state_name = $sug_map->getStateNameFromId($sug->statut); $categ = $sug_map->getState_CATEG($state_name); $sugg_categ = new suggestions_categ($sug->num_categ); if ($categ == 'YES') { $tab_categ = suggestions_categ::getCategList(); $sel_categ = "<select class='saisie-25em' id='num_categ' name='num_categ'>"; foreach ($tab_categ as $id_categ => $lib_categ) { $sel_categ .= "<option value='" . $id_categ . "' "; if ($id_categ == $sug->num_categ) { $sel_categ .= "selected='selected' "; } $sel_categ .= ">"; $sel_categ .= htmlentities($lib_categ, ENT_QUOTES, $charset) . "</option>"; } $sel_categ .= "</select>"; } else { $sel_categ = htmlentities($sugg_categ->libelle_categ, ENT_QUOTES, $charset); } } //Nombre d'exemplaire $form = str_replace('!!nombre_expl!!', $sug->nb, $form); //Selecteur de localisation $list_locs = ''; if ($acquisition_sugg_localises) { $sugg_location_id = $sug->sugg_location; if ($sugg_location_id) { $temp_location = $sugg_location_id; } else { $temp_location = 0; } $locs = new docs_location(); $list_locs = $locs->gen_combo_box_sugg($temp_location, 1, ""); } $form = str_replace('<!-- sel_location -->', $list_locs, $form); if ($sug->num_notice && $sug->num_notice != 0) { $req_ana = "select analysis_bulletin as bull , analysis_notice as noti from analysis where analysis_notice ='" . $sug->num_notice . "'"; $res_ana = pmb_mysql_query($req_ana, $dbh); $num_rows_ana = pmb_mysql_num_rows($res_ana); if ($num_rows_ana) { $ana = pmb_mysql_fetch_object($res_ana); $url_view = "catalog.php?categ=serials&sub=bulletinage&action=view&bul_id={$ana->bull}&art_to_show=" . $ana->noti; } else { $url_view = "./catalog.php?categ=isbd&id=" . $sug->num_notice; } $lien = "<a href='{$url_view}'> " . $msg['acquisition_sug_view_not'] . "</a>"; $form = str_replace('!!lien!!', $lien, $form); } else { $form = str_replace('!!lien!!', '', $form); } $form = str_replace('!!categ!!', $sel_categ, $form); $form = str_replace('!!tit!!', htmlentities($sug->titre, ENT_QUOTES, $charset), $form); $form = str_replace('!!edi!!', htmlentities($sug->editeur, ENT_QUOTES, $charset), $form); $form = str_replace('!!aut!!', htmlentities($sug->auteur, ENT_QUOTES, $charset), $form); $form = str_replace('!!cod!!', htmlentities($sug->code, ENT_QUOTES, $charset), $form); $form = str_replace('!!pri!!', round($sug->prix, 2), $form); $form = str_replace('!!com!!', htmlentities($sug->commentaires, ENT_QUOTES, $charset), $form); $form = str_replace('!!com_gestion!!', htmlentities($sug->commentaires_gestion, ENT_QUOTES, $charset), $form); $req = "select * from suggestions_source order by libelle_source"; $res = pmb_mysql_query($req, $dbh); $selected = ""; $option = "<option value='0' selected>" . htmlentities($msg['acquisition_sugg_no_src'], ENT_QUOTES, $charset) . "</option>"; while ($src = pmb_mysql_fetch_object($res)) { $src->id_source == $sug->sugg_src ? $selected = " selected " : ($selected = ""); $option .= "<option value='" . $src->id_source . "' {$selected}>" . htmlentities($src->libelle_source, ENT_QUOTES, $charset) . "</option>"; } $selecteur = "<select id='sug_src' name='sug_src'>" . $option . "</select>"; $form = str_replace('!!liste_source!!', $selecteur, $form); $form = str_replace("!!date_publi!!", htmlentities($sug->date_publi, ENT_QUOTES, $charset), $form); if (!$sug->get_explnum('id')) { $pj = "<div class='row'>\n\t\t\t\t\t<input type='file' id='piece_jointe_sug' name='piece_jointe_sug' class='saisie-80em' size='60' />\n\t\t\t </div>"; } else { $pj = "\n\t\t\t<input type='hidden' name='id_pj' id='id_pj' value='" . $sug->get_explnum('id') . "' />\n\t\t\t<div class='row'>" . $sug->get_explnum('nom') . " <input type='submit' class='bouton' name='del_pj' id='del_pj' value='X' onclick='this.form.action=\"./acquisition.php?categ=sug&action=del_pj&id_bibli=" . $id_bibli . "&id_sug=" . $id_sug . "\"' /> \n\t\t\t</div>"; } $form = str_replace('!!div_pj!!', $pj, $form); if ($sug->url_suggestion) { $form = str_replace('<!-- url_sug -->', $lk_url_sug, $form); } $form = str_replace('!!url_sug!!', htmlentities($sug->url_suggestion, ENT_QUOTES, $charset), $form); $form = str_replace('!!id_notice!!', $sug->num_notice, $form); // Affichage du bouton supprimer $bt_sup = $sug_map->getButton_DELETED($sug->statut, $id_bibli, $id_sug); $form = str_replace('<!-- bouton_sup -->', $bt_sup, $form); if ($sug->num_notice) { //Eventuellement, lien vers la notice } else { // Affichage du bouton cataloguer $bt_cat = $sug_map->getButton_CATALOG($sug->statut, $id_bibli, $id_sug); $button = "<input type='radio' name='catal_type' id='not_type' value='0' checked /><label class='etiquette' for='not_type'>" . htmlentities($msg['acquisition_type_mono'], ENT_QUOTES, $charset) . "</label>\n\t\t\t<input type='radio' name='catal_type' value='1' id='art_type'/><label for='art_type' class='etiquette'>" . htmlentities($msg['acquisition_type_art'], ENT_QUOTES, $charset) . "</label>"; if ($sug->sugg_noti_unimarc) { $bt_cat = str_replace('!!type_catal!!', " <label style='color:red'>Notice externe existante</label>", $bt_cat); } else { $bt_cat = str_replace('!!type_catal!!', $button, $bt_cat); } $form = str_replace('<!-- bouton_cat -->', $bt_cat, $form); } } //$action ="./acquisition.php?categ=sug&action=update&id_bibli=".$id_bibli."&id_sug=".$id_sug; $form = str_replace('!!action!!', $update_action, $form); $form = str_replace('!!form_title!!', $titre, $form); print "<script type=\"text/javascript\" src=\"" . $javascript_path . "/tablist.js\"></script>"; print $form; }
} echo "{$bt_add_panier}\n\t\t\t\t</div>\n\t\t\t\t<div align='right'>\n\t\t\t\t\t" . $msg["empr_chang_statut"] . " \n\t\t\t\t\t" . gen_liste("select idstatut, statut_libelle from empr_statut", "idstatut", "statut_libelle", "empr_chang_statut_edit", "", "", 0, "", 0, "") . " \n\t\t\t\t\t <input type='submit' class='bouton_small' value='" . $msg['empr_chang_statut_button'] . "' />\n\t\t\t\t</div>\n\t\t\t\t</form>"; break; } //switch($dest) } else { // la requête n'a produit aucun résultat switch ($dest) { case "TABLEAU": break; case "TABLEAUHTML": break; default: echo "\n\t\t\t\t<form class='form-{$current_module}' id='form-{$current_module}-list' name='form-{$current_module}-list' action='{$page_url}?categ={$categ}&sub={$sub}&limite_page={$limite_page}&numero_page={$numero_page}' method=post>\n\t\t\t \t<div class='left'>\n\t\t\t\t\t{$nav_bar} {$msg['circ_afficher']} <input type=text name=limite_page value='{$limite_page}' class='saisie-5em'> {$msg['1905']} \n\t\t\t\t</div>\n\t\t\t\t<div class='right'>\n\t\t\t\t\t<img src='./images/tableur.gif' border='0' align='top' onMouseOver ='survol(this);' onclick=\"start_export('TABLEAU');\" alt='Export tableau EXCEL' title='Export tableau EXCEL'/> \n\t\t\t\t\t<img src='./images/tableur_html.gif' border='0' align='top' onMouseOver ='survol(this);' onclick=\"start_export('TABLEAUHTML');\" alt='Export tableau HTML' title='Export tableau HTML'/> \n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tfunction survol(obj){\n\t\t\t\t\t\tobj.style.cursor = 'pointer';\n\t\t\t\t\t}\n\t\t\t\t\tfunction start_export(type){\n\t\t\t\t\t\tdocument.forms['form-{$current_module}-list'].dest.value = type;\n\t\t\t\t\t\tdocument.forms['form-{$current_module}-list'].submit();\n\t\t\t\t\t}\t\n\t\t\t\t</script>\n\t\t\t"; if ($pmb_lecteurs_localises) { echo docs_location::gen_combo_box_empr($empr_location_id); } echo gen_liste("select idstatut, statut_libelle from empr_statut", "idstatut", "statut_libelle", "empr_statut_edit", "", $empr_statut_edit, -1, "", 0, $msg["all_statuts_empr"]); $sort_params = array('empr_nom' => $msg['readerlist_name'], 'empr_cb' => $msg['readerlist_code'], 'empr_ville' => $msg['readerlist_ville'], 'empr_date_expiration' => $msg['readerlist_dateexpiration']); echo " " . $msg["sort_by"] . ": "; echo '<select name="sortby">'; foreach ($sort_params as $id => $caption) { echo '<option ' . ($id == $sortby ? 'selected' : '') . ' value="' . $id . '">' . $caption . '</option>'; } echo '</select>'; echo " <input type='submit' class='bouton' value='" . $msg['actualiser'] . "' onClick=\"this.form.dest.value='';\" /> <input type='hidden' name='dest' value='' />"; echo "\n\t\t\t\t<div class='row'></div></form><br />"; echo "\n\t\t\t<div class='row'></div></form>"; error_message($msg[46], str_replace('!!form_cb!!', $form_cb, $msg['edit_lect_aucun_trouve']), 1, './edit.php?categ=empr&sub=' . $sub); } }
function traite_exemplaires() { global $msg, $dbh; global $prix, $notice_id, $info_995, $typdoc_995, $tdoc_codage, $book_lender_id, $section_995, $sdoc_codage, $book_statut_id, $locdoc_codage, $codstatdoc_995, $statisdoc_codage, $cote_mandatory; global $bulletin_ex; // lu en 010$d de la notice $price = $prix[0]; // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ $expl['cb'] = $info_995[$nb_expl]['f']; $unique = false; $cb = $expl['cb']; $cb1 = $cb; $n_cb = 2; while (!$unique) { $requete = "select 1 from exemplaires where expl_cb='" . addslashes($cb1) . "'"; $resultat = mysql_query($requete); if (mysql_num_rows($resultat)) { $cb1 = $cb . " " . $n_cb; $n_cb++; } else { $unique = true; } } $expl['cb'] = $cb1; if ($bulletin_ex) { $expl['bulletin'] = $bulletin_ex; $expl['notice'] = 0; } else { $expl['notice'] = $notice_id; $expl['bulletin'] = 0; } // $expl['typdoc'] = $info_995[$nb_expl]['r']; à chercher dans docs_typdoc $data_doc = array(); //$data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']." -Type doc importé (".$book_lender_id.")"; //$data_doc['tdoc_libelle'] = $typdoc_995[$info_995[$nb_expl]['r']]; //if (!$data_doc['tdoc_libelle']) $data_doc['tdoc_libelle'] = "\$r non conforme -".$info_995[$nb_expl]['r']."-" ; $data_doc['duree_pret'] = 0; /* valeur par défaut */ $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['r']; $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']; if ($tdoc_codage) { $data_doc['tdoc_owner'] = $book_lender_id; } else { $data_doc['tdoc_owner'] = 0; } $expl['typdoc'] = docs_type::import($data_doc); $expl['cote'] = $info_995[$nb_expl]['k']; if (!trim($expl['cote'])) { $expl['cote'] = "SC"; } // $expl['section'] = $info_995[$nb_expl]['q']; à chercher dans docs_section $data_doc = array(); if (!$info_995[$nb_expl]['t']) { $info_995[$nb_expl]['t'] = "inconnu"; } $data_doc['section_libelle'] = $info_995[$nb_expl]['t']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['t']; if ($sdoc_codage) { $data_doc['sdoc_owner'] = $book_lender_id; } else { $data_doc['sdoc_owner'] = 0; } $expl['section'] = docs_section::import($data_doc); $expl['statut'] = $book_statut_id; // $expl['location'] = $info_995[$nb_expl]['']; à fixer par combo_box // figé dans le code ici pour l'instant : //$info_995[$nb_expl]['localisation']="Bib princip"; /* biblio principale */ $data_doc = array(); $data_doc['location_libelle'] = "inconnu"; if ($info_995[$nb_expl]['a']) { $data_doc['location_libelle'] = $info_995[$nb_expl]['a']; $data_doc['locdoc_codage_import'] = $info_995[$nb_expl]['a']; } else { $data_doc['locdoc_codage_import'] = "Centre de documentation"; } if ($locdoc_codage) { $data_doc['locdoc_owner'] = $book_lender_id; } else { $data_doc['locdoc_owner'] = 0; } $expl['location'] = docs_location::import($data_doc); // $expl['codestat'] = $info_995[$nb_expl]['q']; 'q' utilisé, éventuellement à fixer par combo_box $data_doc = array(); //$data_doc['codestat_libelle'] = $info_995[$nb_expl]['q']." -Pub visé importé (".$book_lender_id.")"; if (!$info_995[$nb_expl]['q']) { $info_995[$nb_expl]['q'] = "inconnu"; } $data_doc['codestat_libelle'] = $info_995[$nb_expl]['q']; $data_doc['statisdoc_codage_import'] = $info_995[$nb_expl]['q']; if ($statisdoc_codage) { $data_doc['statisdoc_owner'] = $book_lender_id; } else { $data_doc['statisdoc_owner'] = 0; } $expl['codestat'] = docs_codestat::import($data_doc); // $expl['creation'] = $info_995[$nb_expl]['']; à préciser // $expl['modif'] = $info_995[$nb_expl]['']; à préciser $expl['note'] = $info_995[$nb_expl]['u']; $expl['prix'] = $price; $expl['expl_owner'] = $book_lender_id; $expl['cote_mandatory'] = $cote_mandatory; $expl['date_depot'] = substr($info_995[$nb_expl]['m'], 0, 4) . "-" . substr($info_995[$nb_expl]['m'], 4, 2) . "-" . substr($info_995[$nb_expl]['m'], 6, 2); $expl['date_retour'] = substr($info_995[$nb_expl]['n'], 0, 4) . "-" . substr($info_995[$nb_expl]['n'], 4, 2) . "-" . substr($info_995[$nb_expl]['n'], 6, 2); $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } } // fin for }
} else { $loc = $book_location_id; } switch ($sub) { case "edition": $params['link_on_day'] = ""; $admin_layout = str_replace('!!menu_sous_rub!!', $msg["calendrier_edition"], $admin_layout); print $admin_layout; echo pmb_bidi(calendar_gestion($date, 0, "", "", 1, $loc)); break; case "consulter": default: $params['link_on_day'] = $base_url; $admin_layout = str_replace('!!menu_sous_rub!!', $msg["calendrier_consulter"], $admin_layout); print $admin_layout; print "<form method='post' action='{$page}?categ={$categ}&loc={$loc}' class='form-{$current_module}'>\n\t\t\t<div class='form-" . $current_module . "'>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<label class='etiquette'>{$msg['empr_location']} :</label>\n\t\t\t\t\t \n\t\t\t\t\t" . docs_location::gen_combo_box($loc) . "\n\t\t\t\t\t \n\t\t\t\t\t<input class='bouton' type='submit' value='" . $msg['actualiser'] . "' />\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</form>"; $result = mysql_query("select location_libelle,name from docs_location where idlocation={$loc}", $dbh); if (mysql_num_rows($result) == 1) { $admin_calendrier_form = str_replace('!!biblio_name!!', mysql_result($result, 0, "name"), $admin_calendrier_form); $admin_calendrier_form = str_replace('!!localisation!!', $msg[empr_location] . ' : ' . mysql_result($result, 0, "location_libelle"), $admin_calendrier_form); $admin_calendrier_form = str_replace('!!book_location_id!!', $loc, $admin_calendrier_form); } else { $admin_calendrier_form = str_replace('!!biblio_name!!', '', $admin_calendrier_form); $admin_calendrier_form = str_replace('!!localisation!!', ' ', $admin_calendrier_form); $admin_calendrier_form = str_replace('!!book_location_id!!', '', $admin_calendrier_form); } $result = mysql_query("select idlocation, location_libelle from docs_location where idlocation not in({$loc})", $dbh); while ($row = mysql_fetch_object($result)) { $duplicate_form .= "<input id='dup_" . $row->idlocation . "'type='checkbox' name='duplicate_locs[]' value='" . $row->idlocation . "' /><label class='etiquette' for='dup_" . $row->idlocation . "'>" . $row->location_libelle . "</label>"; } $admin_calendrier_form = str_replace("!!duplicate_location!!", $duplicate_form, $admin_calendrier_form);
function traite_exemplaires() { global $msg, $dbh; global $nb_expl_ignores; global $prix, $notice_id, $info_996, $info_995; // Afin de ne pas remettre en cause le script programmé en 995 : $info_995 = $info_996; // lu en 010$d de la notice $price = $prix[0]; // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ $expl['notice'] = $notice_id; $expl['cb'] = $info_995[$nb_expl]['f']; $expl['cote'] = $info_995[$nb_expl]['k']; $expl['note'] = $info_995[$nb_expl]['u']; $expl['prix'] = $price; $expl['cote_mandatory'] = 0; $expl['date_depot'] = substr($info_995[$nb_expl]['m'], 0, 4) . "-" . substr($info_995[$nb_expl]['m'], 4, 2) . "-" . substr($info_995[$nb_expl]['m'], 6, 2); $expl['date_retour'] = substr($info_995[$nb_expl]['n'], 0, 4) . "-" . substr($info_995[$nb_expl]['n'], 4, 2) . "-" . substr($info_995[$nb_expl]['n'], 6, 2); // propriétaire $owner = array(); $owner['lender_libelle'] = $info_995[$nb_expl]['a']; if (!$owner['lender_libelle']) { $owner['lender_libelle'] = $info_995[$nb_expl]['b']; } $expl['expl_owner'] = lender::import($owner); $book_lender_id = $expl['expl_owner']; // docs_location $data_doc = array(); $data_doc['location_libelle'] = $info_995[$nb_expl]['v']; $data_doc['locdoc_codage_import'] = $info_995[$nb_expl]['w']; if (!$data_doc['locdoc_codage_import']) { $data_doc['locdoc_codage_import'] = $data_doc['location_libelle']; } //$data_doc['locdoc_owner'] = $book_lender_id ; $data_doc['locdoc_owner'] = 0; $expl['location'] = docs_location::import($data_doc); // docs_section $data_doc = array(); $data_doc['section_libelle'] = $info_995[$nb_expl]['x']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['y']; if (!$data_doc['sdoc_codage_import']) { $data_doc['sdoc_codage_import'] = $data_doc['section_libelle']; } //$data_doc['sdoc_owner'] = $book_lender_id ; $data_doc['sdoc_owner'] = 0; $expl['section'] = docs_section::import($data_doc); // typedoc $data_doc = array(); $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['e']; $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['r']; if (!$data_doc['tdoc_codage_import']) { $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['e']; } $data_doc['duree_pret'] = 28; /* valeur par défaut */ $data_doc['tdoc_owner'] = $book_lender_id; $expl['typdoc'] = docs_type::import($data_doc); // statut doc $data_doc = array(); $data_doc['statut_libelle'] = $info_995[$nb_expl]['1']; $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['2']; if (!$data_doc['statusdoc_codage_import']) { $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['1']; } $data_doc['pret_flag'] = $info_995[$nb_expl]['3']; $data_doc['statusdoc_owner'] = $book_lender_id; $expl['statut'] = docs_statut::import($data_doc); // codestat $expl['codestat'] = 1; // quoi_faire // $que_faire vient du formulaire de chargement, à utiliser en attente de l'info dans la zone 996 global $que_faire; if ($que_faire == "") { if ($info_995[$nb_expl]['0']) { $expl['quoi_faire'] = $info_995[$nb_expl]['0']; } else { $expl['quoi_faire'] = 2; } } else { $expl['quoi_faire'] = $que_faire; } // 0 : supprimer, 1 ou vide : Mettre à jour ou ajouter, 2 : ajouter si possible, sinon rien. $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } //debug : affichage zone 995 /* echo "995\$a =".$info_995[$nb_expl]['a']."<br />"; echo "995\$b =".$info_995[$nb_expl]['b']."<br />"; echo "995\$c =".$info_995[$nb_expl]['c']."<br />"; echo "995\$d =".$info_995[$nb_expl]['d']."<br />"; echo "995\$f =".$info_995[$nb_expl]['f']."<br />"; echo "995\$k =".$info_995[$nb_expl]['k']."<br />"; echo "995\$m =".$info_995[$nb_expl]['m']."<br />"; echo "995\$n =".$info_995[$nb_expl]['n']."<br />"; echo "995\$o =".$info_995[$nb_expl]['o']."<br />"; echo "995\$q =".$info_995[$nb_expl]['q']."<br />"; echo "995\$r =".$info_995[$nb_expl]['r']."<br />"; echo "995\$u =".$info_995[$nb_expl]['u']."<br /><br />"; */ } // fin for }
function maj_lect_par_lect($tab, $dbh, $statut, $id_lect) { global $lect_modif, $lect_erreur; /*Les informations qui sont mise à jour sont : * l'adresse, le code postal, la ville, le pays, le telephone, emailPerso, la locatisation et le groupe */ $requete = "update empr set "; $requete .= "empr_cp='" . addslashes($tab[5]) . "'"; $requete .= ", empr_ville='" . addslashes(ucfirst(mb_strtolower($tab[6]))) . "'"; $requete .= ", empr_adr1='" . addslashes($tab[4]) . "'"; $requete .= ", empr_pays='" . addslashes($tab[7]) . "'"; $requete .= ", empr_tel1='" . addslashes($tab[8]) . "'"; $requete .= ", empr_tel2='" . addslashes($tab[9]) . "'"; $requete .= ", empr_mail='" . addslashes($tab[10]) . "'"; if (count($tab) == 18) { //Si on a 18 champs c'est un etudiant $requete .= ", empr_login='******'"; } else { //Sinon c'est un prof $requete .= ", empr_login='******'"; } if ($tab[14]) { $data2 = array(); $data2['location_libelle'] = $tab[14]; $data2['locdoc_codage_import'] = $tab[14]; $data2['locdoc_owner'] = 0; $localisation = docs_location::import($data2); $requete .= ", empr_location='" . $localisation . "'"; } if ($statut) { //On repasse le statut de tous les lecteurs à "Indétermiè" et on remet les dates $requete .= ", empr_date_adhesion='" . addslashes(date('Y-m-j')) . "'"; $requete .= ", empr_modif='" . addslashes(date('Y-m-j')) . "'"; if ($result = mysql_query("SELECT DATE_ADD('" . addslashes(date('Y-m-j')) . "', INTERVAL 1 YEAR)")) { if ($row = mysql_fetch_row($result)) { $requete .= ", empr_date_expiration='" . addslashes($row[0]) . "'"; } } $q = "select idstatut from empr_statut where statut_libelle='Importé' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $requete .= ", empr_statut='" . mysql_result($r, 0, 0) . "'"; } else { $q = "insert into empr_statut (statut_libelle) values ('Importé') "; $r = mysql_query($q, $dbh); $requete .= ", empr_statut='" . mysql_insert_id($dbh) . "'"; } } else { $requete .= ", empr_modif='" . addslashes(date('Y-m-j')) . "'"; } $requete .= " where id_empr='" . $id_lect . "'"; if (mysql_query($requete)) { $lect_modif++; } else { $lect_erreur++; echo "Requete echoué : " . $requete . "<br>"; } //Traitement des groupes $requete = "delete from empr_groupe where empr_id='" . $id_lect . "'"; if (!mysql_query($requete)) { echo "Requete echoué : " . $requete . "<br>"; } if (trim($tab[15])) { //On créer le groupe si il n'existe pas et on y affecte le lecteur $requete = "select id_groupe from groupe where libelle_groupe='" . addslashes(trim($tab[15])) . "'"; $r = mysql_query($requete, $dbh); if (mysql_num_rows($r)) { $id_grp = mysql_result($r, 0, 0); } else { $q = "insert into groupe (libelle_groupe) values ('" . addslashes(trim($tab[15])) . "') "; $r = mysql_query($q, $dbh); $id_grp = mysql_insert_id($dbh); } $requete = "insert into empr_groupe(empr_id,groupe_id) values ('" . $id_lect . "','" . $id_grp . "')"; if (!mysql_query($requete)) { echo "Requete echoué : " . $requete . "<br>"; } } if (trim($tab[16]) and trim($tab[16]) != trim($tab[15])) { //On créer le groupe si il n'existe pas et on y affecte le lecteur $requete = "select id_groupe from groupe where libelle_groupe='" . addslashes(trim($tab[16])) . "'"; $r = mysql_query($requete, $dbh); if (mysql_num_rows($r)) { $id_grp = mysql_result($r, 0, 0); } else { $q = "insert into groupe (libelle_groupe) values ('" . addslashes(trim($tab[16])) . "') "; $r = mysql_query($q, $dbh); $id_grp = mysql_insert_id($dbh); } $requete = "insert into empr_groupe(empr_id,groupe_id) values ('" . $id_lect . "','" . $id_grp . "')"; if (!mysql_query($requete)) { echo "Requete echoué : " . $requete . "<br>"; } } if ($tab[13] and count($tab) == 18) { //Traitement du champs perso email $q = "select idchamp from empr_custom where name='email_perso' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $idchamp = mysql_result($r, 0, 0); //On supprime l'ancien $requete = "delete from empr_custom_values where empr_custom_origine='" . $id_lect . "' and empr_custom_champ='" . $idchamp . "'"; if (!mysql_query($requete)) { echo "Requete echoué : " . $requete . "<br>"; } //On créer le nouveau $q = "insert into empr_custom_values (empr_custom_champ, empr_custom_origine, empr_custom_small_text) "; $q .= "values('" . $idchamp . "', '" . $id_lect . "','" . addslashes($tab[13]) . "' ) "; mysql_query($q, $dbh); } } }
function fill_form(&$form, $action, $suppr = '') { global $charset; global $msg, $lang; global $pmb_scan_pmbws_client_url, $pmb_scan_pmbws_url; global $pmb_indexation_docnum, $dbh, $pmb_explnum_statut; global $b_mimetype; global $pmb_docnum_in_directory_allow, $pmb_docnum_in_database_allow; global $explnum_id; global $pmb_diarization_docnum; global $base_path; $form = str_replace('!!action!!', $action, $form); $form = str_replace('!!explnum_id!!', $this->explnum_id, $form); $form = str_replace('!!bulletin!!', $this->explnum_bulletin, $form); $form = str_replace('!!notice!!', $this->explnum_notice, $form); $form = str_replace('!!nom!!', htmlentities($this->explnum_nom, ENT_QUOTES, $charset), $form); $form = str_replace('!!url!!', htmlentities($this->explnum_url, ENT_QUOTES, $charset), $form); //Gestion de l'interface d'indexation if ($pmb_indexation_docnum) { $checkbox = "<div class='row'>\n\t\t\t\t \t\t<input type='checkbox' id='ck_index' value='1' name='ck_index' {$this->explnum_index} /><label for='ck_index'>{$msg['docnum_a_indexer']}</label>\t\n\t\t\t\t \t</div>\n\t\t\t\t "; if ($this->explnum_index_sew != '' && $this->explnum_index_wew != '') { $fct = "\n\t\t\t\t \t<script> function suppr_index(form){\n\t\t\t\t \t\t if(!form.ck_index.checked) {\n\t\t\t\t \t\t \tconf = confirm(\"" . $msg['docnum_suppr_index'] . "\");\n\t\t\t\t \t\t\treturn conf;\n\t\t\t\t \t\t } \n\t\t\t\t \t\t return true;\n\t\t\t\t \t}</script>\n\t\t\t\t \t"; $form = str_replace("!!submit_action!!", 'return suppr_index(this)', $form); } else { $fct = ""; $form = str_replace("!!submit_action!!", "return testing_file(" . $this->explnum_id . ");", $form); } $form = str_replace('!!ck_indexation!!', $checkbox . $fct, $form); } else { $form = str_replace("!!ck_indexation!!", "", $form); $form = str_replace("!!submit_action!!", "return testing_file(" . $this->explnum_id . ");", $form); } //Gestion de l'interface de segmentation if ($pmb_diarization_docnum) { $checkbox = "<div class='row'>\n\t\t\t\t \t\t<input type='checkbox' id='ck_diarization' value='1' name='ck_diarization' /><label for='ck_diarization'>" . $msg['diarize_explnum'] . "</label>\t\n\t\t\t\t \t</div>\n\t\t\t\t "; $form = str_replace('!!ck_diarization!!', $checkbox, $form); } else { $form = str_replace("!!ck_diarization!!", "", $form); } //Gestion du scanner if ($pmb_scan_pmbws_client_url && $pmb_scan_pmbws_url) { $scan_addon = "\n\t\t\t\t<script>function afterscan(format) {\n\t\t\t\t\tif (document.explnum.f_fichier) {\n\t\t\t\t\t\tsitxt=document.createElement('span');\n\t\t\t\t\t\tsitxt.setAttribute('id','scanned_image_txt');\n\t\t\t\t\t\tsitxt.className='erreur';\n\t\t\t\t\t\tdocument.explnum.f_fichier.parentNode.replaceChild(sitxt,document.explnum.f_fichier);\n\t\t\t\t\t}\n\t\t\t\t\tdocument.getElementById('scanned_image_txt').innerHTML='" . $msg["scan_image_recorded"] . "';\n\t\t\t\t\tdocument.getElementById('scanned_image_ext').value=format;\n\t\t\t\t}</script>\n\t\t\t\t<input type='button' value='" . $msg["scan_button"] . "' onClick='openPopUp(\"" . $pmb_scan_pmbws_client_url . "?scanfield=scanned_image&urlbase=" . rawurlencode($pmb_scan_pmbws_url) . "&scanform=explnum&callbackimage=afterscan&lang={$lang}&charset={$charset}\",\"scanWindow\",900,700,0,0,\"scrollbars=yes, resizable=yes\")' class='bouton'/>\n\t\t\t\t<input type='hidden' name='scanned_image_ext' id='scanned_image_ext' value=''/>\n\t\t\t\t<input type='hidden' name='scanned_image' value=''/>\n\t\t\t\t<input type='hidden' id='scanned_texte' name='scanned_texte' value=''/>"; $form = str_replace('<!-- !!scan_button!! -->', $scan_addon, $form); } // Ajout du bouton d'association s'il y a des segments en base $associer = ""; $fct = ""; if ($this->explnum_id) { $nb = 0; $query = "select count(*) as nb from explnum_segments where explnum_segment_explnum_num = " . $this->explnum_id; $result = mysql_query($query); if ($result && mysql_num_rows($result)) { $nb = mysql_fetch_object($result)->nb; } if ($nb > 0) { $associer = "<input type='button' class='bouton' value=\"" . $msg['associate_speakers'] . "\" name='associate_speakers' id='associate_speakers' onClick=\"document.location = '" . $base_path . "/catalog.php?categ=explnum_associate&explnum_id=" . $this->explnum_id . "';\" />"; if ($pmb_diarization_docnum) { // On ajoute une confirmation pour une deuxième segmentation => perte des associations $fct = "<script type='text/javascript'>\r\n\t\t\t\t\t\t\tfunction conf_diarize_again() {\r\n\t\t\t\t\t\t\t\tif (document.getElementById('ck_diarization').checked) {\r\n\t\t\t\t\t\t\t\t\tconf = confirm('" . addslashes($msg['explnum_associate_conf_diarize_again']) . "');\r\n\t\t\t\t\t\t\t\t\tif (!conf) {\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById('ck_diarization').checked = false;\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdocument.getElementById('ck_diarization').addEventListener('change', conf_diarize_again, false);\r\n\t\t\t\t\t\t</script>"; } } } $form = str_replace("!!associate_speakers!!", $associer, $form); $form = str_replace("!!fct_conf_diarize_again!!", $fct, $form); // Ajout du bouton supprimer si modification if ($this->explnum_id && $suppr) { $supprimer = "\n\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t function confirm_delete() {\n\t\t \t\t\tresult = confirm(\"{$msg[314]} ?\");\n\t\t \t\t\tif(result)\n\t\t \t\t\tdocument.location = \"{$suppr}\";\n\t\t \t\t\t}\n\t\t\t\t\t</script>\n\t\t\t\t\t<input type='button' class='bouton' value=\"{$msg['63']}\" name='del_ex' id='del_ex' onClick=\"confirm_delete();\" />\n\t\t\t\t\t"; } $form = str_replace('!!supprimer!!', $supprimer, $form); //Gestion du statut de notice if ($pmb_explnum_statut == '1') { $explnum_statut_form = " <input type='checkbox' id='f_statut_chk' name='f_statut_chk' value='1' "; if ($this->explnum_statut == '1') { $explnum_statut_form .= "checked='checked' "; } $explnum_statut_form .= "/> <label class='etiquette' for='f_statut_chk'>" . htmlentities($msg['explnum_statut_msg'], ENT_QUOTES, $charset) . "</label>"; $form = str_replace('<!-- explnum_statut -->', $explnum_statut_form, $form); } //Conserver la vignette if ($this->explnum_vignette) { $form = str_replace('!!vignette_existante!!', " <input type='checkbox' checked='checked' name='conservervignette' id='conservervignette' value='1'> <label for='conservervignette'>" . $msg[explnum_conservervignette] . "</label>", $form); } else { $form = str_replace('!!vignette_existante!!', '', $form); } global $_mimetypes_bymimetype_; create_tableau_mimetype(); $selector_mimetype = "<label class='etiquette'>" . htmlentities($msg['explnum_mime_label'], ENT_QUOTES, $charset) . "</label> <select id='mime_vign' name='mime_vign' >\n\t\t\t<option value=''>" . htmlentities($msg['explnum_no_mimetype'], ENT_QUOTES, $charset) . "</option>\n\t\t\t"; foreach ($_mimetypes_bymimetype_ as $key => $val) { //$selected=""; //if($this->explnum_mimetype == $key) //$selected = "selected"; $selector_mimetype .= "<option value='" . $key . "' {$selected} >" . htmlentities($key, ENT_QUOTES, $charset) . "</option>"; } $selector_mimetype .= "</select>"; $form = str_replace('!!mimetype_list!!', $selector_mimetype, $form); //Intégration de la gestion de l'interface de l'upload if ($pmb_docnum_in_directory_allow) { $div_up = "<div class='row'>"; if ($pmb_docnum_in_database_allow) { $div_up .= "<input type='radio' name='up_place' id='base' value='0' !!check_base!!/> <label for='base'>{$msg['upload_repertoire_sql']}</label>"; } $div_up .= "\t<input type='radio' name='up_place' id='upload' value='1' !!check_up!! />\n\t\t\t\t\t\t\t\t<label for='upload'>{$msg['upload_repertoire_server']}\n\t\t\t\t\t\t\t\t\t<input type='text' name='path' id='path' class='saisie-50emr' value='!!path!!' /><input type='button' class='bouton' name='upload_path' id='upload_path' value='...' onclick='upload_openFrame(event)'/>\n\t\t\t\t\t\t\t\t</label> \n\t\t\t\t\t\t\t\t<input type='hidden' name='id_rep' id='id_rep' value='!!id_rep!!' /> \n\t\t\t\t\t\t\t</div>"; $form = str_replace('!!div_upload!!', $div_up, $form); $up = new upload_folder($this->explnum_repertoire); //$nom_chemin = ($up->isHashing() ? $this->explnum_rep_nom : $this->explnum_rep_nom.$this->explnum_path); $nom_chemin = $this->explnum_rep_nom; if ($up->isHashing()) { $nom_chemin .= "/"; } else { $nom_chemin .= $this->explnum_path === '' ? "/" : $this->explnum_path; } $form = str_replace('!!path!!', htmlentities($nom_chemin, ENT_QUOTES, $charset), $form); $form = str_replace('!!id_rep!!', htmlentities($this->explnum_repertoire, ENT_QUOTES, $charset), $form); if ($this->explnum_rep_nom || $this->isEnUpload()) { $form = str_replace('!!check_base!!', '', $form); $form = str_replace('!!check_up!!', 'checked', $form); } else { $form = str_replace('!!check_base!!', '', $form); $form = str_replace('!!check_up!!', 'checked', $form); } } else { $form = str_replace('!!div_upload!!', '', $form); } //Ajout du selecteur de localisation if ($explnum_id) { if (!$this->explnum_location) { $requete = "select idlocation from docs_location"; $res = mysql_query($requete); $i = 0; while ($row = mysql_fetch_array($res)) { $liste_id[$i] = $row["idlocation"]; $i++; } } else { $liste_id = $this->explnum_location; } } else { global $deflt_docs_location; $liste_id[0] = $deflt_docs_location; } $docloc = new docs_location(); $selector_location = $docloc->gen_multiple_combo($liste_id); $form = str_replace('!!location_explnum!!', "<div class='row'><label class='etiquette'>" . htmlentities($msg['empr_location'], ENT_QUOTES, $charset) . "</label></div>" . $selector_location, $form); }
function traite_exemplaires() { global $msg, $dbh; global $prix, $notice_id, $tdoc_codage, $book_lender_id, $sdoc_codage, $book_statut_id, $locdoc_codage, $statisdoc_codage, $cote_mandatory; global $info_997; global $idcode_stat_expl; // lu en 010$d de la notice $price = $prix[0]; // la zone 997 est répétable ? for ($nb_expl = 0; $nb_expl < sizeof($info_997); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ if (!$info_997[$nb_expl]['a']) { $expl['cb'] = "ABS {$notice_id}"; } else { $expl['cb'] = $info_997[$nb_expl]['a']; } $expl['notice'] = $notice_id; // Type de document $data_doc = array(); $data_doc['tdoc_libelle'] = $info_997[$nb_expl]['t'] . " -Importé"; $data_doc['duree_pret'] = 0; /* valeur par défaut */ $data_doc['tdoc_codage_import'] = $info_997[$nb_expl]['t']; if ($tdoc_codage) { $data_doc['tdoc_owner'] = $book_lender_id; } else { $data_doc['tdoc_owner'] = 0; } $expl['typdoc'] = docs_type::import($data_doc); // cote du document : $3 ? $expl['cote'] = $info_997[$nb_expl]['3']; // Section $data_doc = array(); $data_doc['section_libelle'] = $info_997[$nb_expl]['d'] . " -Importé"; $data_doc['sdoc_codage_import'] = $info_997[$nb_expl]['d']; if ($sdoc_codage) { $data_doc['sdoc_owner'] = $book_lender_id; } else { $data_doc['sdoc_owner'] = 0; } $expl['section'] = docs_section::import($data_doc); // Statut : choisi lors de l'import $expl['statut'] = $book_statut_id; // Localisation $data_doc = array(); $data_doc['location_libelle'] = $info_997[$nb_expl]['c'] . "-Importé"; $data_doc['locdoc_codage_import'] = $info_997[$nb_expl]['c']; if ($locdoc_codage) { $data_doc['locdoc_owner'] = $book_lender_id; } else { $data_doc['locdoc_owner'] = 0; } $expl['location'] = docs_location::import($data_doc); // Code statistique : fixé dans le paramétrage $expl['codestat'] = $idcode_stat_expl; $expl['prix'] = $price; $expl['expl_owner'] = $book_lender_id; $expl['cote_mandatory'] = $cote_mandatory; $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } } // fin for }
function import($data) { //champs de data : nom, prenom, cb, adr1, adr2,cp, ville, pays, mail, tel1, sms, tel2, year, sexe, login, password, date_adhesion, date_fin_blocage, date_expiration, date_creation //date_modif, prof, total_loans,last_loan_date, lang, msg, type_abt, //Pour la localisation : location, location_libelle, location_libelle_create, locdoc_owner //Pour la categorie : categ, categ_libelle, categ_libelle_create; //Pour le codestat: codestat, codestat_libelle, codestat_libelle_create; //Pour le statut: statut, statut_libelle, statut_libelle_create; global $dbh, $lang; // check sur le type de la variable passée en paramètre if (!sizeof($data) || !is_array($data)) { // si ce n'est pas un tableau ou un tableau vide, on retourne 0 return 0; } //Check si le lecteur a au moin un nom ou un prenom if (!$data['nom']) { return 0; } //Check si le code barre n'est pas déja utilisé $this->cb = addslashes($data['cb']); $query = "SELECT id_empr FROM empr WHERE empr_cb='" . $this->cb . "' LIMIT 1 "; $result = @mysql_query($query, $dbh); if (!$result) { die("can't SELECT in database"); } //On prepare les paramètres $this->empr_location = 0; if (!$data['location'] and !$data['location_libelle'] and $data['location_libelle_create'] != '') { //Dans la cas ou l'on veut creer la location $data2 = array(); $data2['location_libelle'] = $data['location_libelle_create']; $data2['locdoc_codage_import'] = $data['location_libelle_create']; $data2['locdoc_owner'] = $data['locdoc_owner']; $this->empr_location = docs_location::import($data2); } elseif ($data['location_libelle'] != '') { $q = "select idlocation from docs_location where location_libelle='" . addslashes($data['location_libelle']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->empr_location = mysql_result($r, 0, 0); } } else { $q = "select idlocation from docs_location where idlocation='" . addslashes($data['location']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->empr_location = mysql_result($r, 0, 0); } } if (!$this->empr_location) { return 0; } $this->categ = 0; if (!$data['categ'] and !$data['categ_libelle'] and $data['categ_libelle_create'] != '') { //Dans la cas ou l'on veut creer la location $q = "select id_categ_empr from empr_categ where libelle='" . addslashes($data['categ_libelle_create']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->categ = mysql_result($r, 0, 0); } else { $q = "insert into empr_categ (libelle) values ('" . addslashes($data['categ_libelle_create']) . "') "; $r = mysql_query($q, $dbh); $this->categ = mysql_insert_id($dbh); } } elseif ($data['categ_libelle'] != '') { $q = "select id_categ_empr from empr_categ where libelle='" . addslashes($data['categ_libelle']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->categ = mysql_result($r, 0, 0); } } else { $q = "select id_categ_empr from empr_categ where id_categ_empr='" . addslashes($data['categ']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->categ = mysql_result($r, 0, 0); } } if (!$this->categ) { return 0; } $this->cstat = 0; if (!$data['codestat'] and !$data['codestat_libelle'] and $data['codestat_libelle_create'] != '') { //Dans la cas ou l'on veut creer la location $q = "select idcode from empr_codestat where libelle='" . addslashes($data['codestat_libelle_create']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->cstat = mysql_result($r, 0, 0); } else { $q = "insert into empr_codestat (libelle) values ('" . addslashes($data['codestat_libelle_create']) . "') "; $r = mysql_query($q, $dbh); $this->cstat = mysql_insert_id($dbh); } } elseif ($data['codestat_libelle'] != '') { $q = "select idcode from empr_codestat where libelle='" . addslashes($data['codestat_libelle']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->cstat = mysql_result($r, 0, 0); } } else { $q = "select idcode from empr_codestat where idcode='" . addslashes($data['codestat']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->cstat = mysql_result($r, 0, 0); } } if (!$this->cstat) { return 0; } $this->empr_statut = 0; if (!$data['statut'] and !$data['statut_libelle'] and $data['statut_libelle_create'] != '') { //Dans la cas ou l'on veut creer la location $q = "select idstatut from empr_statut where statut_libelle='" . addslashes($data['statut_libelle_create']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->empr_statut = mysql_result($r, 0, 0); } else { $q = "insert into empr_statut (statut_libelle) values ('" . addslashes($data['statut_libelle_create']) . "') "; $r = mysql_query($q, $dbh); $this->empr_statut = mysql_insert_id($dbh); } } elseif ($data['statut_libelle'] != '') { $q = "select idstatut from empr_statut where statut_libelle='" . addslashes($data['statut_libelle']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->empr_statut = mysql_result($r, 0, 0); } } else { $q = "select idstatut from empr_statut where idstatut='" . addslashes($data['statut']) . "' limit 1"; $r = mysql_query($q, $dbh); if (mysql_num_rows($r)) { $this->empr_statut = mysql_result($r, 0, 0); } } if (!$this->empr_statut) { return 0; } $this->nom = addslashes($data['nom']); $this->prenom = addslashes($data['prenom']); $this->adr1 = addslashes($data['adr1']); $this->adr2 = addslashes($data['adr2']); $this->cp = addslashes($data['cp']); $this->ville = addslashes($data['ville']); $this->pays = addslashes($data['pays']); $this->mail = addslashes($data['mail']); $this->tel1 = addslashes($data['tel1']); $this->sms = addslashes($data['sms']); $this->tel2 = addslashes($data['tel2']); if ($data['sexe'] === 0 or $data['sexe'] == 1 or $data['sexe'] == 2) { $this->sexe = $data['sexe']; } else { $this->sexe = 0; } $this->birth = addslashes($data['year']); $this->date_adhesion = addslashes($data['date_adhesion']); $this->date_blocage = addslashes($data['date_fin_blocage']); $this->date_expiration = addslashes($data['date_expiration']); if (!$data['date_creation']) { $this->cdate = today(); } else { $this->cdate = addslashes($data['date_creation']); } if (!$data['date_modif']) { $this->mdate = today(); } else { $this->mdate = addslashes($data['date_modif']); } $this->pwd = addslashes($data['password']); $this->prof = addslashes($data['prof']); $this->total_loans = addslashes($data['total_loans']); $this->last_loan_date = addslashes($data['last_loan_date']); if (!$data['lang']) { $this->empr_lang = $lang; } else { $this->empr_lang = addslashes($data['lang']); } $this->empr_msg = addslashes($data['msg']); $this->type_abt = addslashes($data['type_abt']); $this->login = addslashes($data['login']); $q = "insert into empr (empr_cb, empr_nom, empr_prenom, empr_adr1, empr_cp, empr_ville, empr_pays, "; $q .= "empr_mail, empr_tel1, empr_sms, empr_categ, empr_codestat, empr_sexe, empr_login, empr_date_adhesion, "; $q .= "empr_date_expiration, empr_lang, empr_location,empr_msg,empr_year,empr_creation,empr_adr2,empr_tel2, empr_modif,empr_password,empr_prof,type_abt,empr_statut,total_loans,last_loan_date,date_fin_blocage) "; $q .= "values ('" . $this->cb . "', '" . $this->nom . "', '" . $this->prenom . "', '" . $this->adr1 . "', '" . $this->cp . "', '" . $this->ville . "', '" . $this->pays . "', "; $q .= "'" . $this->mail . "', '" . $this->tel1 . "', '" . $this->sms . "', '" . $this->categ . "', '" . $this->cstat . "', '" . $this->sexe . "', '" . $this->login . "', '" . $this->date_adhesion . "', "; $q .= "'" . $this->date_expiration . "', '" . $this->empr_lang . "', '" . $this->empr_location . "', '" . $this->empr_msg . "', '" . $this->birth . "', '" . $this->cdate . "', '" . $this->adr2 . "', '" . $this->tel2 . "', '" . $this->mdate . "', '" . $this->pwd . "', '" . $this->prof . "','" . $this->type_abt . "','" . $this->empr_statut . "','" . $this->total_loans . "', '" . $this->last_loan_date . "', '" . $this->date_blocage . "') "; $r = mysql_query($q, $dbh); return mysql_insert_id($dbh); }
function traite_exemplaires() { global $msg, $dbh; global $nb_expl_ignores; global $bulletin_ex; global $prix, $notice_id, $info_995, $typdoc_995, $tdoc_codage, $book_lender_id, $section_995, $sdoc_codage, $book_statut_id, $locdoc_codage, $codstatdoc_995, $statisdoc_codage, $cote_mandatory, $book_location_id; // lu en 010$d de la notice //$price = $prix[0]; // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); if ($bulletin_ex == -1) { return; } elseif ($bulletin_ex) { $expl['bulletin'] = $bulletin_ex; $expl['notice'] = 0; } else { $expl['notice'] = $notice_id; $expl['bulletin'] = 0; } /* préparation du tableau à passer à la méthode */ $cbarre = $info_995[$nb_expl]['f']; if (!$cbarre) { $cbarre = "ind"; } $pb = 1; $num_login = 1; $expl['cb'] = $cbarre; while ($pb == 1) { $q = "SELECT expl_cb FROM exemplaires WHERE expl_cb='" . $expl['cb'] . "' LIMIT 1 "; $r = pmb_mysql_query($q, $dbh); //echo "requete : ".$q."<br>"; $nb = pmb_mysql_num_rows($r); if ($nb) { $expl['cb'] = $cbarre . "-" . $num_login; $num_login++; } else { $pb = 0; } } // $expl['typdoc'] = $info_995[$nb_expl]['r']; à chercher dans docs_typdoc $data_doc = array(); //$data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']." -Type doc importé (".$book_lender_id.")"; $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']; $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['r']; if (!$data_doc['tdoc_libelle']) { $data_doc['tdoc_libelle'] = "Indéterminé"; $data_doc['tdoc_codage_import'] = "Indéterminé"; } $data_doc['duree_pret'] = 0; /* valeur par défaut */ $data_doc['tdoc_owner'] = 0; $expl['typdoc'] = docs_type::import($data_doc); $expl['cote'] = $info_995[$nb_expl]['k']; if ($expl['cote'] == "") { $expl['cote'] = "Indetermine"; } // $expl['section'] = $info_995[$nb_expl]['q']; à chercher dans docs_section /*$data_doc=array(); $info_995[$nb_expl]['q']=trim($info_995[$nb_expl]['q']); if (!$info_995[$nb_expl]['q']) $info_995[$nb_expl]['q'] = "u"; */ $data_doc = array(); $data_doc['section_libelle'] = $info_995[$nb_expl]['q']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['q']; if (!$data_doc['section_libelle']) { $data_doc['section_libelle'] = "Indéterminé"; $data_doc['sdoc_codage_import'] = "Indéterminé"; } $data_doc['sdoc_owner'] = 0; $expl['section'] = docs_section::import($data_doc); if (!$info_995[$nb_expl]['o']) { $expl['statut'] = $book_statut_id; } else { $info_995[$nb_expl]['o'] = "Indéterminé"; $data_doc = array(); $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['o']; $data_doc['statut_libelle'] = $info_995[$nb_expl]['o']; $data_doc['statusdoc_owner'] = 0; $expl['statut'] = docs_statut::import($data_doc); } //$expl['statut'] = $book_statut_id; if ($info_995[$nb_expl]['a'] != "") { $data_doc = array(); $data_doc['locdoc_codage_import'] = $info_995[$nb_expl]['a']; $data_doc['location_libelle'] = $info_995[$nb_expl]['a']; $data_doc['locdoc_owner'] = 0; $expl['location'] = docs_location::import($data_doc); } else { $expl['location'] = $book_location_id; } // $expl['codestat'] = $info_995[$nb_expl]['q']; 'q' utilisé, éventuellement à fixer par combo_box $data_doc = array(); $data_doc['codestat_libelle'] = $info_995[$nb_expl]['q']; $data_doc['statisdoc_codage_import'] = $info_995[$nb_expl]['q']; if (!$data_doc['codestat_libelle']) { $data_doc['codestat_libelle'] = "Indéterminé"; $data_doc['statisdoc_codage_import'] = "Indéterminé"; } $data_doc['statisdoc_owner'] = 0; $expl['codestat'] = docs_codestat::import($data_doc); // $expl['creation'] = $info_995[$nb_expl]['']; à préciser // $expl['modif'] = $info_995[$nb_expl]['']; à préciser $expl['comment'] = $info_995[$nb_expl]['u']; $expl['note'] = ""; $expl['prix'] = $prix[0]; $expl['expl_owner'] = $book_lender_id; $expl['cote_mandatory'] = $cote_mandatory; $data['date_depot'] = ""; // Attention il faut en post migration mette cette info dans la date de création de l'exemplaire // quoi_faire $expl['quoi_faire'] = 2; $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } else { } } // fin for }
} } break; case 'preload': if ($sub == "import_expl") { /* Does the file exist ? */ if ($file_submit == "") { /* l'utilisateur n'est pas passé par le téléchargement du fichier */ $filename = $base_path . "/admin/import/" . $nom_fichier_transfert_ftp; $from_file = "unimarc" . (defined("LOCATION") ? "_" . constant("LOCATION") : "") . ".fic"; } else { $filename = $file_submit; } if ($book_lender_id == "" || $book_statut_id == "" || $isbn_mandatory == "" || $cote_mandatory == "" || $book_location_id == "" || $statutnot == "") { /* l'utilisateur n'est pas passé par le téléchargement du fichier, il faut qu'il choisisse un prêteur s'il n'en a pas communiqué auparavant */ print "\n\t\t\t\t\t<form class='form-{$current_module}' NAME=\"preload\" METHOD=\"post\" ACTION=\"iimport_expl.php\">\n\t\t\t\t\t\t<h3>" . $msg['import_expl_form_titre'] . "</h3>\n\t\t\t\t\t\t<div class='form-contenu'>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<div class='colonne2'>\n\t\t\t\t\t\t\t\t<label class='etiquette' for='isbn_obligatoire'>{$msg['564']}</label><br />\n\t\t\t\t\t\t\t\t<INPUT TYPE='radio' NAME='isbn_mandatory' id='io1' VALUE='1' CLASS='radio' /><label for='io1'> {$msg['40']} </label>\n\t\t\t\t\t\t\t\t<INPUT TYPE='radio' NAME='isbn_mandatory' id='io0' VALUE='0' CLASS='radio' checked='checked' /><label for='io0'> {$msg['39']} </label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class='colonne-suite'>\n\t\t\t\t\t\t\t\t<label class='etiquette' for='isbn_dedoublonnage'>{$msg['568']}</label><br />\n\t\t\t\t\t\t\t\t<INPUT TYPE='radio' NAME='isbn_dedoublonnage' id='di1' VALUE='1' CLASS='radio' checked='checked' /><label for='di1'> {$msg['40']} </label>\n\t\t\t\t\t\t\t\t<INPUT TYPE='radio' NAME='isbn_dedoublonnage' id='di0' VALUE='0' CLASS='radio' /><label for='di0'> {$msg['39']} </label>\n\t\t\t\t\t\t\t\t<input type='checkbox' name='isbn_only' id='ionly' value='1'/><label for='ionly'> " . $msg["ignore_issn"] . " </label>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class='row'> </div>\n\t\t\t\t\t\t<div class='row'>\n\t <div class='colonne2'>\t\n\t \t\t<label class='etiquette' for='statutnot'>{$msg['import_statutnot']}</label>\n\t \t\t<div>\n\t \t\t" . gen_liste_multiple("select id_notice_statut, gestion_libelle from notice_statut order by 2", "id_notice_statut", "gestion_libelle", "id_notice_statut", "statutnot", "", 1, "", "", "", "", 0) . "\n\t \t\t</div>\n\t \t</div>\n\t \t<div class='colonne-suite'>\n \t\t\t<label class='etiquette' for='generer_lien'>" . $msg['import_genere_liens'] . "</label><br />\n \t\t\t<INPUT TYPE='radio' NAME='link_generate' id='link1' VALUE=' 1' CLASS='radio' /><label for='link1'> {$msg['40']} </label>\n \t<INPUT TYPE='radio' NAME='link_generate' id='link0' VALUE='0' CLASS='radio' checked='checked' /><label for='link0'> {$msg['39']} </label>\n\t \t</div>\n \t</div>\n \t<div class='row'> </div>\n\t \t<div class='row'>\n\t \t\t<div class='colonne2'>\n\t \t\t\t <br />\n\t \t\t\t \n\t \t\t</div>\n\t \t\t<div class='colonne-suite'>\n\t\t\t\t\t\t\t\t<label class='etiquette' for='authorities_notices'>" . htmlentities($msg['import_with_authorities_notices'], ENT_QUOTES, $charset) . "</label><br />\n\t\t\t\t\t\t\t\t<input type='radio' name='authorities_notices' id='authorities_notices1' value='1' class='radio' /><label for='authorities_notices1'>" . htmlentities($msg[40], ENT_QUOTES, $charset) . "</label> \t\t\t\n\t\t\t\t\t\t\t\t<input type='radio' name='authorities_notices' id='authorities_notices0' value='0' class='radio' checked='checked'/><label for='authorities_notices0'>" . htmlentities($msg[39], ENT_QUOTES, $charset) . "</label>\n\t \t</div>\n\t \t</div>\n\t \t<div class='row'> </div>\n \t\t<div clas='row'>\n \t\t\t<div class='colonne2'>\n \t\t\t\t <br />\n \t\t\t\t \n \t\t\t</div>\n \t\t\t<div class='colonne-suite'>\n \t\t\t\t<label class='etiquette' for='authorities_default_origin'>" . htmlentities($msg['import_authorities_origin_default_value'], ENT_QUOTES, $charset) . "</label><br />\n\t\t\t\t\t\t\t\t" . origin::gen_combo_box("authorities", "authorities_default_origin") . "\n \t\t\t</div> \n \t\t</div>\t\n \t\t<div class='row'> </div>\n\t\t\t\t\t\t<div class='row'><hr /></div>\n\t\t\t\t\t\t<div class='row'>\n <label class='etiquette' for='prêteur statut'>{$msg['560']}</label>\n </div>\n <div class='row'>" . lender::gen_combo_box($book_lender_id) . " " . docs_statut::gen_combo_box($book_statut_id) . "\n </div>\n\t <div class='row'>\n \t <label class='etiquette' for='localisation'>{$msg['import_localisation']}</label>\n \t </div>\n \t <div class='row'>" . docs_location::gen_combo_box($deflt_docs_location) . "\n \t </div>\n <div class='row'><hr /></div>\n \t<div class='row'>\n <label class='etiquette' for='cote_obligatoire'>{$msg['566']}</label>\n </div>\n <div class='row'>\n <INPUT TYPE='radio' NAME='cote_mandatory' VALUE='1' CLASS='radio' /> {$msg['40']}\n <INPUT TYPE='radio' NAME='cote_mandatory' VALUE='0' CLASS='radio' checked='checked' /> {$msg['39']}\n </div>\n <div class='row'><hr /></div>\n <div class='row'>\n <label class='etiquette'>{$msg['17']}</label>\n </div>\n <div class='row'>\n <INPUT TYPE='radio' NAME='tdoc_codage' VALUE='1' CLASS='radio' /> " . $msg["import_expl_codage_proprio"] . "\n <INPUT TYPE='radio' NAME='tdoc_codage' VALUE='0' CLASS='radio' checked='checked' /> " . $msg["import_expl_codage_generique"] . "\n </div>\n <div class='row'>\n <label class='etiquette'>{$msg['24']}</label>\n </div>\n <div class='row'>\n <INPUT TYPE='radio' NAME='statisdoc_codage' VALUE='1' CLASS='radio' /> " . $msg["import_expl_codage_proprio"] . "\n <INPUT TYPE='radio' NAME='statisdoc_codage' VALUE='0' CLASS='radio' checked='checked' /> " . $msg["import_expl_codage_generique"] . "\n </div>\n <div class='row'>\n <label class='etiquette'>{$msg['19']}</label>\n </div>\n <div class='row'>\n <INPUT TYPE='radio' NAME='sdoc_codage' VALUE='1' CLASS='radio' /> " . $msg["import_expl_codage_proprio"] . "\n <INPUT TYPE='radio' NAME='sdoc_codage' VALUE='0' CLASS='radio' checked='checked' /> " . $msg["import_expl_codage_generique"] . "\n </div>\n <div class='row'>\n <label class='etiquette'>{$msg['21']}</label>\n </div>\n </div>\n <INPUT TYPE=\"SUBMIT\" class='bouton' NAME=\"upload\" VALUE=\"" . $msg[502] . "\" />\n <INPUT NAME=\"categ\" TYPE=\"hidden\" value=\"import\" />\n <INPUT NAME=\"sub\" TYPE=\"hidden\" value=\"import_expl\" />\n <INPUT NAME=\"action\" TYPE=\"hidden\" value=\"preload\" />\n <INPUT NAME=\"" . $name_func . "\" TYPE=\"hidden\" value=\"" . ${$name_func} . "\"/>\n </FORM>"; break; } loadfile_in_table(); if ($pb_fini == "EOF") { $formulaire = "<form class='form-{$current_module}' name=\"load\" method=\"post\" action=\"iimport_expl.php\">"; $formulaire .= "<INPUT NAME=\"categ\" TYPE=\"hidden\" value=\"import\" />"; $formulaire .= "<INPUT NAME=\"sub\" TYPE=\"hidden\" value=\"import_expl\" />"; $formulaire .= "<INPUT NAME=\"action\" TYPE=\"hidden\" value=\"load\" />"; $formulaire .= "<INPUT NAME=\"book_lender_id\" TYPE=\"hidden\" value=\"" . $book_lender_id . "\" />"; $formulaire .= "<INPUT NAME=\"book_statut_id\" TYPE=\"hidden\" value=\"" . $book_statut_id . "\" />"; $formulaire .= "<input type=\"hidden\" name=\"filename\" value=\"{$filename}\" />"; $formulaire .= "<input type=\"hidden\" name=\"from_file\" value=\"{$from_file}\" />"; $formulaire .= "<INPUT TYPE=\"hidden\" NAME=\"isbn_mandatory\" VALUE=\"{$isbn_mandatory}\" />\n"; $formulaire .= "<INPUT TYPE=\"hidden\" NAME=\"isbn_dedoublonnage\" VALUE=\"{$isbn_dedoublonnage}\" />\n"; $formulaire .= "<INPUT TYPE=\"hidden\" NAME=\"isbn_only\" VALUE=\"{$isbn_only}\" />\n";
function traite_exemplaires() { global $msg, $dbh; global $nb_expl_ignores; global $prix, $notice_id, $info_996, $info_995, $info_001, $info_345_d; global $bulletin_id; global $id_expl_fournisseur_opsys, $id_expl_inventaire_opsys; // Afin de ne pas remettre en cause le script programmé en 995 : $info_995 = $info_996; // lu en 010$d de la notice $price = $prix[0]; // prix dvd et video if ($info_345_d[0]) { $price = $info_345_d[0]; } // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ $expl['notice'] = $notice_id; $expl['cb'] = $info_995[$nb_expl]['f']; $expl['cote'] = $info_995[$nb_expl]['k']; $expl['note'] = $info_995[$nb_expl]['u'] . $info_995[$nb_expl]['5']; $expl['prix'] = $price; $expl['cote_mandatory'] = 0; $expl['date_depot'] = substr($info_995[$nb_expl]['m'], 0, 4) . "-" . substr($info_995[$nb_expl]['m'], 4, 2) . "-" . substr($info_995[$nb_expl]['m'], 6, 2); $expl['date_retour'] = substr($info_995[$nb_expl]['n'], 0, 4) . "-" . substr($info_995[$nb_expl]['n'], 4, 2) . "-" . substr($info_995[$nb_expl]['n'], 6, 2); // propriétaire $owner = array(); $owner['lender_libelle'] = $info_995[$nb_expl]['a']; if (!$owner['lender_libelle']) { $owner['lender_libelle'] = $info_995[$nb_expl]['b']; } if (!$owner['lender_libelle']) { $owner['lender_libelle'] = 'defaut'; } $expl['expl_owner'] = lender::import($owner); $book_lender_id = $expl['expl_owner']; // docs_location $data_doc = array(); $data_doc['location_libelle'] = $info_995[$nb_expl]['v']; $data_doc['locdoc_codage_import'] = $info_995[$nb_expl]['w']; if (!$data_doc['locdoc_codage_import']) { $data_doc['locdoc_codage_import'] = $data_doc['location_libelle']; } //$data_doc['locdoc_owner'] = $book_lender_id ; $data_doc['locdoc_owner'] = 0; $expl['location'] = docs_location::import($data_doc); // docs_section $data_doc = array(); $data_doc['section_libelle'] = $info_995[$nb_expl]['x']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['y']; if (!$data_doc['sdoc_codage_import']) { $data_doc['sdoc_codage_import'] = $data_doc['section_libelle']; } //$data_doc['sdoc_owner'] = $book_lender_id ; $data_doc['sdoc_owner'] = 0; $expl['section'] = docs_section::import($data_doc); // typedoc $data_doc = array(); $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['e']; if (!$data_doc['tdoc_libelle']) { $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']; } $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['r']; if (!$data_doc['tdoc_codage_import']) { $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['e']; } $data_doc['duree_pret'] = 28; /* valeur par défaut */ $data_doc['tdoc_owner'] = $book_lender_id; $expl['typdoc'] = docs_type::import($data_doc); // statut doc $data_doc = array(); $data_doc['statut_libelle'] = $info_995[$nb_expl]['1']; $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['2']; if (!$data_doc['statusdoc_codage_import']) { $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['1']; } $data_doc['pret_flag'] = $info_995[$nb_expl]['3']; $data_doc['statusdoc_owner'] = $book_lender_id; $expl['statut'] = docs_statut::import($data_doc); // codestat //$expl['codestat'] = 10 ; $data_codestat['codestat_libelle'] = strtolower($info_995[$nb_expl]['x']); $expl['codestat'] = docs_codestat::import($data_codestat); // quoi_faire // $que_faire vient du formulaire de chargement, à utiliser en attente de l'info dans la zone 996 global $que_faire; if ($que_faire == "") { if ($info_995[$nb_expl]['0']) { $expl['quoi_faire'] = $info_995[$nb_expl]['0']; } else { $expl['quoi_faire'] = 2; } } else { $expl['quoi_faire'] = $que_faire; } // 0 : supprimer, 1 ou vide : Mettre à jour ou ajouter, 2 : ajouter si possible, sinon rien. //print "<pre>";print_r($info_995);print_r($expl);print "</pre>"; $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } list($num_opsys, $type_opsys) = explode(" ", $info_001[0]); if ($type_opsys == 'UMO:13') { $requete = "update exemplaires set expl_notice='0', expl_bulletin='{$bulletin_id}' where expl_id='{$expl_id}' "; //print "$requete <br />"; pmb_mysql_query($requete); } if (!$id_expl_fournisseur_opsys) { $rqt = "select idchamp from expl_custom where name='fournisseur'"; $res = pmb_mysql_query($rqt, $dbh); if ($res && ($r = pmb_mysql_fetch_object($res))) { $id_expl_fournisseur_opsys = $r->idchamp; } } if (!$id_expl_inventaire_opsys) { $rqt = "select idchamp from expl_custom where name='inventaire'"; $res = pmb_mysql_query($rqt, $dbh); if ($res && ($r = pmb_mysql_fetch_object($res))) { $id_expl_inventaire_opsys = $r->idchamp; } } //inventaire en champ perso if ($field = $info_995[$nb_expl]['6']) { $requete = "insert into expl_custom_values (expl_custom_champ,expl_custom_origine,expl_custom_small_text) values({$id_expl_inventaire_opsys},{$expl_id},'" . addslashes($field) . "')"; pmb_mysql_query($requete); } //Fournisseur en champ perso if ($field = $info_995[$nb_expl]['7']) { $requete = "insert into expl_custom_values (expl_custom_champ,expl_custom_origine,expl_custom_small_text) values({$id_expl_fournisseur_opsys},{$expl_id},'" . addslashes($field) . "')"; pmb_mysql_query($requete); } //Date de création if ($field = $info_995[$nb_expl]['8']) { $requete = "update exemplaires set create_date='{$field} 12:00:00' where expl_id='{$expl_id}' "; //print $requete; pmb_mysql_query($requete); } } // fin for }
if (count($not_all_mail) > 0) { print "\n\t\t\t\t\t<form name='print_empr_ids' action='pdf.php?pdfdoc=lettre_retard{$restrict_localisation}' target='lettre' method='post'>\n\t\t\t\t\t"; for ($i = 0; $i < count($not_all_mail); $i++) { print "<input type='hidden' name='empr_print[]' value='" . $not_all_mail[$i] . "'/>"; } print "\t<script>openPopUp('','lettre', 600, 500, -2, -2, 'toolbar=no, dependent=yes, resizable=yes');\n\t\t\t\t\t\tdocument.print_empr_ids.submit();\n\t\t\t\t\t\t</script>\n\t\t\t\t\t</form>\n\t\t\t\t\t"; } } break; } //switch($dest) } else { // la requête n'a produit aucun résultat switch ($dest) { case "TABLEAU": break; case "TABLEAUHTML": break; default: echo $msg['n_retards_sur_total_de']; // formulaire de restriction echo "\n\t\t\t\t<form class='form-{$current_module}' id='form-{$current_module}-list' name='form-{$current_module}-list' action='{$url_page}?categ={$categ}&sub={$sub}&limite_page={$nb_per_page}&page={$page}' method='post'>\n\t\t\t \t<div class='left'>\n\t\t\t\t\t{$msg['circ_afficher']}\n\t\t\t \t\t<input type=text name=limite_page size=2 value={$nb_per_page} class='petit' /> {$msg['1905']} "; if ($pmb_lecteurs_localises) { echo " / " . $msg['editions_filter_empr_location'] . " : " . docs_location::gen_combo_box_empr($empr_location_id); echo $msg['editions_filter_docs_location'] . " : " . docs_location::gen_combo_box_docs($docs_location_id); } echo '</div>'; echo "\n\t\t\t\t<input type='button' class='bouton' value='" . $msg['actualiser'] . "' onClick=\"this.form.dest.value=''; this.form.submit();\"> <input type='hidden' name='dest' value='' />\n\t\t\t\t</form>\n\t\t\t\t<br />"; error_message($msg[46], str_replace('!!form_cb!!', $form_cb, $msg['edit_lect_aucun_trouve']), 1, './edit.php?categ=empr&sub=' . $sub); } }
} $sel_categ .= "</select>"; } $sug_form .= "\n\t\t<tr>\n\t\t\t<td class='cell_header' align=right>" . htmlentities($msg['acquisition_categ'], ENT_QUOTES, $charset) . "</td>\n\t\t\t<td>{$sel_categ}</td>\n\t\t</tr>"; } // Localisation de la suggestion if ($_SESSION["id_empr_session"]) { $requete = "SELECT * FROM empr WHERE id_empr=" . $_SESSION["id_empr_session"]; $res = mysql_query($requete); if ($res) { $empr = mysql_fetch_object($res); if (!$empr->empr_location) { $empr->empr_location = 0; } $list_locs = ''; $locs = new docs_location(); $list_locs = $locs->gen_combo_box_sugg($empr->empr_location, 1, ""); if ($opac_sugg_localises == 1) { $sug_form .= "\n\t\t\t<tr>\n\t\t\t\t<td class='cell_header' align=right>" . htmlentities($msg['acquisition_location'], ENT_QUOTES, $charset) . "</td>\n\t\t\t\t<td>{$list_locs}</td>\n\t\t\t</tr>"; } elseif ($opac_sugg_localises == 2) { $sug_form .= "<input type=\"hidden\" name=\"sugg_location_id\" value=\"" . $empr->empr_location . "\"/>"; } } } //Affichage du selecteur de source $req = "select * from suggestions_source order by libelle_source"; $res = mysql_query($req, $dbh); $option = "<option value='0' selected>" . htmlentities($msg['empr_sugg_no_src'], ENT_QUOTES, $charset) . "</option>"; while ($src = mysql_fetch_object($res)) { if ($id_sug) { $selected = $sugg->sugg_src == $src->id_source ? 'selected' : '';
function traite_exemplaires() { global $msg, $dbh; global $prix, $notice_id, $info_995, $typdoc_995, $tdoc_codage, $book_lender_id, $section_995, $sdoc_codage, $book_statut_id, $locdoc_codage, $codstatdoc_995, $statisdoc_codage, $cote_mandatory, $book_location_id, $nb_expl_ignores; // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ $expl['cb'] = $info_995[$nb_expl]['a']; if (!$expl['cb']) { $expl['cb'] = "NOTI-" . $notice_id; } $expl['notice'] = $notice_id; $expl['cote'] = $info_995[$nb_expl]['f']; $expl['note'] = $info_995[$nb_expl]['u']; $expl['prix'] = $info_995[$nb_expl]['B']; $expl['date_depot'] = today(); $expl['date_retour'] = today(); // type de support $data_doc = array(); $data_doc['tdoc_libelle'] = "Type doc - " . $info_995[$nb_expl]['c']; $data_doc['duree_pret'] = 0; /* valeur par défaut */ $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['c']; $data_doc['tdoc_owner'] = 0; $expl['typdoc'] = docs_type::import($data_doc); // $expl['section'] = $info_995[$nb_expl]['x']; à chercher dans docs_section $data_doc = array(); $data_doc['section_libelle'] = $info_995[$nb_expl]['x']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['x']; $data_doc['sdoc_owner'] = 0; $expl['section'] = docs_section::import($data_doc); if (!$expl['section']) { $expl['section'] = 31; } // $expl['statut'] $data_doc = array(); $data_doc['statut_libelle'] = "Statut - " . $info_995[$nb_expl]['y']; $data_doc['pret_flag'] = 1; $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['y']; $data_doc['statusdoc_owner'] = 0; $expl['statut'] = docs_statut::import($data_doc); // $expl['location'] $data_doc = array(); $data_doc['location_libelle'] = "Localisation - " . $info_995[$nb_expl]['w']; $data_doc['locdoc_codage_import'] = $info_995[$nb_expl]['w']; $data_doc['locdoc_owner'] = 0; $expl['location'] = docs_location::import($data_doc); // $expl['codestat'] = $info_995[$nb_expl]['O']; (O majuscule, pas zéro) $data_doc = array(); $data_doc['codestat_libelle'] = "Code stat - " . $info_995[$nb_expl]['O']; $data_doc['statisdoc_codage_import'] = $info_995[$nb_expl]['O']; $data_doc['statisdoc_owner'] = 0; $expl['codestat'] = docs_codestat::import($data_doc); if (!$expl['codestat']) { $expl['codestat'] = 38; } // $expl['expl_owner'] $data_doc = array(); $data_doc['lender_libelle'] = $info_995[$nb_expl]['R']; $expl['expl_owner'] = lender::import($data_doc); if (!$expl['expl_owner']) { $expl['expl_owner'] = 3; } $expl['cote_mandatory'] = $cote_mandatory; $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } // Numéro du jeu if ($info_995[$nb_expl]['v'] && $expl_id) { $requete = "insert into expl_custom_values (expl_custom_champ,expl_custom_origine,expl_custom_small_text) values(1,{$expl_id},'" . addslashes($info_995[$nb_expl]['v']) . "')"; mysql_query($requete); } //debug : affichage zone 995 /* echo "995\$a =".$info_995[$nb_expl]['a']."<br />"; echo "995\$b =".$info_995[$nb_expl]['b']."<br />"; echo "995\$c =".$info_995[$nb_expl]['c']."<br />"; echo "995\$d =".$info_995[$nb_expl]['d']."<br />"; echo "995\$f =".$info_995[$nb_expl]['f']."<br />"; echo "995\$k =".$info_995[$nb_expl]['k']."<br />"; echo "995\$m =".$info_995[$nb_expl]['m']."<br />"; echo "995\$n =".$info_995[$nb_expl]['n']."<br />"; echo "995\$o =".$info_995[$nb_expl]['o']."<br />"; echo "995\$q =".$info_995[$nb_expl]['q']."<br />"; echo "995\$r =".$info_995[$nb_expl]['r']."<br />"; echo "995\$u =".$info_995[$nb_expl]['u']."<br /><br />"; */ } // fin for }
function traite_exemplaires() { global $msg, $dbh; global $prix, $notice_id, $info_995, $typdoc_995, $tdoc_codage, $book_lender_id, $section_995, $sdoc_codage, $book_statut_id, $locdoc_codage, $codstatdoc_995, $statisdoc_codage, $cote_mandatory, $info_464; global $bulletin_ex; // lu en 010$d de la notice $price = $prix[0]; // la zone 995 est répétable for ($nb_expl = 0; $nb_expl < sizeof($info_995); $nb_expl++) { /* RAZ expl */ $expl = array(); /* préparation du tableau à passer à la méthode */ $expl['cb'] = $info_995[$nb_expl]['f']; if ($bulletin_ex && is_array($info_464)) { $expl['bulletin'] = $bulletin_ex; $expl['notice'] = 0; } else { $expl['notice'] = $notice_id; $expl['bulletin'] = 0; } // $expl['typdoc'] = $info_995[$nb_expl]['r']; à chercher dans docs_typdoc $data_doc = array(); //$data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']." -Type doc importé (".$book_lender_id.")"; //$data_doc['tdoc_libelle'] = $typdoc_995[$info_995[$nb_expl]['r']]; //if (!$data_doc['tdoc_libelle']) $data_doc['tdoc_libelle'] = "\$r non conforme -".$info_995[$nb_expl]['r']."-" ; $data_doc['duree_pret'] = 0; /* valeur par défaut */ $data_doc['tdoc_codage_import'] = $info_995[$nb_expl]['r']; $data_doc['tdoc_libelle'] = $info_995[$nb_expl]['r']; if ($tdoc_codage) { $data_doc['tdoc_owner'] = $book_lender_id; } else { $data_doc['tdoc_owner'] = 0; } $expl['typdoc'] = docs_type::import($data_doc); $expl['cote'] = $info_995[$nb_expl]['k']; if (!trim($expl['cote'])) { $expl['cote'] = "ARCHIVES"; } // $expl['section'] = $info_995[$nb_expl]['q']; à chercher dans docs_section $data_doc = array(); if (!$info_995[$nb_expl]['t']) { $info_995[$nb_expl]['t'] = "inconnu"; } $data_doc['section_libelle'] = $info_995[$nb_expl]['t']; $data_doc['sdoc_codage_import'] = $info_995[$nb_expl]['t']; if ($sdoc_codage) { $data_doc['sdoc_owner'] = $book_lender_id; } else { $data_doc['sdoc_owner'] = 0; } $expl['section'] = docs_section::import($data_doc); /* $expl['statut'] à chercher dans docs_statut */ /* TOUT EST COMMENTE ICI, le statut est maintenant choisi lors de l'import if ($info_995[$nb_expl]['o']=="") $info_995[$nb_expl]['o'] = "e"; $data_doc=array(); $data_doc['statut_libelle'] = $info_995[$nb_expl]['o']." -Statut importé (".$book_lender_id.")"; $data_doc['pret_flag'] = 1 ; $data_doc['statusdoc_codage_import'] = $info_995[$nb_expl]['o'] ; $data_doc['statusdoc_owner'] = $book_lender_id ; $expl['statut'] = docs_statut::import($data_doc); FIN TOUT COMMENTE */ $expl['statut'] = $book_statut_id; // $expl['location'] = $info_995[$nb_expl]['']; à fixer par combo_box // figé dans le code ici pour l'instant : //$info_995[$nb_expl]['localisation']="Bib princip"; /* biblio principale */ $data_doc = array(); $data_doc['location_libelle'] = "inconnu"; if ($info_995[$nb_expl]['a']) { $data_doc['location_libelle'] = $info_995[$nb_expl]['a']; $data_doc['locdoc_codage_import'] = $info_995[$nb_expl]['a']; } else { $data_doc['locdoc_codage_import'] = "cdi"; } if ($locdoc_codage) { $data_doc['locdoc_owner'] = $book_lender_id; } else { $data_doc['locdoc_owner'] = 0; } $expl['location'] = docs_location::import($data_doc); // $expl['codestat'] = $info_995[$nb_expl]['q']; 'q' utilisé, éventuellement à fixer par combo_box $data_doc = array(); //$data_doc['codestat_libelle'] = $info_995[$nb_expl]['q']." -Pub visé importé (".$book_lender_id.")"; if (!$info_995[$nb_expl]['q']) { $info_995[$nb_expl]['q'] = "inconnu"; } $data_doc['codestat_libelle'] = $info_995[$nb_expl]['q']; $data_doc['statisdoc_codage_import'] = $info_995[$nb_expl]['q']; if ($statisdoc_codage) { $data_doc['statisdoc_owner'] = $book_lender_id; } else { $data_doc['statisdoc_owner'] = 0; } $expl['codestat'] = docs_codestat::import($data_doc); // $expl['creation'] = $info_995[$nb_expl]['']; à préciser // $expl['modif'] = $info_995[$nb_expl]['']; à préciser $expl['note'] = $info_995[$nb_expl]['u']; $expl['prix'] = $price; $expl['expl_owner'] = $book_lender_id; $expl['cote_mandatory'] = $cote_mandatory; $expl['date_depot'] = substr($info_995[$nb_expl]['m'], 0, 4) . "-" . substr($info_995[$nb_expl]['m'], 4, 2) . "-" . substr($info_995[$nb_expl]['m'], 6, 2); $expl['date_retour'] = substr($info_995[$nb_expl]['n'], 0, 4) . "-" . substr($info_995[$nb_expl]['n'], 4, 2) . "-" . substr($info_995[$nb_expl]['n'], 6, 2); $expl_id = exemplaire::import($expl); if ($expl_id == 0) { $nb_expl_ignores++; } //debug : affichage zone 995 /* echo "995\$a =".$info_995[$nb_expl]['a']."<br />"; echo "995\$b =".$info_995[$nb_expl]['b']."<br />"; echo "995\$c =".$info_995[$nb_expl]['c']."<br />"; echo "995\$d =".$info_995[$nb_expl]['d']."<br />"; echo "995\$f =".$info_995[$nb_expl]['f']."<br />"; echo "995\$k =".$info_995[$nb_expl]['k']."<br />"; echo "995\$m =".$info_995[$nb_expl]['m']."<br />"; echo "995\$n =".$info_995[$nb_expl]['n']."<br />"; echo "995\$o =".$info_995[$nb_expl]['o']."<br />"; echo "995\$q =".$info_995[$nb_expl]['q']."<br />"; echo "995\$r =".$info_995[$nb_expl]['r']."<br />"; echo "995\$u =".$info_995[$nb_expl]['u']."<br /><br />"; */ } // fin for }
$expl_pointage = str_replace('!!nouveau_codestat!!', $nouv_codestat->libelle, $expl_pointage); $expl_pointage = str_replace('!!nouveau_proprio!!', $nouv_proprio->lender_libelle, $expl_pointage); $expl_pointage_base = str_replace('!!explencoursdevalidation!!', $expl_pointage, $expl_pointage_base); } else { $expl_pointage_base = str_replace('!!explencoursdevalidation!!', "<hr /> {$noex} : {$msg['367']}...<hr />", $expl_pointage_base); } } else { $expl_pointage_base = str_replace('!!explencoursdevalidation!!', "", $expl_pointage_base); } $expl_pointage_base = str_replace('!!book_statut_id!!', docs_statut::gen_combo_box($book_statut_id), $expl_pointage_base); $expl_pointage_base = str_replace('!!book_section_id!!', docs_section::gen_combo_box($book_section_id), $expl_pointage_base); $expl_pointage_base = str_replace('!!book_location_id!!', docs_location::gen_combo_box($book_location_id), $expl_pointage_base); $expl_pointage_base = str_replace('!!book_doctype_id!!', docs_type::gen_combo_box($book_doctype_id), $expl_pointage_base); $expl_pointage_base = str_replace('!!book_codestat_id!!', docs_codestat::gen_combo_box($book_codestat_id), $expl_pointage_base); $expl_pointage_base = str_replace('!!book_lender_id!!', lender::gen_combo_box($book_lender_id), $expl_pointage_base); print $expl_pointage_base; break; default: include "{$include_path}/messages/help/{$lang}/pointage_expl.txt"; print "\n\t\t\t<form class='form-{$current_module}' METHOD='post' ACTION=\"pointage_expl.php\">\n\t\t\t<h3>{$msg['562']}</h3>\n\t\t\t<div class='form-contenu'>\n\t\t\t\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<div class='colonne4'>\n\t\t\t\t\t\t<!-- CB -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_statut'>{$msg['291']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t<input type='text' class='saisie-20em' name='noex' value=''>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\n\t\t\t\t\t<div class='colonne4'>\n\t\t\t\t\t\t<!-- statut -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_stat'>{$msg['297']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t" . docs_statut::gen_combo_box($book_statut_id) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div class='colonne4'>\n\t\t\t\t\t\t<!-- section -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_section'>{$msg['295']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t" . docs_section::gen_combo_box($book_section_id) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t<!-- localisation -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_location'>{$msg['298']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t" . docs_location::gen_combo_box($book_location_id) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='row'>\n\t\t\t\t\t<div class='colonne4'>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t\t<div class='colonne4'>\n\t\t\t\t\t\t<!-- typdoc=support -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_typdoc'>{$msg['294']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t" . docs_type::gen_combo_box($book_doctype_id) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\n\t\t\t\t\t<div class='colonne4'>\n\t\t\t\t\t\t<!-- codestat -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_cstat'>{$msg['299']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t" . docs_codestat::gen_combo_box($book_codestat_id) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t<div class='colonne_suite'>\n\t\t\t\t\t\t<!-- owner -->\n\t\t\t\t\t\t<label class='etiquette' for='f_ex_owner'>{$msg['651']}</label>\n\t\t\t\t\t\t<div class='row'>\n\t\t\t\t\t\t\t" . lender::gen_combo_box($book_lender_id) . "\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class='row'> </div>\n\t\t\t\n\t\t\t</div>\t\n\t\t\t<INPUT TYPE=\"SUBMIT\" class='bouton' NAME=\"upload\" VALUE=\"" . $msg[502] . "\">\n\t\t\t<INPUT NAME=\"categ\" TYPE=\"hidden\" value=\"import\">\n\t\t\t<INPUT NAME=\"sub\" TYPE=\"hidden\" value=\"pointage_expl\">\n\t\t\t<INPUT NAME=\"action\" TYPE=\"hidden\" value=\"pointage\">\n\t\t\t</FORM>"; break; } function expl_pointage($action, $annuler = '') { global $expl_pointage; global $msg; } /* fin expl_pointage */ ?>