From 025635adf471a3a57a174e6e238deee064bebc42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laurent=20L=C3=A9cluse?= <laurent.lecluse@unicaen.fr>
Date: Thu, 25 Jan 2024 10:04:17 +0100
Subject: [PATCH] =?UTF-8?q?Lien=20de=20doc=20pour=20les=20=C3=A9tudiants?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 data/parametres.php                                       | 3 +++
 module/Application/src/Controller/IndexController.php     | 5 +++--
 module/Application/src/Form/ParametresForm.php            | 8 ++++++++
 module/Application/view/application/index/index.phtml     | 2 +-
 .../Application/view/application/parametre/generaux.phtml | 5 +++++
 5 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/data/parametres.php b/data/parametres.php
index 20166b74fc..009bd0d64f 100644
--- a/data/parametres.php
+++ b/data/parametres.php
@@ -121,6 +121,9 @@ return [
     "doc-intervenant-permanents"                 => [
         "DESCRIPTION" => "URL de la documentation OSE pour les permanents",
     ],
+    "doc-intervenant-etudiants"                 => [
+        "DESCRIPTION" => "URL de la documentation OSE pour les étudiants",
+    ],
 
 
     /* Disciplines */
diff --git a/module/Application/src/Controller/IndexController.php b/module/Application/src/Controller/IndexController.php
index 9e2ad532f8..534f1153a7 100755
--- a/module/Application/src/Controller/IndexController.php
+++ b/module/Application/src/Controller/IndexController.php
@@ -32,8 +32,9 @@ class IndexController extends AbstractController
         $role = $this->serviceUserContext->getSelectedIdentityRole();
 
         $documentation = [
-            'vacataires' => $this->getServiceParametres()->get('doc-intervenant-vacataires'),
-            'permanents' => $this->getServiceParametres()->get('doc-intervenant-permanents'),
+            'E' => $this->getServiceParametres()->get('doc-intervenant-vacataires'),
+            'P' => $this->getServiceParametres()->get('doc-intervenant-permanents'),
+            'S' => $this->getServiceParametres()->get('doc-intervenant-etudiants'),
         ];
 
         $view = new ViewModel([
diff --git a/module/Application/src/Form/ParametresForm.php b/module/Application/src/Form/ParametresForm.php
index 8401b177f1..26ae3a5670 100755
--- a/module/Application/src/Form/ParametresForm.php
+++ b/module/Application/src/Form/ParametresForm.php
@@ -279,6 +279,14 @@ class ParametresForm extends AbstractForm
             ],
         ]);
 
+        $this->add([
+            'name'    => 'doc-intervenant-etudiants',
+            'type'    => 'Text',
+            'options' => [
+                'label' => 'Étudiants',
+            ],
+        ]);
+
         $this->add([
             'type'       => 'Select',
             'name'       => 'oseuser',
diff --git a/module/Application/view/application/index/index.phtml b/module/Application/view/application/index/index.phtml
index 183d4f5017..c9ea49f05d 100755
--- a/module/Application/view/application/index/index.phtml
+++ b/module/Application/view/application/index/index.phtml
@@ -42,7 +42,7 @@ $onlyIntervenant = $intervenant && (null == $context->getSelectedIdentityRole()-
 
 
                     /* Guide à télécharger... */
-                    $guideType = $intervenant->getStatut()->estVacataire() ? 'vacataires' : 'permanents';
+                    $guideType = $intervenant->getStatut()->getTypeIntervenant()->getCode();
                     if (!empty($documentation[$guideType])) {
                         echo $this->tag('div', ['class' => 'alert alert-info', 'style' => 'margin-top:1em', 'role' => 'alert'])->html(
                             'Un guide d\'utilisation de OSE vous est proposé. Vous pouvez le télécharger en suivant le lien ci-contre : '
diff --git a/module/Application/view/application/parametre/generaux.phtml b/module/Application/view/application/parametre/generaux.phtml
index 4e2b616854..3e6bc16090 100755
--- a/module/Application/view/application/parametre/generaux.phtml
+++ b/module/Application/view/application/parametre/generaux.phtml
@@ -312,6 +312,11 @@
                         <?= $this->formControlGroup($form->get('doc-intervenant-permanents')); ?>
                     </div>
                 </div>
+                <div class="row">
+                    <div class="col-md-6">
+                        <?= $this->formControlGroup($form->get('doc-intervenant-etudiants')); ?>
+                    </div>
+                </div>
             </div>
         </div>
 
-- 
GitLab