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

Correction du paginator pour les fichiers communs

parent cddfbb85
Loading
Loading
Loading
Loading
+196 −0
Changes for doc/release-notes/v2.1.7.md: 196 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Version 2.1.6

## 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.1.6 && 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
--
-- Ajout d'une colonne pour ne pas afficher certaines origines de financement (ex: handicap)
--
alter table ORIGINE_FINANCEMENT add VISIBLE smallint default 1 not null;

--
-- Rétablissement de l'import des origines de financement.
--
create or replace view SRC_ORIGINE_FINANCEMENT as
select NULL                 AS id,
       tmp.SOURCE_CODE      AS SOURCE_CODE,
       src.ID               AS SOURCE_ID,
       COD_OFI              as CODE,
       LIC_OFI              as LIBELLE_COURT,
       LIB_OFI              as LIBELLE_LONG
from TMP_ORIGINE_FINANCEMENT tmp
       JOIN SOURCE src ON src.CODE = tmp.SOURCE_ID
;
alter table ORIGINE_FINANCEMENT modify HISTO_MODIFICATION null
;
alter table ORIGINE_FINANCEMENT modify HISTO_MODIFICATEUR_ID null
;

--
-- Privilèges.
--
insert into CATEGORIE_PRIVILEGE(ID, CODE, LIBELLE, ORDRE) values (CATEGORIE_PRIVILEGE_ID_SEQ.nextval, 'financement', 'Financement', 5)
;
insert into PRIVILEGE(ID, CATEGORIE_ID, CODE, LIBELLE, ORDRE)
select privilege_id_seq.nextval, cp.id, 'voir-origine-non-visible', 'Voir les origines de financement masquées', 10
from CATEGORIE_PRIVILEGE cp where cp.CODE = 'financement';

--
-- Fichiers divers ==> communs
--
update FICHIER
set NATURE_ID = (
  select id
  from NATURE_FICHIER
  where CODE = 'COMMUNS'
)
where id in (
  select f.id
  from FICHIER f
         join NATURE_FICHIER nf on f.NATURE_ID = nf.ID and nf.CODE = 'DIVERS'
);
delete from NATURE_FICHIER where code = 'DIVERS'
;
update PROFIL_PRIVILEGE pp set PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-commun'
  where p.CODE = 'televerser'
)
where PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-divers'
  where p.CODE = 'televerser'
) -- PAS GRAVE si vous rencontrez l'erreur 'ORA-00001: violation de contrainte unique'
;
update PROFIL_PRIVILEGE pp set PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-commun'
  where p.CODE = 'telecharger'
)
where PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-divers'
  where p.CODE = 'telecharger'
) -- PAS GRAVE si vous rencontrez l'erreur 'ORA-00001: violation de contrainte unique'
;
update ROLE_PRIVILEGE pp set PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-commun'
  where p.CODE = 'televerser'
)
where PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-divers'
  where p.CODE = 'televerser'
) -- PAS GRAVE si vous rencontrez l'erreur 'ORA-00001: violation de contrainte unique'
;
update ROLE_PRIVILEGE pp set PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-commun'
  where p.CODE = 'telecharger'
)
where PRIVILEGE_ID = (
  select p.id from PRIVILEGE p join CATEGORIE_PRIVILEGE cp on p.CATEGORIE_ID = cp.ID and cp.CODE = 'fichier-divers'
  where p.CODE = 'telecharger'
) -- PAS GRAVE si vous rencontrez l'erreur 'ORA-00001: violation de contrainte unique'
;
delete from CATEGORIE_PRIVILEGE where code = 'fichier-divers' -- NB: cascade sur PROFIL_PRIVILEGE et ROLE_PRIVILEGE
;

--
-- INTERVENTION DE DECLARATION DU PRESIDENT EN DISTANCIEL
--
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

--
-- Attribution automatique des privilèges aux rôles, d'après ce qui est spécifié dans :
--   - PROFIL_TO_ROLE (profils appliqués à chaque rôle) et
--   - PROFIL_PRIVILEGE (privilèges accordés à chaque profil).
--
insert into ROLE_PRIVILEGE (ROLE_ID, PRIVILEGE_ID)
select p2r.ROLE_ID, pp.PRIVILEGE_ID
from PROFIL_TO_ROLE p2r
join profil pr on pr.id = p2r.PROFIL_ID
join PROFIL_PRIVILEGE pp on pp.PROFIL_ID = pr.id
where not exists (
    select * from role_privilege where role_id = p2r.role_id and privilege_id = pp.privilege_id
)
;

INSERT INTO SOUTENANCE_CONFIGURATION (ID, CODE, LIBELLE, VALEUR) VALUES (18, 'PERIODE_INTERVENTION_DIRECTEUR', 'Période autorisant les directeurs à intervenir', '7');

--------------------------------
--- SIGNATURE CONVOCATION ------
--------------------------------

alter table ETABLISSEMENT add SIGNATURE_CONVOCATION_ID NUMBER;
alter table ETABLISSEMENT add constraint ETABLISSEMENT_FICHIER_ID_FK foreign key (SIGNATURE_CONVOCATION_ID) references FICHIER on delete set null;

INSERT INTO NATURE_FICHIER (ID, CODE, LIBELLE) VALUES (NATURE_FICHIER_ID_SEQ.nextval, 'SIGNATURE_CONVOCATION', 'Signature pour la convocation à la soutenance');
```
+1 −1
Changes for module/Application/view/application/fichier/lister-fichiers-communs.phtml: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ use Zend\Paginator\Paginator;
    </tbody>
</table>

<?php echo $paginationControl = $this->paginationControl($fichiers, 'sliding', 'paginator.phtml', ['route' => 'fichier/communs']) ?>
<?php echo $paginationControl = $this->paginationControl($fichiers, 'sliding', 'paginator.phtml', ['route' => 'fichier/lister-fichiers-communs']) ?>


<!-- for translation purpose -->