forked from ScoDoc/ScoDoc
lien vers fiche etudiant (stage ou alternance), refonte import export entreprises
This commit is contained in:
parent
259b2a449d
commit
8e95996930
@ -68,6 +68,13 @@ def get_dept_id_by_acronym(acronym):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def get_dept_acronym_by_id(id):
|
||||||
|
dept = Departement.query.filter_by(id=id).first()
|
||||||
|
if dept is not None:
|
||||||
|
return dept.acronym
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def check_offre_depts(depts, offre_depts):
|
def check_offre_depts(depts, offre_depts):
|
||||||
"""
|
"""
|
||||||
Retourne vrai si l'utilisateur a le droit de visibilité sur l'offre
|
Retourne vrai si l'utilisateur a le droit de visibilité sur l'offre
|
||||||
|
@ -1323,10 +1323,14 @@ def json_etudiants():
|
|||||||
content = {
|
content = {
|
||||||
"id": f"{etudiant.id}",
|
"id": f"{etudiant.id}",
|
||||||
"value": value,
|
"value": value,
|
||||||
"info": f"{etudiant.inscription_courante().formsemestre.titre}",
|
"info": f"Département {are.get_dept_acronym_by_id(etudiant.dept_id)} - {etudiant.inscription_courante().formsemestre.titre}",
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
content = {"id": f"{etudiant.id}", "value": value}
|
content = {
|
||||||
|
"id": f"{etudiant.id}",
|
||||||
|
"value": value,
|
||||||
|
"info": f"Département {are.get_dept_acronym_by_id(etudiant.dept_id)}",
|
||||||
|
}
|
||||||
list.append(content)
|
list.append(content)
|
||||||
return jsonify(results=list)
|
return jsonify(results=list)
|
||||||
|
|
||||||
@ -1352,7 +1356,7 @@ def json_responsables():
|
|||||||
for responsable in responsables:
|
for responsable in responsables:
|
||||||
content = {}
|
content = {}
|
||||||
value = f"{responsable.get_nomplogin()}"
|
value = f"{responsable.get_nomplogin()}"
|
||||||
content = {"id": f"{responsable.id}", "value": value, "info": ""}
|
content = {"id": f"{responsable.id}", "value": value}
|
||||||
list.append(content)
|
list.append(content)
|
||||||
return jsonify(results=list)
|
return jsonify(results=list)
|
||||||
|
|
||||||
@ -1386,7 +1390,7 @@ def get_import_entreprises_file_sample():
|
|||||||
"""
|
"""
|
||||||
Permet de récupérer un fichier exemple vide pour pouvoir importer des entreprises
|
Permet de récupérer un fichier exemple vide pour pouvoir importer des entreprises
|
||||||
"""
|
"""
|
||||||
keys = [
|
entreprises_titles = [
|
||||||
"siret",
|
"siret",
|
||||||
"nom_entreprise",
|
"nom_entreprise",
|
||||||
"adresse",
|
"adresse",
|
||||||
@ -1394,9 +1398,39 @@ def get_import_entreprises_file_sample():
|
|||||||
"code_postal",
|
"code_postal",
|
||||||
"pays",
|
"pays",
|
||||||
]
|
]
|
||||||
titles = keys[:]
|
sites_titles = [
|
||||||
|
"siret_entreprise",
|
||||||
|
"nom_site",
|
||||||
|
"adresse",
|
||||||
|
"ville",
|
||||||
|
"code_postal",
|
||||||
|
"pays",
|
||||||
|
]
|
||||||
title = "ImportEntreprises"
|
title = "ImportEntreprises"
|
||||||
xlsx = sco_excel.excel_simple_table(titles=titles, sheet_name="Entreprises")
|
wb = sco_excel.ScoExcelBook()
|
||||||
|
ws1 = wb.create_sheet("Entreprises")
|
||||||
|
ws1.append_row(
|
||||||
|
[
|
||||||
|
ws1.make_cell(it, style, comment)
|
||||||
|
for (it, style, comment) in zip(
|
||||||
|
entreprises_titles,
|
||||||
|
[sco_excel.excel_make_style(bold=True)] * len(entreprises_titles),
|
||||||
|
[None] * len(entreprises_titles),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
ws2 = wb.create_sheet("Sites")
|
||||||
|
ws2.append_row(
|
||||||
|
[
|
||||||
|
ws2.make_cell(it, style, comment)
|
||||||
|
for (it, style, comment) in zip(
|
||||||
|
sites_titles,
|
||||||
|
[sco_excel.excel_make_style(bold=True)] * len(sites_titles),
|
||||||
|
[None] * len(sites_titles),
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
xlsx = wb.generate()
|
||||||
filename = title
|
filename = title
|
||||||
return scu.send_file(xlsx, filename, scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE)
|
return scu.send_file(xlsx, filename, scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE)
|
||||||
|
|
||||||
@ -1487,7 +1521,7 @@ def export_correspondants():
|
|||||||
correspondants = (
|
correspondants = (
|
||||||
db.session.query(EntrepriseCorrespondant)
|
db.session.query(EntrepriseCorrespondant)
|
||||||
.join(Entreprise, EntrepriseCorrespondant.entreprise_id == Entreprise.id)
|
.join(Entreprise, EntrepriseCorrespondant.entreprise_id == Entreprise.id)
|
||||||
.filter_by(visible=True)
|
.filter_by(visible=True, active=True)
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
if correspondants:
|
if correspondants:
|
||||||
@ -1523,7 +1557,7 @@ def get_import_correspondants_file_sample():
|
|||||||
"""
|
"""
|
||||||
Permet de récupérer un fichier exemple vide pour pouvoir importer des correspondants
|
Permet de récupérer un fichier exemple vide pour pouvoir importer des correspondants
|
||||||
"""
|
"""
|
||||||
keys = [
|
titles = [
|
||||||
"civilite",
|
"civilite",
|
||||||
"nom",
|
"nom",
|
||||||
"prenom",
|
"prenom",
|
||||||
@ -1535,7 +1569,6 @@ def get_import_correspondants_file_sample():
|
|||||||
"notes",
|
"notes",
|
||||||
"entreprise_siret",
|
"entreprise_siret",
|
||||||
]
|
]
|
||||||
titles = keys[:]
|
|
||||||
title = "ImportCorrespondants"
|
title = "ImportCorrespondants"
|
||||||
xlsx = sco_excel.excel_simple_table(titles=titles, sheet_name="Correspondants")
|
xlsx = sco_excel.excel_simple_table(titles=titles, sheet_name="Correspondants")
|
||||||
filename = title
|
filename = title
|
||||||
|
@ -59,14 +59,19 @@
|
|||||||
margin-bottom: -5px;
|
margin-bottom: -5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.entreprise, .correspondant, .offre, .site{
|
.entreprise, .correspondant, .offre, .site, .info-active {
|
||||||
border: solid 2px;
|
border: solid 2px black;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.info-active {
|
||||||
|
border-color: red;
|
||||||
|
background-color: rgb(250, 220, 220);
|
||||||
|
}
|
||||||
|
|
||||||
.entreprise {
|
.entreprise {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
@ -26,6 +26,15 @@
|
|||||||
<div class="container fiche-entreprise">
|
<div class="container fiche-entreprise">
|
||||||
<h2>Fiche entreprise - {{ entreprise.nom }} ({{ entreprise.siret }})</h2>
|
<h2>Fiche entreprise - {{ entreprise.nom }} ({{ entreprise.siret }})</h2>
|
||||||
|
|
||||||
|
{% if not entreprise.active %}
|
||||||
|
<div class="info-active">
|
||||||
|
La fiche entreprise est désactivée<br>
|
||||||
|
{% if entreprise.notes_active != "" %}
|
||||||
|
Notes : {{ entreprise.notes_active }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="entreprise">
|
<div class="entreprise">
|
||||||
<div>
|
<div>
|
||||||
SIRET : {{ entreprise.siret }}<br>
|
SIRET : {{ entreprise.siret }}<br>
|
||||||
@ -141,7 +150,7 @@
|
|||||||
<td>{{ data[0].date_fin.strftime('%d/%m/%Y') }}</td>
|
<td>{{ data[0].date_fin.strftime('%d/%m/%Y') }}</td>
|
||||||
<td>{{ (data[0].date_fin-data[0].date_debut).days//7 }} semaines</td>
|
<td>{{ (data[0].date_fin-data[0].date_debut).days//7 }} semaines</td>
|
||||||
<td>{{ data[0].type_offre }}</td>
|
<td>{{ data[0].type_offre }}</td>
|
||||||
<td>{{ data[1].nom|format_nom }} {{ data[1].prenom|format_prenom }}</td>
|
<td><a href="{{ url_for('scolar.ficheEtud', scodoc_dept=data[1].dept_id|get_dept_acronym, etudid=data[0].etudid) }}">{{ data[1].nom|format_nom }} {{ data[1].prenom|format_prenom }}</a></td>
|
||||||
<td>{% if data[0].formation_text %}{{ data[0].formation_text }}{% endif %}</td>
|
<td>{% if data[0].formation_text %}{{ data[0].formation_text }}{% endif %}</td>
|
||||||
<td>{{ data[0].notes }}</td>
|
<td>{{ data[0].notes }}</td>
|
||||||
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesChange, None) %}
|
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesChange, None) %}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if not entreprises_import %}
|
{% if not entreprises_import %}
|
||||||
|
<div>Feuille Entreprises</div>
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead><tr><td><b>Attribut</b></td><td><b>Type</b></td><td><b>Description</b></td></tr></thead>
|
<thead><tr><td><b>Attribut</b></td><td><b>Type</b></td><td><b>Description</b></td></tr></thead>
|
||||||
<tr><td>siret</td><td>text</td><td>siret de l'entreprise</td></tr>
|
<tr><td>siret</td><td>text</td><td>siret de l'entreprise</td></tr>
|
||||||
@ -32,6 +33,16 @@
|
|||||||
<tr><td>code_postal</td><td>text</td><td>code postal de l'entreprise</td></tr>
|
<tr><td>code_postal</td><td>text</td><td>code postal de l'entreprise</td></tr>
|
||||||
<tr><td>pays</td><td>text</td><td>pays de l'entreprise</td></tr>
|
<tr><td>pays</td><td>text</td><td>pays de l'entreprise</td></tr>
|
||||||
</table>
|
</table>
|
||||||
|
<div>Feuille Sites</div>
|
||||||
|
<table class="table">
|
||||||
|
<thead><tr><td><b>Attribut</b></td><td><b>Type</b></td><td><b>Description</b></td></tr></thead>
|
||||||
|
<tr><td>siret_entreprise</td><td>text</td><td>siret de l'entreprise</td></tr>
|
||||||
|
<tr><td>nom_site</td><td>text</td><td>nom du site</td></tr>
|
||||||
|
<tr><td>adresse</td><td>text</td><td>adresse du site</td></tr>
|
||||||
|
<tr><td>ville</td><td>text</td><td>ville du site</td></tr>
|
||||||
|
<tr><td>code_postal</td><td>text</td><td>code postal du site</td></tr>
|
||||||
|
<tr><td>pays</td><td>text</td><td>pays du site</td></tr>
|
||||||
|
</table>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if entreprises_import %}
|
{% if entreprises_import %}
|
||||||
|
Loading…
Reference in New Issue
Block a user