- {% for contact in contacts %}
+ {% for correspondant in correspondants %}
-
Contact
-
diff --git a/app/templates/entreprises/import_contacts.html b/app/templates/entreprises/import_contacts.html
deleted file mode 100644
index 292a0e9ff..000000000
--- a/app/templates/entreprises/import_contacts.html
+++ /dev/null
@@ -1,62 +0,0 @@
-{# -*- mode: jinja-html -*- #}
-{% extends 'base.html' %}
-{% import 'bootstrap/wtf.html' as wtf %}
-
-{% block styles %}
-{{super()}}
-{% endblock %}
-
-{% block app_content %}
-
Importation contacts
-
-
-
-
-
-
- (*) champs requis
-
- {{ wtf.quick_form(form, novalidate=True) }}
-
-
-
- {% if not contacts_import %}
-
- Attribut Type Description
- nom text nom du contact
- prenom text prenom du contact
- telephone text telephone du contact
- mail text mail du contact
- poste text poste du contact
- service text service dans lequel travaille le contact
- entreprise_siret integer SIRET de l'entreprise
-
- {% endif %}
-
- {% if contacts_import %}
-
Importation de {{ contacts_import|length }} contact(s)
- {% for contact in contacts_import %}
-
- {% endfor %}
- {% endif %}
-{% endblock %}
\ No newline at end of file
diff --git a/app/templates/entreprises/import_correspondants.html b/app/templates/entreprises/import_correspondants.html
new file mode 100644
index 000000000..cfbaf11a4
--- /dev/null
+++ b/app/templates/entreprises/import_correspondants.html
@@ -0,0 +1,62 @@
+{# -*- mode: jinja-html -*- #}
+{% extends 'base.html' %}
+{% import 'bootstrap/wtf.html' as wtf %}
+
+{% block styles %}
+{{super()}}
+{% endblock %}
+
+{% block app_content %}
+
Importation correspondants
+
+
+
+
+
+
+ (*) champs requis
+
+ {{ wtf.quick_form(form, novalidate=True) }}
+
+
+
+ {% if not correspondants_import %}
+
+ Attribut Type Description
+ nom text nom du correspondant
+ prenom text prenom du correspondant
+ telephone text telephone du correspondant
+ mail text mail du correspondant
+ poste text poste du correspondant
+ service text service dans lequel travaille le correspondant
+ entreprise_siret integer SIRET de l'entreprise
+
+ {% endif %}
+
+ {% if correspondants_import %}
+
Importation de {{ correspondants_import|length }} correspondant(s)
+ {% for correspondant in correspondants_import %}
+
+
+ Nom : {{ correspondant.nom }}
+ Prénom : {{ correspondant.prenom }}
+ {% if correspondant.telephone %}
+ Téléphone : {{ correspondant.telephone }}
+ {% endif %}
+ {% if correspondant.mail %}
+ Mail : {{ correspondant.mail }}
+ {% endif %}
+ {% if correspondant.poste %}
+ Poste : {{ correspondant.poste }}
+ {% endif %}
+ {% if correspondant.service %}
+ Service : {{ correspondant.service }}
+ {% endif %}
+
lien vers l'entreprise
+
+
+ {% endfor %}
+ {% endif %}
+{% endblock %}
\ No newline at end of file
diff --git a/app/templates/entreprises/nav.html b/app/templates/entreprises/nav.html
index e24211653..50bca6017 100644
--- a/app/templates/entreprises/nav.html
+++ b/app/templates/entreprises/nav.html
@@ -2,7 +2,7 @@
Entreprises
- Contacts
+ Correspondants
Offres reçues
{% if current_user.has_permission(current_user.Permission.RelationsEntreprisesValidate, None) %}
Entreprises à valider
diff --git a/app/templates/entreprises/offres_recues.html b/app/templates/entreprises/offres_recues.html
index e070ed505..c9ecd7e2f 100644
--- a/app/templates/entreprises/offres_recues.html
+++ b/app/templates/entreprises/offres_recues.html
@@ -17,7 +17,7 @@
Missions : {{ offre[1].missions }}
Durée : {{ offre[1].duree }}
- {% if offre[1].contact_id %}
+ {% if offre[1].correspondant_id %}
Contacté {{ offre[3].nom }} {{ offre[3].prenom }}
{% if offre[3].mail and offre[3].telephone %}
({{ offre[3].mail }} - {{ offre[3].telephone }})
diff --git a/migrations/versions/40ece1f74b7a_tables_module_gestion_relations_.py b/migrations/versions/72ae180645e5_tables_module_gestion_relations_.py
similarity index 96%
rename from migrations/versions/40ece1f74b7a_tables_module_gestion_relations_.py
rename to migrations/versions/72ae180645e5_tables_module_gestion_relations_.py
index 3afa6a87b..341e0207b 100644
--- a/migrations/versions/40ece1f74b7a_tables_module_gestion_relations_.py
+++ b/migrations/versions/72ae180645e5_tables_module_gestion_relations_.py
@@ -1,8 +1,8 @@
"""tables module gestion relations entreprises
-Revision ID: 40ece1f74b7a
+Revision ID: 72ae180645e5
Revises: b9aadc10227f
-Create Date: 2022-03-04 16:06:28.163870
+Create Date: 2022-03-28 21:40:35.426046
"""
from alembic import op
@@ -10,7 +10,7 @@ import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
-revision = "40ece1f74b7a"
+revision = "72ae180645e5"
down_revision = "b9aadc10227f"
branch_labels = None
depends_on = None
@@ -52,7 +52,7 @@ def upgrade():
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
- "are_contacts",
+ "are_correspondants",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("entreprise_id", sa.Integer(), nullable=True),
sa.Column("nom", sa.Text(), nullable=True),
@@ -67,7 +67,7 @@ def upgrade():
sa.PrimaryKeyConstraint("id"),
)
op.create_table(
- "are_etudiants",
+ "are_stages_apprentissages",
sa.Column("id", sa.Integer(), nullable=False),
sa.Column("entreprise_id", sa.Integer(), nullable=True),
sa.Column("etudid", sa.Integer(), nullable=True),
@@ -98,9 +98,9 @@ def upgrade():
sa.Column("duree", sa.Text(), nullable=True),
sa.Column("expiration_date", sa.Date(), nullable=True),
sa.Column("expired", sa.Boolean(), nullable=True),
- sa.Column("contact_id", sa.Integer(), nullable=True),
+ sa.Column("correspondant_id", sa.Integer(), nullable=True),
sa.ForeignKeyConstraint(
- ["contact_id"], ["are_contacts.id"], ondelete="cascade"
+ ["correspondant_id"], ["are_correspondants.id"], ondelete="cascade"
),
sa.ForeignKeyConstraint(
["entreprise_id"], ["are_entreprises.id"], ondelete="cascade"
@@ -194,28 +194,7 @@ def downgrade():
sa.PrimaryKeyConstraint("id", name="entreprises_pkey"),
postgresql_ignore_search_path=False,
)
- op.create_table(
- "entreprise_correspondant",
- sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
- sa.Column("entreprise_id", sa.INTEGER(), autoincrement=False, nullable=True),
- sa.Column("nom", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("prenom", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("civilite", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("fonction", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("phone1", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("phone2", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("mobile", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("mail1", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("mail2", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("fax", sa.TEXT(), autoincrement=False, nullable=True),
- sa.Column("note", sa.TEXT(), autoincrement=False, nullable=True),
- sa.ForeignKeyConstraint(
- ["entreprise_id"],
- ["entreprises.id"],
- name="entreprise_correspondant_entreprise_id_fkey",
- ),
- sa.PrimaryKeyConstraint("id", name="entreprise_correspondant_pkey"),
- )
+ op.create_index("ix_entreprises_dept_id", "entreprises", ["dept_id"], unique=False)
op.create_table(
"entreprise_contact",
sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
@@ -245,13 +224,34 @@ def downgrade():
),
sa.PrimaryKeyConstraint("id", name="entreprise_contact_pkey"),
)
- op.create_index("ix_entreprises_dept_id", "entreprises", ["dept_id"], unique=False)
+ op.create_table(
+ "entreprise_correspondant",
+ sa.Column("id", sa.INTEGER(), autoincrement=True, nullable=False),
+ sa.Column("entreprise_id", sa.INTEGER(), autoincrement=False, nullable=True),
+ sa.Column("nom", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("prenom", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("civilite", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("fonction", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("phone1", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("phone2", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("mobile", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("mail1", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("mail2", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("fax", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.Column("note", sa.TEXT(), autoincrement=False, nullable=True),
+ sa.ForeignKeyConstraint(
+ ["entreprise_id"],
+ ["entreprises.id"],
+ name="entreprise_correspondant_entreprise_id_fkey",
+ ),
+ sa.PrimaryKeyConstraint("id", name="entreprise_correspondant_pkey"),
+ )
op.drop_table("are_offre_departement")
op.drop_table("are_envoi_offre_etudiant")
op.drop_table("are_envoi_offre")
op.drop_table("are_offres")
- op.drop_table("are_etudiants")
- op.drop_table("are_contacts")
+ op.drop_table("are_stages_apprentissages")
+ op.drop_table("are_correspondants")
op.drop_table("are_preferences")
op.drop_table("are_logs")
op.drop_table("are_entreprises")