Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c1b40bf3 authored by CHEVILLARD Sylvain's avatar CHEVILLARD Sylvain
Browse files

Correction d'un bug visible avec la nouvelle interface de Koha

conduisant à cacher tous les codes-barre.

Ajout d'un message de log dans le journal de la console pour laisser une trace de ce qui est lu par le script.
parent 8574242f
No related branches found
No related tags found
No related merge requests found
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
// ==UserScript== // ==UserScript==
// @name koha_bibagos // @name koha_bibagos
// @namespace http://gitlab.inria.fr/ // @namespace http://gitlab.inria.fr/
// @version 3.0 // @version 4.0
// @description Personnaliser l'interface de Koha pour la BibAGOS // @description Personnaliser l'interface de Koha pour la BibAGOS
// @author Sylvain Chevillard // @author Sylvain Chevillard
// @match https://emprunts-agos-admin.inria.fr/* // @match https://emprunts-agos-admin.inria.fr/*
...@@ -48,6 +48,8 @@ ...@@ -48,6 +48,8 @@
var test = 0; var test = 0;
var i = 0; var i = 0;
var logmsg="";
while(!test) { while(!test) {
test = (L[i].innerText.search('Code à barres non trouvé')) >= 0; test = (L[i].innerText.search('Code à barres non trouvé')) >= 0;
i = i+1; i = i+1;
...@@ -61,12 +63,16 @@ ...@@ -61,12 +63,16 @@
for(const row of rows) { for(const row of rows) {
var content = row.querySelectorAll('td'); var content = row.querySelectorAll('td');
if (content.length >= 2) { if (content.length >= 2) {
var code_barre = content[1].innerText var code_barre = content[1].innerText.trim();
logmsg += "Lecture de |"+code_barre+"|";
if (code_barre.substr(0,3) != "SOP") { if (code_barre.substr(0,3) != "SOP") {
row.style = "display:none;"; row.style = "display:none;";
logmsg += " (rendu invisible)";
} }
logmsg += "\n";
} }
} }
console.log(logmsg);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment