Compare commits

...

3 Commits

7 changed files with 24 additions and 27 deletions

View File

@ -583,27 +583,6 @@ for dept in get_depts():
],
)
# add etape_apo2
check_field(
cnx,
"notes_formsemestre",
"etape_apo2",
["alter table notes_formsemestre add column etape_apo2 text"],
)
# add etape_apo3
check_field(
cnx,
"notes_formsemestre",
"etape_apo3",
["alter table notes_formsemestre add column etape_apo3 text"],
)
# add etape_apo4
check_field(
cnx,
"notes_formsemestre",
"etape_apo4",
["alter table notes_formsemestre add column etape_apo4 text"],
)
# add publish_incomplete
check_field(
cnx,

7
config/scodocutils.py Normal file → Executable file
View File

@ -9,6 +9,12 @@ import sys, os, psycopg2, glob, subprocess, traceback, time
sys.path.append("..")
# INSTANCE_HOME est nécessaire pour sco_utils.py
# note: avec le python 2.7 de Zope2, l'import de pyscopg2 change
# INSTANCE_HOME dans l'environnement !
# Ici on le fixe à la "bonne" valeur pour ScoDoc7.
os.environ["INSTANCE_HOME"] = "/opt/scodoc"
def log(msg):
sys.stdout.flush()
@ -26,6 +32,7 @@ if not SCODOC_VAR_DIR:
sys.exit(1)
SCODOC_LOGOS_DIR = os.environ.get("SCODOC_LOGOS_DIR", "")
def get_dept_cnx_str(dept):
"db cnx string for dept"
f = os.path.join(SCODOC_VAR_DIR, "config", "depts", dept + ".cfg")

View File

@ -89,7 +89,7 @@ def sidebar(context, REQUEST=None):
H.append(
"""<div class="box-chercheetud">Chercher étudiant:<br/>
<form id="form-chercheetud" action="%(ScoURL)s/search_etud_in_dept">
<div><input type="text" size="12" id="in-expnom" name="expnom"></input></div>
<div><input type="text" size="12" id="in-expnom" name="expnom" spellcheck="false"></input></div>
</form></div>
<div class="etud-insidebar">
"""

View File

@ -99,8 +99,7 @@ function get_semestre_info($sem, $dept) {
// Renvoi les informations détaillées d'un semestre
// Ne nécessite pas d'authentification avec sco_user et sco_pw - Il est possible de choisir le format XML ou JSON.
// formsemestre_list
// Paramètres (tous optionnels): formsesmestre_id, formation_id, etape_apo, etape_apo2
// Coquille dans la doc : formsesmestre_id
// Paramètres (tous optionnels): formsemestre_id, formation_id, etape_apo
// Résultat: liste des semestres correspondant.
// Exemple: formsemestre_list?format=xml&etape_apo=V1RT
global $sco_pw;

View File

@ -35,6 +35,18 @@ CREATE FUNCTION notes_newid_etud( text ) returns text as '
as result;
' language SQL;
-- Fonction pour anonymisation:
-- inspirée par https://www.simononsoftware.com/random-string-in-postgresql/
CREATE FUNCTION random_text_md5( integer ) returns text
LANGUAGE SQL
AS $$
select upper( substring( (SELECT string_agg(md5(random()::TEXT), '')
FROM generate_series(
1,
CEIL($1 / 32.)::integer)
), 1, $1) );
$$;
-- Preferences
CREATE TABLE sco_prefs (
pref_id text DEFAULT notes_newid('PREF'::text) UNIQUE NOT NULL,

View File

@ -130,7 +130,7 @@ def index_html(context, REQUEST=None, showcodes=0, showsemtable=0):
H.append(
"""<p><form action="Notes/view_formsemestre_by_etape">
Chercher étape courante: <input name="etape_apo" type="text" size="8"></input>
Chercher étape courante: <input name="etape_apo" type="text" size="8" spellcheck="false"></input>
</form
</p>
"""

View File

@ -58,7 +58,7 @@ def form_search_etud(
H.append(
"""<form action="search_etud_in_dept" method="POST">
<b>%s</b>
<input type="text" name="expnom" width=12 value="">
<input type="text" name="expnom" width="12" spellcheck="false" value="">
<input type="submit" value="Chercher">
<br/>(entrer une partie du nom)
"""
@ -294,7 +294,7 @@ def form_search_etud_in_accessible_depts(context, REQUEST):
return ""
return """<form action="table_etud_in_accessible_depts" method="POST">
<b>Chercher étudiant:</b>
<input type="text" name="expnom" width=12 value="">
<input type="text" name="expnom" width="12" spellcheck="false" value="">
<input type="submit" value="Chercher">
<br/>(entrer une partie du nom ou le code NIP, cherche dans tous les départements autorisés)
"""