function _checkin_response_($values) { global $pmb_antivol, $protocol_prolonge; global $selfservice_pret_expl_inconnu_msg; $localisation = $values["INSTITUTION_ID"][0]; $expl_cb = $values["ITEM_IDENTIFIER"][0]; $cancel = $values["CANCEL"][0] == "Y" ? true : false; $magnetic = "N"; $resensitize = "N"; $ok = 0; $titre = $expl_cb; $requete = "select expl_id,expl_bulletin,expl_notice,type_antivol,empr_cb from exemplaires join pret on (expl_id=pret_idexpl) join empr on (pret_idempr=id_empr) where expl_cb='" . addslashes($expl_cb) . "'"; $resultat = pmb_mysql_query($requete); if (!$resultat) { $ok = 0; $error = true; $ret["SCREEN_MESSAGE"][0] = $selfservice_pret_expl_inconnu_msg; } else { $expl = pmb_mysql_fetch_object($resultat); $empr_cb = $expl->empr_cb; if ($expl->expl_bulletin) { $isbd = new bulletinage_display($expl->expl_bulletin); $titre = $isbd->display; } else { $isbd = new mono_display($expl->expl_notice, 1); $titre = $isbd->header_texte; } if ($pmb_antivol) { if ($expl->type_antivol == 2) { $magnetic = "Y"; } } $retour = new expl_to_do($expl_cb); // Fonction qu effectue le retour d'un document $retour->do_retour_selfservice(); if ($retour->status == -1) { //Problème $ok = 0; } else { //Pas de problème $ok = 1; $resensitize = "Y"; } /* $ret["SCREEN_MESSAGE"][0]=$retour->message_loc; $ret["SCREEN_MESSAGE"][1]=$retour->message_resa; $ret["SCREEN_MESSAGE"][2]=$retour->message_retard; $ret["SCREEN_MESSAGE"][3]=$retour->message_amende; */ if ($retour->message_loc || $retour->message_resa || $retour->message_retard || $retour->message_amende || $retour->message_blocage) { $ret["SCREEN_MESSAGE"][0] = $retour->message_loc . " " . $retour->message_resa . " " . $retour->message_retard . " " . $retour->message_amende . " " . $retour->message_blocage; //$ok=0; //Attention, pour les deux lignes suivantes, cela dépend d'un paramètre NEDAP ou IDENT if ($protocol_prolonge) { $ok = 0; } } } $ret["OK"] = $ok; $ret["RESENSITIZE"] = $resensitize; $ret["MAGNETIC_MEDIA"] = $magnetic; $ret["ALERT"] = "N"; $ret["TRANSACTION_DATE"] = date("Ymd His", time()); $ret["INSTITUTION_ID"][0] = $localisation; $ret["ITEM_IDENTIFIER"][0] = $expl_cb; $ret["PERMANENT_LOCATION"][0] = $localisation; $ret["TITLE_IDENTIFIER"][0] = $titre; $ret["PATRON_IDENTIFIER"][0] = $empr_cb; return $ret; }
function self_checkin($expl_cb, $PMBUserId = -1) { global $selfservice_pret_expl_inconnu_msg; global $charset; $ok = 0; $titre = $expl_cb; $ret["status"] = ""; $ret["message"] = ""; $ret["message_loc"] = ""; $ret["message_resa"] = ""; $ret["message_retard"] = ""; $ret["message_amende"] = ""; $ret["message_blocage"] = ""; $ret["title"] = ""; $ret["transaction_date"] = ""; $ret["message_expl_comment"] = ""; $ret["message_expl_note"] = ""; $requete = "select expl_id,expl_bulletin,expl_notice,type_antivol,empr_cb from exemplaires join pret on (expl_id=pret_idexpl) join empr on (pret_idempr=id_empr) where expl_cb='" . addslashes($expl_cb) . "'"; $resultat = mysql_query($requete); if (!$resultat) { $ok = 0; if ($charset != "utf-8") { $ret["message"] = utf8_encode($selfservice_pret_expl_inconnu_msg); } else { $ret["message"] = $selfservice_pret_expl_inconnu_msg; } } else { $expl = mysql_fetch_object($resultat); $empr_cb = $expl->empr_cb; if ($expl->expl_bulletin) { $isbd = new bulletinage_display($expl->expl_bulletin); $titre = $isbd->display; } else { $isbd = new mono_display($expl->expl_notice, 1); $titre = $isbd->header_texte; } $retour = new expl_to_do($expl_cb); // Fonction qu effectue le retour d'un document $retour->do_retour_selfservice(); if ($retour->status == -1) { //Problème $ok = 0; } else { //Pas de problème $ok = 1; } if ($charset != "utf-8") { $ret["message_loc"] = utf8_encode($retour->message_loc); $ret["message_resa"] = utf8_encode($retour->message_resa); $ret["message_retard"] = utf8_encode($retour->message_retard); $ret["message_amende"] = utf8_encode($retour->message_amende); $ret["message_blocage"] = utf8_encode($retour->message_blocage); $ret["message_expl_comment"] = utf8_encode($retour->expl->expl_comment); $ret["message_expl_note"] = utf8_encode($retour->expl->expl_note); } else { $ret["message_loc"] = $retour->message_loc; $ret["message_resa"] = $retour->message_resa; $ret["message_retard"] = $retour->message_retard; $ret["message_amende"] = $retour->message_amende; $ret["message_blocage"] = $retour->message_blocage; $ret["message_expl_comment"] = utf8_encode($retour->expl->expl_comment); $ret["message_expl_note"] = utf8_encode($retour->expl->expl_note); } } $ret["status"] = $ok; $ret["transaction_date"] = date("Ymd His", time()); if ($charset != "utf-8") { $ret["title"] = utf8_encode($titre); } else { $ret["title"] = $titre; } return $ret; }