Commit 00c60ea2 authored by Thomas Hamel's avatar Thomas Hamel
Browse files

ajout des publications provenant de HAL, possibilité d'y associer des compétences rncp

parent 40259595
Loading
Loading
Loading
Loading
+80 −4
Changes for doc/release-notes/fiche_rncp/01_fiche_rncp.sql: 80 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -349,9 +349,83 @@ VALUES (

<div style="page-break-before: always;"></div>

<div class="informations_publications">
<h1>Publications</h1>
{% set publicationsGroupes = doctorant.getPublicationsHAL %}
{% set hasPublications = false %}

{% for key, publications in publicationsGroupes %}

    <h3 class="mt-4">{{ key }}</h3>

    <table class="table table-sm publications mb-4">
        <thead>
        <tr>
            <th>Titre</th>
            <th>Date</th>
            <th>Auteur(s)</th>
            <th>Éditeur</th>
            <th>Compétences RNCP</th>
        </tr>
        </thead>

        <tbody>
        {% if publications is not empty %}
            {% set hasPublications = true %}

            {% for item in publications %}
                {% set publication = item.publicationHAL %}
                <tr>
                    <td>{{ publication.getTitleFormatted }}</td>

                    <td>{{ publication.publicationDate }}</td>

                    <td>
                        {{ publication.getAuthFullNameFormatted
                            ?: ''<i>Auteur(s) inconnu(s)</i>''|raw }}
                    </td>

                    <td>
                        {{ publication.getPublisherFormatted
                            ?: ''<i>Éditeur(s) inconnu(s)</i>''|raw }}
                    </td>

                    <td>
                        {% if item.sousCompetences is not empty %}
                            <ul class="mb-0 ps-3">
                                {% for sc in item.sousCompetences %}
                                    <li>{{ sc.libelle }}</li>
                                {% endfor %}
                            </ul>
                        {% else %}
                            <span class="text-muted">Aucune</span>
                        {% endif %}
                    </td>
                </tr>
            {% endfor %}
        {% else %}
            <tr>
                <td colspan="6" class="text-muted text-center">
                    Aucune publication pour {{ key }}
                </td>
            </tr>
        {% endif %}
        </tbody>
    </table>

{% endfor %}

{% if not hasPublications %}
    <div class="text-muted text-center mt-3">
        Aucune publication trouvée
    </div>
{% endif %}

<div style="page-break-before: always;"></div>

<div class="informations_formations">
 <h1>Formations</h1>
 <h2>Formations suivies dans ESUP-SyGAL</h2>
 <h3>Formations suivies dans ESUP-SyGAL</h3>
<table class="table table-sm inscriptions-terminees mt-2">
    <thead>
    <tr>
@@ -430,7 +504,7 @@ VALUES (

<div style="page-break-before: always;"></div>

 <h2>Formations suivies à l''extérieur</h2>
 <h3>Formations suivies à l''extérieur</h3>
<table class="table table-sm formations-externes mt-2">
    <thead>
        <tr>
@@ -506,14 +580,16 @@ VALUES (
    </tbody>
</table>
</div>',
           '.formations-externes, .inscriptions-terminees {
           '.formations-externes, .inscriptions-terminees, .publications{
 border-collapse: collapse;  width: 100%; 
 }

.formations-externes th,
.formations-externes td,
.inscriptions-terminees th,
.inscriptions-terminees td {
.inscriptions-terminees td,
.publications th,
.publications td {
  border: 1px solid #000;
  padding: 8px;
}',
+45 −3
Changes for doc/release-notes/fiche_rncp/02_publications.sql: 45 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ create table if not exists public.publication_hal
    primary key,
    individu_id bigint,
    title_s               varchar(2048),
    auth_full_name_s        varchar(2048),
    auth_full_name_s        text,
    auth_id_hal_i        varchar(2048),
    publication_date_s     varchar(264),
    publisher_s           varchar(264),
@@ -93,7 +93,7 @@ create index publication_hal_source_idx

--Création de la vue src_publication_hal avec les infos de tmp_publication_hal
create or replace view src_publication_hal
            (id, source_code, source_id, title_s, auth_full_name_s, auth_id_hal_i, publication_date_s, doc_type_s, publisher_s, uri_s) as
            (id, source_code, source_id, individu_id, title_s, auth_full_name_s, auth_id_hal_i, publication_date_s, doc_type_s, publisher_s, uri_s) as
select NULL::bigint                                                 AS id,
       tmp.individu_hal_id||'_'||tmp.source_code                    as source_code,
       src.id                                                       AS source_id,
@@ -107,5 +107,47 @@ select NULL::bigint AS id,
       tmp.uri_s
FROM tmp_publication_hal tmp
         JOIN source src ON src.id = tmp.source_id
    join individu i on i.id_hal = tmp.individu_hal_id
    join individu i on trim(i.id_hal) = trim(tmp.individu_hal_id)
;

-- Transfert des ID_HAL de diffusion vers individu
WITH pick AS (
    SELECT DISTINCT ON (doc.individu_id)
    doc.individu_id,
    trim(d.hal_id)
FROM diffusion d
    JOIN these t       ON t.id = d.these_id
    JOIN doctorant doc ON doc.id = t.doctorant_id
WHERE d.hal_id IS NOT NULL AND d.hal_id not like ''
ORDER BY doc.individu_id, d.histo_modification DESC
    )
UPDATE individu i
SET id_hal = btrim(pick.hal_id)
    FROM pick
WHERE i.id = pick.individu_id
  AND i.id_hal IS NULL;

SELECT t.id, ind.id_hal
FROM these t
         LEFT JOIN doctorant doc ON doc.id = t.doctorant_id
         LEFT JOIN individu ind ON ind.id = doc.individu_id
WHERE ind.id_hal IS NOT NULL AND ind.id_hal not like '';

-- Privilèges
INSERT INTO unicaen_privilege_categorie (ID, CODE, LIBELLE, ORDRE)
SELECT nextval('categorie_privilege_id_seq'),
       'publicationhal',
       'Publication HAL',
       5009 WHERE NOT EXISTS (SELECT 1
                               FROM unicaen_privilege_categorie
                               WHERE CODE = 'publicationhal');

INSERT INTO public.unicaen_privilege_privilege (categorie_id, code, libelle, ordre)
VALUES ((SELECT id FROM unicaen_privilege_categorie WHERE code = 'publicationhal'), 'modifier', 'Modifier une publication HAL', 1);

select privilege__grant_privileges_to_profiles('publicationhal',
                                               ARRAY[
                                                   'modifier'
                                               ],
                                               ARRAY['ADMIN_TECH', 'BDD', 'GEST_ED']
);
 No newline at end of file
+17 −0
Changes for module/Doctorant/src/Doctorant/Renderer/DoctorantTemplateVariable.php: 17 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ class DoctorantTemplateVariable extends AbstractTemplateVariable
{
    private array $formationsExternes = [];
    private array $inscriptionsTerminees = [];
    private array $publicationsHAL = [];

    public function setDoctorant(Doctorant $doctorant): void
    {
@@ -27,6 +28,14 @@ class DoctorantTemplateVariable extends AbstractTemplateVariable
        $this->formationsExternes = $formationsExternes;
    }

    /**
     * @param array $publicationsHAL
     */
    public function setPublicationsHAL(array $publicationsHAL): void
    {
        $this->publicationsHAL = $publicationsHAL;
    }

    /**
     * @param array $inscriptionsTerminees
     */
@@ -144,4 +153,12 @@ class DoctorantTemplateVariable extends AbstractTemplateVariable
    {
        return $this->inscriptionsTerminees;
    }

    /**
     * @noinspection PhpUnused (il s'agit d'une méthode utilisée par les macros)
     */
    public function getPublicationsHAL(): array
    {
        return $this->publicationsHAL;
    }
}
+0 −1
Changes for module/Formation/src/Formation/Assertion/FormationExterne/FormationExterneAssertion.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,7 +3,6 @@
namespace Formation\Assertion\FormationExterne;

use Application\Assertion\AbstractAssertion;
use Application\Entity\Db\Role;
use Application\Service\UserContextServiceAwareInterface;
use Doctorant\Service\DoctorantServiceAwareTrait;
use Formation\Entity\Db\FormationExterne;
+4 −4
Changes for module/Formation/src/Formation/Service/Formation/FormationExterne/FormationExterneService.php: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -145,9 +145,9 @@ class FormationExterneService {
     *     sousCompetences: SousCompetence[]
     * }>
     */
    public function getFormationsExternesAvecAnneeUniv(array $formationsExternes, bool $sortByBlocCompetence = false): array
    public function composeFormationExterneAvecContexte(array $formationsExternes, bool $sortByBlocCompetence = false): array
    {
        $formationsExternesAvecAnneeUniv = [];
        $formationsExternesAvecContexte = [];
        /** @var FormationExterne $formationExterne */
        foreach ($formationsExternes as $formationExterne) {
            $premiereAnnee = null;
@@ -167,7 +167,7 @@ class FormationExterneService {
                    $formationExterne->getId()
                );

            $formationsExternesAvecAnneeUniv[] = array(
            $formationsExternesAvecContexte[] = array(
                'formationExterne' => $formationExterne,
                'anneeUniv' => $premiereAnnee ?? $this->anneeUnivService->courante()->getPremiereAnnee(),
                'validation' => $validation,
@@ -175,6 +175,6 @@ class FormationExterneService {
            );
        }

        return $formationsExternesAvecAnneeUniv;
        return $formationsExternesAvecContexte;
    }
}
 No newline at end of file
Loading