Commit bc2be88d authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Téléversement des rapports annuels : renommage en rapports d'activité (annuel...

Téléversement des rapports annuels : renommage en rapports d'activité (annuel ou de fin de thèse) ; création des privilèges *_TOUT et *_SIEN.
parent a47acbd6
Loading
Loading
Loading
Loading
+1 −0
Changes for CHANGELOG.md: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ Journal des modifications
- Changement du fonctionnement de sursis pour les soutenances : seul la validation acteur vérifie le délai de deux mois et le sursis annule cette vérification.
- Ajout d'une interface pour lier/délier des utilisateurs sans individu à un individu.
- Le rôle de co-directeur est maintenant un rôle attribué automatiquement
- Téléversement des rapports annuels : renommage en rapports d'activité (annuel ou de fin de thèse) ; création des privilèges *_TOUT et *_SIEN.
 
2.1.6
-----
+55 −1
Changes for doc/release-notes/v2.1.7.md: 55 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -15,4 +15,58 @@ git fetch --tags && git checkout --force 2.1.6 && bash ./install.sh

## 2. Dans la base de données

Rien
 No newline at end of file
```sql

--
-- Rapports d'activité
--

update NATURE_FICHIER set CODE = 'RAPPORT_ACTIVITE' where CODE = 'RAPPORT_ANNUEL' ;
create table TYPE_RAPPORT (
                            ID NUMBER not null constraint TYPE_RAPPORT_PK primary key,
                            CODE VARCHAR2(50 char) not null,
                            LIBELLE_COURT VARCHAR2(64 char) not null,
                            LIBELLE_LONG VARCHAR2(128 char) not null
) ;
create unique index TYPE_RAPPORT_UN on TYPE_RAPPORT (CODE) ;
insert into TYPE_RAPPORT (ID, CODE, LIBELLE_COURT, LIBELLE_LONG) VALUES (1, 'RAPPORT_ACTIVITE_ANNUEL', 'Annuel', 'Rapport d''activité annuel') ;
insert into TYPE_RAPPORT (ID, CODE, LIBELLE_COURT, LIBELLE_LONG) VALUES (2, 'RAPPORT_ACTIVITE_FINTHESE', 'Fin de thèse', 'Rapport d''activité de fin de thèse') ;
alter table RAPPORT_ANNUEL modify EST_FINAL default null ;
alter table RAPPORT_ANNUEL modify EST_FINAL null ;
alter table RAPPORT_ANNUEL add TYPE_RAPPORT_ID number ;
update RAPPORT_ANNUEL set TYPE_RAPPORT_ID = 1 where EST_FINAL = 0;
update RAPPORT_ANNUEL set TYPE_RAPPORT_ID = 2 where EST_FINAL = 1;
alter table RAPPORT_ANNUEL modify TYPE_RAPPORT_ID not null ;
alter table RAPPORT_ANNUEL add constraint RAPPORT_ANNUEL_TYPE_ID_FK foreign key (TYPE_RAPPORT_ID) references TYPE_RAPPORT ;
alter table RAPPORT_ANNUEL rename to RAPPORT ;

rename RAPPORT_ANNUEL_ID_SEQ to RAPPORT_ID_SEQ;

insert into CATEGORIE_PRIVILEGE (ID, CODE, LIBELLE, ORDRE) select CATEGORIE_PRIVILEGE_ID_SEQ.nextval, 'rapport-activite', 'Rapports d''activité', 23 from dual ;
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
with tmp(code, libelle, ordre) as (
  select 'lister-tout', 'Lister les rapports concernant toute thèse', 100 from dual union all
  select 'lister-sien', 'Lister les rapports concernant ses thèses', 200 from dual union all
  select 'televerser-tout', 'Téléverser un rapport concernant toute thèse', 300 from dual union all
  select 'televerser-sien', 'Téléverser un rapport concernant ses thèses', 400 from dual union all
  select 'supprimer-tout', 'Supprimer un rapport concernant toute thèse', 500 from dual union all
  select 'supprimer-sien', 'Supprimer un rapport concernant ses thèses', 600 from dual union all
  select 'telecharger-tout', 'Télécharger les rapports concernant toute thèse', 700 from dual union all
  select 'telecharger-sien', 'Télécharger les rapports concernant ses thèses', 800 from dual union all
  select 'telecharger-zip', 'Télécharger des rapports sous la forme d''une archive compressée (.zip)', 900 from dual union all
  select 'rechercher-tout', 'Rechercher des rapports concernant toute thèse', 1000 from dual union all
  select 'rechercher-sien', 'Rechercher des rapports concernant ses thèses', 1100 from dual
)
select privilege_id_seq.nextval, cp.id, tmp.code, tmp.libelle, tmp.ordre from tmp
join CATEGORIE_PRIVILEGE cp on cp.CODE = 'rapport-activite'
;
update PRIVILEGE set CATEGORIE_ID = (select id from CATEGORIE_PRIVILEGE where code = 'rapport-activite')
where CATEGORIE_ID = (select id from CATEGORIE_PRIVILEGE where code = 'rapport-annuel');
delete from CATEGORIE_PRIVILEGE where code = 'rapport-annuel';

update CATEGORIE_PRIVILEGE set ORDRE = 40 where code = 'validation' ;




```
+4 −4
Changes for module/Application/config/module.config.php: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@ namespace Application;
use Application\Assertion\AssertionAbstractFactory;
use Application\Cache\MemcachedFactory;
use Application\Controller\Factory\IndexControllerFactory;
use Application\Controller\Plugin\Forward;
use Application\Controller\Plugin\ForwardFactory;
use Application\Controller\Plugin\Uploader\UploaderPluginFactory;
use Application\Entity\Db\Repository\DefaultEntityRepository;
use Application\Event\UserAuthenticatedEventListenerFactory;
use Application\Event\UserRoleSelectedEventListener;
use Application\Form\Factory\EcoleDoctoraleFormFactory;
use Application\Navigation\NavigationFactoryFactory;
use Application\Search\Filter\Provider\SearchFilterProviderService;
use Application\Search\Filter\Provider\SearchFilterProviderServiceFactory;
use Application\Service\AuthorizeServiceAwareInitializer;
use Application\Service\Role\RoleService;
use Application\Service\Role\RoleServiceFactory;
@@ -220,7 +220,6 @@ return array(
            'Sygal\Memcached'                => MemcachedFactory::class,
            'RoleService' => RoleServiceFactory::class,
            SourceCodeStringHelper::class => SourceCodeStringHelperFactory::class,
            SearchFilterProviderService::class => SearchFilterProviderServiceFactory::class,
        ),
        'abstract_factories' => [
            AssertionAbstractFactory::class,
@@ -253,10 +252,11 @@ return array(
        'invokables' => [
        ],
        'factories' => [
            'forward'  => 'Application\Controller\Plugin\ForwardFactory',
            Forward::class => ForwardFactory::class,
            'uploader' => UploaderPluginFactory::class,
        ],
        'aliases' => [
            'forward' => Forward::class,
            'Uploader' => 'uploader',
        ],
        'initializers' => [
+81 −56
Changes for module/Application/config/others/rapports.config.php: 81 added lines, 56 removed lines.
Original line number Diff line number Diff line
@@ -2,18 +2,19 @@

namespace Application;

use Application\Controller\Factory\RapportAnnuelControllerFactory;
use Application\Controller\Factory\RapportAnnuelRechercheControllerFactory;
use Application\Controller\RapportAnnuelController;
use Application\Controller\RapportAnnuelRechercheController;
use Application\Form\Factory\RapportAnnuelFormFactory;
use Application\Form\RapportAnnuelForm;
use Application\Provider\Privilege\RapportAnnuelPrivileges;
use Application\Assertion\RapportActivite\RapportActiviteAssertion;
use Application\Controller\Factory\RapportActiviteControllerFactory;
use Application\Controller\Factory\RapportActiviteRechercheControllerFactory;
use Application\Controller\RapportActiviteController;
use Application\Controller\RapportActiviteRechercheController;
use Application\Form\Factory\RapportActiviteFormFactory;
use Application\Form\RapportActiviteForm;
use Application\Provider\Privilege\RapportPrivileges;
use Application\Search\Controller\SearchControllerPluginFactory;
use Application\Service\RapportAnnuel\RapportAnnuelSearchService;
use Application\Service\RapportAnnuel\RapportAnnuelSearchServiceFactory;
use Application\Service\RapportAnnuel\RapportAnnuelService;
use Application\Service\RapportAnnuel\RapportAnnuelServiceFactory;
use Application\Service\Rapport\RapportSearchService;
use Application\Service\Rapport\RapportSearchServiceFactory;
use Application\Service\Rapport\RapportService;
use Application\Service\Rapport\RapportServiceFactory;
use UnicaenAuth\Guard\PrivilegeController;
use UnicaenAuth\Provider\Rule\PrivilegeRuleProvider;

@@ -21,7 +22,7 @@ return [
    'bjyauthorize'    => [
        'resource_providers' => [
            'BjyAuthorize\Provider\Resource\Config' => [
                'RapportAnnuel' => [],
                'Rapport' => [],
            ],
        ],
        'rule_providers'     => [
@@ -29,12 +30,18 @@ return [
                'allow' => [
                    [
                        'privileges' => [
                            RapportAnnuelPrivileges::RAPPORT_ANNUEL_TELEVERSER,
                            RapportAnnuelPrivileges::RAPPORT_ANNUEL_TELECHARGER,
                            RapportAnnuelPrivileges::RAPPORT_ANNUEL_SUPPRIMER,
                            RapportPrivileges::RAPPORT_ACTIVITE_LISTER_TOUT,
                            RapportPrivileges::RAPPORT_ACTIVITE_LISTER_SIEN,
                            RapportPrivileges::RAPPORT_ACTIVITE_TELEVERSER_TOUT,
                            RapportPrivileges::RAPPORT_ACTIVITE_TELEVERSER_SIEN,
                            RapportPrivileges::RAPPORT_ACTIVITE_SUPPRIMER_SIEN,
                            RapportPrivileges::RAPPORT_ACTIVITE_SUPPRIMER_TOUT,
                            RapportPrivileges::RAPPORT_ACTIVITE_RECHERCHER_SIEN,
                            RapportPrivileges::RAPPORT_ACTIVITE_TELECHARGER_TOUT,
                            RapportPrivileges::RAPPORT_ACTIVITE_TELECHARGER_SIEN,
                        ],
                        'resources'  => ['RapportAnnuel'],
                        'assertion' => 'Assertion\\RapportAnnuel',
                        'resources'  => ['Rapport'],
                        'assertion' => 'Assertion\\RapportActivite', /** @see RapportActiviteAssertion */
                    ],
                ],
            ],
@@ -42,63 +49,78 @@ return [
        'guards' => [
            PrivilegeController::class => [
                [
                    'controller' => RapportAnnuelController::class,
                    'controller' => RapportActiviteController::class,
                    'action'     => [
                        'consulter',
                    ],
                    'privileges' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_CONSULTER,
                    'assertion' => 'Assertion\\RapportAnnuel',
                    'privileges' => [
                        RapportPrivileges::RAPPORT_ACTIVITE_LISTER_TOUT,
                        RapportPrivileges::RAPPORT_ACTIVITE_LISTER_SIEN,
                    ],
                    'assertion' => 'Assertion\\RapportActivite',
                ],
                [
                    'controller' => RapportAnnuelController::class,
                    'controller' => RapportActiviteController::class,
                    'action'     => [
                        'telecharger',
                    ],
                    'privileges' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_TELECHARGER,
                    'assertion' => 'Assertion\\RapportAnnuel',
                    'privileges' => [
                        RapportPrivileges::RAPPORT_ACTIVITE_TELECHARGER_TOUT,
                        RapportPrivileges::RAPPORT_ACTIVITE_TELECHARGER_SIEN,
                    ],
                    'assertion' => 'Assertion\\RapportActivite',
                ],
                [
                    'controller' => RapportAnnuelController::class,
                    'controller' => RapportActiviteController::class,
                    'action'     => [
                        'ajouter',
                    ],
                    'privileges' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_TELEVERSER,
                    'assertion' => 'Assertion\\RapportAnnuel',
                    'privileges' => [
                        RapportPrivileges::RAPPORT_ACTIVITE_TELEVERSER_TOUT,
                        RapportPrivileges::RAPPORT_ACTIVITE_TELEVERSER_SIEN,
                    ],
                    'assertion' => 'Assertion\\RapportActivite',
                ],
                [
                    'controller' => RapportAnnuelController::class,
                    'controller' => RapportActiviteController::class,
                    'action'     => [
                        'supprimer',
                    ],
                    'privileges' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_SUPPRIMER,
                    'assertion' => 'Assertion\\RapportAnnuel',
                    'privileges' => [
                        RapportPrivileges::RAPPORT_ACTIVITE_SUPPRIMER_TOUT,
                        RapportPrivileges::RAPPORT_ACTIVITE_SUPPRIMER_SIEN,
                    ],
                    'assertion' => 'Assertion\\RapportActivite',
                ],
                [
                    'controller' => RapportAnnuelRechercheController::class,
                    'controller' => RapportActiviteRechercheController::class,
                    'action'     => [
                        'index',
                        'filters',
                    ],
                    'privileges' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_RECHERCHER,
                    'privileges' => [
                        RapportPrivileges::RAPPORT_ACTIVITE_RECHERCHER_TOUT,
                        RapportPrivileges::RAPPORT_ACTIVITE_RECHERCHER_SIEN,
                    ],
                ],
                [
                    'controller' => RapportAnnuelRechercheController::class,
                    'controller' => RapportActiviteRechercheController::class,
                    'action'     => [
                        'telecharger-zip',
                    ],
                    'privileges' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_TELECHARGER_ZIP,
                    'privileges' => RapportPrivileges::RAPPORT_ACTIVITE_TELECHARGER_ZIP,
                ],
            ],
        ],
    ],
    'router' => [
        'routes' => [
            'rapport-annuel' => [
            'rapport-activite' => [
                'type'          => 'Literal',
                'options'       => [
                    'route' => '/rapport-annuel',
                    'route' => '/rapport-activite',
                    'defaults'      => [
                        'controller' => RapportAnnuelController::class,
                        'controller' => RapportActiviteController::class,
                    ],
                ],
                'may_terminate' => false,
@@ -108,7 +130,7 @@ return [
                        'options'       => [
                            'route' => '/recherche',
                            'defaults'      => [
                                'controller' => RapportAnnuelRechercheController::class,
                                'controller' => RapportActiviteRechercheController::class,
                            ],
                        ],
                        'may_terminate' => false,
@@ -137,7 +159,7 @@ return [
                                    'route' => '/telecharger-zip',
                                    'defaults' => [
                                        'action' => 'telecharger-zip',
                                        /* @see RapportAnnuelRechercheController::telechargerZipAction() */
                                        /* @see RapportActiviteRechercheController::telechargerZipAction() */
                                    ],
                                ],
                            ],
@@ -152,7 +174,7 @@ return [
                            ],
                            'defaults' => [
                                'action' => 'consulter',
                                /* @see RapportAnnuelController::consulterAction() */
                                /* @see RapportActiviteController::consulterAction() */
                            ],
                        ],
                    ],
@@ -165,33 +187,33 @@ return [
                            ],
                            'defaults' => [
                                'action' => 'ajouter',
                                /* @see RapportAnnuelController::ajouterAction() */
                                /* @see RapportActiviteController::ajouterAction() */
                            ],
                        ],
                    ],
                    'telecharger' => [
                        'type'          => 'Segment',
                        'options'       => [
                            'route' => '/telecharger/:rapportAnnuel',
                            'route' => '/telecharger/:rapport',
                            'constraints' => [
                                'rapportAnnuel' => '\d+',
                                'rapport' => '\d+',
                            ],
                            'defaults'      => [
                                'action' => 'telecharger',
                                /* @see RapportAnnuelController::telechargerAction() */
                                /* @see RapportActiviteController::telechargerAction() */
                            ],
                        ],
                    ],
                    'supprimer' => [
                        'type'        => 'Segment',
                        'options'     => [
                            'route' => '/supprimer/:rapportAnnuel',
                            'route' => '/supprimer/:rapport',
                            'constraints' => [
                                'rapportAnnuel' => '\d+',
                                'rapport' => '\d+',
                            ],
                            'defaults'    => [
                                'action' => 'supprimer',
                                /* @see RapportAnnuelController::supprimerAction() */
                                /* @see RapportActiviteController::supprimerAction() */
                            ],
                        ],
                    ],
@@ -205,12 +227,15 @@ return [
                'pages' => [
                    'admin' => [
                        'pages' => [
                            'rapport-annuel' => [
                                'label'    => 'Rapports annuels',
                                'route'    => 'rapport-annuel/recherche/index',
                            'rapport-activite' => [
                                'label'    => "Rapports d'activité",
                                'route'    => 'rapport-activite/recherche/index',
                                'order'    => 100,
                                'resource' => PrivilegeController::getResourceId(RapportAnnuelRechercheController::class, 'index'),
                                'privilege' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_RECHERCHER,
                                'resource' => PrivilegeController::getResourceId(RapportActiviteRechercheController::class, 'index'),
                                'privilege' => [
                                    RapportPrivileges::RAPPORT_ACTIVITE_RECHERCHER_TOUT,
                                    RapportPrivileges::RAPPORT_ACTIVITE_RECHERCHER_SIEN,
                                ],
                            ],
                        ],
                    ],
@@ -220,14 +245,14 @@ return [
    ],
    'service_manager' => [
        'factories' => [
            RapportAnnuelService::class => RapportAnnuelServiceFactory::class,
            RapportAnnuelSearchService::class => RapportAnnuelSearchServiceFactory::class,
            RapportService::class => RapportServiceFactory::class,
            RapportSearchService::class => RapportSearchServiceFactory::class,
        ],
    ],
    'controllers' => [
        'factories' => [
            RapportAnnuelController::class => RapportAnnuelControllerFactory::class,
            RapportAnnuelRechercheController::class => RapportAnnuelRechercheControllerFactory::class,
            RapportActiviteController::class => RapportActiviteControllerFactory::class,
            RapportActiviteRechercheController::class => RapportActiviteRechercheControllerFactory::class,
        ],
    ],
    'controller_plugins' => [
@@ -241,7 +266,7 @@ return [
        'invokables' => [
        ],
        'factories' => [
            RapportAnnuelForm::class => RapportAnnuelFormFactory::class,
            RapportActiviteForm::class => RapportActiviteFormFactory::class,
        ],
    ],
];
+8 −9
Changes for module/Application/config/others/these.config.php: 8 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@ use Application\Controller\Factory\TheseConsoleControllerFactory;
use Application\Controller\Factory\TheseControllerFactory;
use Application\Controller\Factory\TheseObserverControllerFactory;
use Application\Controller\Plugin\Url\UrlThesePluginFactory;
use Application\Controller\RapportAnnuelController;
use Application\Controller\RapportActiviteController;
use Application\Controller\TheseConsoleController;
use Application\Controller\TheseController;
use Application\Entity\Db\Diffusion;
@@ -21,7 +21,7 @@ use Application\Form\Factory\PointsDeVigilanceHydratorFactory;
use Application\Form\Factory\RdvBuHydratorFactory;
use Application\Form\Factory\RdvBuTheseDoctorantFormFactory;
use Application\Form\Factory\RdvBuTheseFormFactory;
use Application\Provider\Privilege\RapportAnnuelPrivileges;
use Application\Provider\Privilege\RapportPrivileges;
use Application\Provider\Privilege\ThesePrivileges;
use Application\Service\Acteur\ActeurService;
use Application\Service\Acteur\ActeurServiceFactory;
@@ -862,6 +862,7 @@ return [
                                'etape' => null,
                                'visible' => 'Assertion\\These',
                            ],

                            'divider-roadmap' => [
                                'label'    => null,
                                'uri' => '',
@@ -872,7 +873,6 @@ return [
                                'class' => 'divider',
                            ],


                            'points-de-vigilance' => [
                                'label'    => 'Points de vigilance',
                                'route'    => 'these/points-de-vigilance',
@@ -898,17 +898,16 @@ return [
                                'etape' => WfEtape::CODE_DEPOT_VERSION_ORIGINALE,
                                'visible' => 'Assertion\\These',
                            ],
                            'rapport-annuel' => [
                                'id'       => 'these-rapport-annuel',
                                'label'    => 'Rapports annuels',
                                'route'    => 'rapport-annuel/consulter',
                            'rapport-activite' => [
                                'id'       => 'these-rapport-activite',
                                'label'    => "Rapports d'activité",
                                'route'    => 'rapport-activite/consulter',
                                'withtarget' => true,
                                'paramsInject' => [
                                    'these',
                                ],
                                'icon' => 'glyphicon glyphicon-duplicate',
                                'resource' => PrivilegeController::getResourceId(RapportAnnuelController::class, 'consulter'),
                                'privilege' => RapportAnnuelPrivileges::RAPPORT_ANNUEL_CONSULTER,
                                'resource' => PrivilegeController::getResourceId(RapportActiviteController::class, 'consulter'),
                            ],

                            'divider-these' => [
Loading