Commit bf1515d0 authored by Jean-Philippe Metivier's avatar Jean-Philippe Metivier
Browse files

version initiale de l'intervention : reste bouger la justificatif liste et les indexs (facultatifs)

parent 524ecf2d
Loading
Loading
Loading
Loading
+82 −0
Changes for doc/release-notes/intervention.md: 82 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Version 2.X.X

## 1. Sur le serveur d'application
  
- Placez-vous dans le répertoire de l'application puis lancez la commande suivante 
pour installer la nouvelle version :

```bash
git fetch --tags && git checkout --force 2.X.X && bash ./install.sh
```

- Selon le moteur PHP que vous avez installé, rechargez le service, exemple :
  - php7.3-fpm         : `service php7.3-fpm reload`
  - apache2-mod-php7.3 : `service apache2 reload`

## 2. Dans la base de données

```sql
create table SOUTENANCE_INTERVENTION
(
    ID NUMBER not null,
    THESE_ID NUMBER not null
        constraint SINTERVENTION_THESE_ID_FK
            references THESE,
    TYPE_INTERVENTION NUMBER not null,
    HISTO_CREATION DATE not null,
    HISTO_CREATEUR_ID NUMBER not null
        constraint SINTERVENTION_USERC_ID_FK
            references UTILISATEUR,
    HISTO_MODIFICATION DATE,
    HISTO_MODIFICATEUR_ID NUMBER
        constraint SINTERVENTION_USERM_ID_FK
            references UTILISATEUR,
    HISTO_DESTRUCTION DATE,
    HISTO_DESTRUCTEUR_ID NUMBER
        constraint SINTERVENTION_USERD_ID_FK
            references UTILISATEUR
)
/

create unique index SINTERVENTION_ID_UINDEX
    on SOUTENANCE_INTERVENTION (ID)
/

alter table SOUTENANCE_INTERVENTION
    add constraint SOUTENANCE_INTERVENTION_PK
        primary key (ID)
/

create sequence SOUTENANCE_INTERVENTION_ID_seq;

insert into CATEGORIE_PRIVILEGE (ID, CODE, LIBELLE, ORDRE) VALUES (CATEGORIE_PRIVILEGE_ID_SEQ.nextval, 'soutenance_intervention', 'Intervention sur les soutenances', 102);
insert into PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_ID_SEQ.nextval, CATEGORIE_PRIVILEGE_ID_SEQ.currval, 'intervention_index', 'Afficher la liste des interventions', 10);
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 4);  --MDD
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 6);  --Admin
insert into PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_ID_SEQ.nextval, CATEGORIE_PRIVILEGE_ID_SEQ.currval, 'intervention_afficher', 'Afficher une intervention', 20);
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 4);  --MDD
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 6);  --Admin
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 9);  --Directeur
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 10); --CoDirecteur
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 7);  --Doctorant
insert into PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_ID_SEQ.nextval, CATEGORIE_PRIVILEGE_ID_SEQ.currval, 'intervention_modifier', 'Déclarer/Modifier une intervention', 30);
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 4); --MDD
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 6); --Admin
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 9); --Directeur

insert into CATEGORIE_PRIVILEGE (ID, CODE, LIBELLE, ORDRE) VALUES (CATEGORIE_PRIVILEGE_ID_SEQ.nextval, 'soutenance_justificatif', 'Justificatifs associés à la soutenance', 102);
insert into PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_ID_SEQ.nextval, CATEGORIE_PRIVILEGE_ID_SEQ.currval, 'justificatif_index ', 'Index des justificatifs', 10);
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 6); --Admin
insert into PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_ID_SEQ.nextval, CATEGORIE_PRIVILEGE_ID_SEQ.currval, 'justificatif_ajouter', 'Ajouter un justificatif la liste des interventions', 20);
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 6);  --Admin
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 9);  --Directeur
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 10); --CoDirecteur
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 7);  --Doctorant
insert into PRIVILEGE (ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE) VALUES (PRIVILEGE_ID_SEQ.nextval, CATEGORIE_PRIVILEGE_ID_SEQ.currval, 'justificatif_retirer', 'Retirer un justificatif la liste des interventions', 30);
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 6);  --Admin
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 9);  --Directeur
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 10); --CoDirecteur
insert into PROFIL_PRIVILEGE (PRIVILEGE_ID, PROFIL_ID) VALUES (PRIVILEGE_ID_SEQ.currval, 7);  --Doctorant

-- TODO reappliquer les profil
```
 No newline at end of file
+4 −0
Changes for module/Application/src/Application/Service/These/Factory/TheseServiceFactory.php: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Application\Service\These\Factory;

use Application\Service\Acteur\ActeurService;
use Application\Service\Etablissement\EtablissementService;
use Application\Service\FichierThese\FichierTheseService;
use Application\Service\File\FileService;
@@ -27,6 +28,7 @@ class TheseServiceFactory
    public function __invoke(ContainerInterface $container)
    {
        /**
         * @var ActeurService       $acteurService
         * @var ValidationService   $validationService
         * @var NotifierService     $notifierService
         * @var FichierTheseService $fichierTheseService
@@ -36,6 +38,7 @@ class TheseServiceFactory
         * @var UtilisateurService  $utilisateurService
         * @var AuthorizeService    $authorizeService
         */
        $acteurService = $container->get(ActeurService::class);
        $validationService = $container->get('ValidationService');
        $notifierService = $container->get(NotifierService::class);
        $fichierTheseService = $container->get('FichierTheseService');
@@ -52,6 +55,7 @@ class TheseServiceFactory
        $fileService = $container->get(FileService::class);

        $service = new TheseService();
        $service->setActeurService($acteurService);
        $service->setValidationService($validationService);
        $service->setNotifierService($notifierService);
        $service->setFichierTheseService($fichierTheseService);
+43 −0
Changes for module/Application/src/Application/Service/These/TheseService.php: 43 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Application\Controller\FichierTheseController;
use Application\Entity\Db\Acteur;
use Application\Entity\Db\Attestation;
use Application\Entity\Db\Diffusion;
use Application\Entity\Db\Individu;
use Application\Entity\Db\MetadonneeThese;
use Application\Entity\Db\NatureFichier;
use Application\Entity\Db\RdvBu;
@@ -16,6 +17,7 @@ use Application\Entity\Db\VersionFichier;
use Application\Notification\ValidationRdvBuNotification;
use Application\Rule\AutorisationDiffusionRule;
use Application\Rule\SuppressionAttestationsRequiseRule;
use Application\Service\Acteur\ActeurServiceAwareTrait;
use Application\Service\AuthorizeServiceAwareTrait;
use Application\Service\BaseService;
use Application\Service\Etablissement\EtablissementServiceAwareTrait;
@@ -54,6 +56,7 @@ class TheseService extends BaseService implements ListenerAggregateInterface
    use EtablissementServiceAwareTrait;
    use FileServiceAwareTrait;
    use AuthorizeServiceAwareTrait;
    use ActeurServiceAwareTrait;

    /**
     * Resaisir l'autorisation de diffusion ? Sinon celle saisie au 1er dépôt est reprise/dupliquée.
@@ -681,4 +684,44 @@ EOS;
            }
        }
    }

    /** PREDICATS *****************************************************************************************************/

    /**
     * @param These $these
     * @param Individu $individu
     * @return bool
     */
    public function isDoctorant(These $these, Individu $individu) : bool
    {
        return ($these->getDoctorant()->getIndividu() === $individu);
    }

    /**
     * @param These $these
     * @param Individu $individu
     * @return bool
     */
    public function isDirecteur(These $these, Individu $individu) : bool
    {
        $directeurs = $this->getActeurService()->getRepository()->findActeursByTheseAndRole($these, 'D');
        foreach ($directeurs as $directeur) {
            if ($directeur->getIndividu() === $individu) return true;
        }
        return false;
    }

    /**
     * @param These $these
     * @param Individu $individu
     * @return bool
     */
    public function isCoDirecteur(These $these, Individu $individu) : bool
    {
        $directeurs = $this->getActeurService()->getRepository()->findActeursByTheseAndRole($these, 'K');
        foreach ($directeurs as $directeur) {
            if ($directeur->getIndividu() === $individu) return true;
        }
        return false;
    }
}
 No newline at end of file
+1 −0
Changes for module/Soutenance/config/module.config.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ use Doctrine\DBAL\Driver\OCI8\Driver as OCI8;
use Doctrine\ORM\Mapping\Driver\XmlDriver;
use Soutenance\Controller\AvisController;
use Soutenance\Controller\EngagementImpartialiteController;
use Soutenance\Controller\InterventionController;
use Soutenance\Provider\Privilege\PresoutenancePrivileges;
use Soutenance\Provider\Privilege\PropositionPrivileges;
use Soutenance\Service\Membre\MembreService;
+159 −0
Changes for module/Soutenance/config/others/intervention.config.php: 159 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

namespace Soutenance;

use Soutenance\Assertion\InterventionAssertion;
use Soutenance\Assertion\InterventionAssertionFactory;
use Soutenance\Controller\InterventionController;
use Soutenance\Controller\InterventionControllerFactory;
use Soutenance\Provider\Privilege\InterventionPrivileges;
use Soutenance\Service\Intervention\InterventionService;
use Soutenance\Service\Intervention\InterventionServiceFactory;
use UnicaenAuth\Guard\PrivilegeController;
use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider;
use Zend\Router\Http\Segment;

return [
    'bjyauthorize' => [
        'resource_providers' => [
            'BjyAuthorize\Provider\Resource\Config' => [
                'Acteur' => [],
            ],
        ],
        'rule_providers' => [
            PrivilegeRuleProvider::class => [
                'allow' => [
                    [
                        'privileges' => [
                            InterventionPrivileges::INTERVENTION_AFFICHER,
                            InterventionPrivileges::INTERVENTION_MODIFIER,
                        ],
                        'resources' => ['These'],
                        'assertion' => InterventionAssertion::class,
                    ],
                ],
            ],
        ],
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => InterventionController::class,
                    'action' => [
                        'index',
                    ],
                    'privileges' => InterventionPrivileges::INTERVENTION_INDEX,
                ],
                [
                    'controller' => InterventionController::class,
                    'action' => [
                        'afficher',
                    ],
                    'privileges' => InterventionPrivileges::INTERVENTION_AFFICHER,
                ],
                [
                    'controller' => InterventionController::class,
                    'action' => [
                        'toggle-president-distanciel',
                    ],
                    'privileges' => InterventionPrivileges::INTERVENTION_MODIFIER,
                ],
            ],
        ],
    ],

    'navigation' => [
        'default' => [
            'home' => [
                'pages' => [
                    'soutenance' => [
                        'pages' => [
                            'intervention' => [
                                'label' => 'Intervention de soutenance',
                                'route' => 'soutenance/intervention/afficher',
                                'order' => 600,
                                'resource' => InterventionPrivileges::getResourceId(InterventionPrivileges::INTERVENTION_AFFICHER),
                                'withtarget' => true,
                                'paramsInject' => [
                                    'these',
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'router' => [
        'routes' => [
            'soutenance' => [
                'child_routes' => [
                    'intervention' => [
                        'type' => Segment::class,
                        'may_terminate' => true,
                        'options' => [
                            'route' => '/intervention',
                            'defaults' => [
                                'controller' => InterventionController::class,
                                'action' => 'index',
                            ],
                        ],
                        'child_routes' => [
                            'afficher' => [
                                'type' => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route' => '/afficher/:these',
                                    'defaults' => [
                                        'controller' => InterventionController::class,
                                        'action' => 'afficher',
                                    ],
                                ],
                            ],
                            'toggle-president-distanciel' => [
                                'type' => Segment::class,
                                'may_terminate' => true,
                                'options' => [
                                    'route' => '/toggle-president-distanciel/:these',
                                    'defaults' => [
                                        'controller' => InterventionController::class,
                                        'action' => 'toggle-president-distanciel',
                                    ],
                                ],
                            ],
                        ],
                    ],
                ],
            ],
        ],
    ],

    'service_manager' => [
        'factories' => [
            InterventionAssertion::class => InterventionAssertionFactory::class,
            InterventionService::class => InterventionServiceFactory::class,
        ],
    ],
    'controllers' => [
        'factories' => [
            InterventionController::class => InterventionControllerFactory::class,
        ],
    ],

    'form_elements' => [
        'factories' => [
        ],
    ],

    'hydrators' => [
        'invokables' => [
        ],
        'factories' => [
        ],
    ],

    'view_helpers' => [
        'invokables' => [
        ],
    ],
];
 No newline at end of file
Loading