Autorite eleve
Periode periode
- AvisConseilDeClasse avisConseilDeClasse
- AvisOrientation avisOrientation
-
String appreciation // appreciation donnée lors de conseil de classe
static belongsTo = [
eleve nullable:false
periode nullable: false
appreciation(nullable:true, maxSize: 1024)
- avisConseilDeClasse nullable: true
- avisOrientation nullable: true
}
static mapping = {
eleve column: 'eleve_id'
periode column: 'periode_id'
appreciation column: 'appreciation'
- avisConseilDeClasse column: 'avis_conseil_de_classe_id'
- avisOrientation column: 'avis_orientation_id'
}
String toString() {
- return "$id ${eleve?.id} $periode $appreciation $avisConseilDeClasse $avisOrientation"
+ return "$id ${eleve?.id} $periode $appreciation"
}
}
--- /dev/null
+package org.lilie.services.eliot.notes
+
+class Avis implements Comparable {
+
+ Long id
+ String libelle
+ Integer ordre
+ TypeAvis type
+
+ static constraints = {
+ libelle(nullable: false, maxSize: 30)
+ ordre(nullable: false)
+ type(nullable: false)
+ }
+
+ static mapping = {
+ table('entnotes.avis')
+ id column: 'id',
+ generator: 'sequence',
+ params: [sequence: 'entnotes.avis_id_seq']
+ version true
+ }
+
+ int compareTo(Object o) {
+ Avis avis = (Avis) o
+ return this.ordre <=> avis.ordre
+ }
+}
+++ /dev/null
-package org.lilie.services.eliot.notes
-
-import org.lilie.services.eliot.scolarite.Etablissement
-
-/**
- * Avis de conseil de classe. Specifique à chaque établissement.
- * @author bper
- */
-class AvisConseilDeClasse {
-
- Long id
- Etablissement etablissement
- String texte
- Integer ordre
-
- static belongsTo = [etablissement: Etablissement]
-
- static constraints = {
- etablissement(nullable: false)
- texte(nullable: true, maxSize: 1024)
- ordre(nullable: true)
- }
-
- static mapping = {
- table('entnotes.avis_conseil_de_classe')
- id column: 'id',
- generator: 'sequence',
- params: [sequence: 'entnotes.avis_conseil_de_classe_id_seq']
- version true
- etablissement column: 'etablissement_id'
- texte column: 'texte'
- ordre column: 'ordre'
- }
-
-
- public String toString() {
- return "AvisConseilDeClasse{" +
- "id=" + id +
- ", etablissement=" + etablissement +
- ", texte='" + texte + '\'' +
- '}';
- }
-}
--- /dev/null
+package org.lilie.services.eliot.notes
+
+import org.lilie.services.eliot.securite.impl.Autorite
+import org.lilie.services.eliot.scolarite.Periode
+
+class AvisElevePeriode {
+
+ Long id
+ Avis avis
+ Autorite eleve
+ Periode periode
+
+ // L'attribut sert uniquement pour la contrainte d'unicité dans la BDD:
+ // Un élève ne peut avoir qu'un seul avis d'un type donné pour une période.
+ TypeAvis typeAvis
+
+ static constraints = {
+ avis(nullable: false, validator: avisValidator)
+ eleve(nullable: false)
+ periode(nullable: false)
+ typeAvis(nullable: false, validator: typeAvisValidator)
+ }
+
+ static mapping = {
+ table('entnotes.avis_eleve_periode')
+ id column: 'id',
+ generator: 'sequence',
+ params: [sequence: 'entnotes.avis_eleve_periode_id_seq']
+ version true
+ }
+
+ def beforeValidate() {
+ this.typeAvis = this.avis?.type
+ }
+
+ static typeAvisValidator = {TypeAvis val, AvisElevePeriode obj ->
+ return val.id == obj.avis.type.id
+ }
+
+ static avisValidator = {Avis val, AvisElevePeriode obj ->
+ return val.type.etablissement.id == obj.periode.classe.etablissement.id
+ }
+}
+++ /dev/null
-package org.lilie.services.eliot.notes
-
-import org.lilie.services.eliot.scolarite.Etablissement
-
-/**
- * Avis d'orientation. Specifique à chaque établissement.
- * @author bper
- */
-class AvisOrientation {
-
- Long id
- Etablissement etablissement
- String texte
- Integer ordre
-
- static belongsTo = [etablissement: Etablissement]
-
- static constraints = {
- etablissement(nullable: false)
- texte(nullable: true, maxSize: 1024)
- ordre(nullable: true)
- }
-
- static mapping = {
- table('entnotes.avis_orientation')
- id column: 'id',
- generator: 'sequence',
- params: [sequence: 'entnotes.avis_orientation_id_seq']
- version true
- etablissement column: 'etablissement_id'
- texte column: 'texte'
- ordre column: 'ordre'
- }
-
-
- public String toString() {
- return "AvisOrientation{" +
- "id=" + id +
- ", etablissement=" + etablissement +
- ", texte='" + texte + '\'' +
- '}';
- }
-}
+++ /dev/null
-package org.lilie.services.eliot.notes
-
-/**
- * Les modèles des appreciations par défaut (Avis de conseil de classe, Avis d'orientation).
- * @author msan
- * @author bper
- */
-class ModeleAppreciation {
-
- Long id
-
- String texte // texte de modèle d'appreciation
- TypeAppreciationEnum type // type d'appreciation
- Integer ordre
-
- static constraints = {
- texte(nullable: true, maxSize: 1024)
- type(nullable: false)
- ordre(nullable: true)
- }
-
- static mapping = {
- table('entnotes.modele_appreciation')
- id column: 'id',
- generator: 'sequence',
- params: [sequence: 'entnotes.modele_appreciation_id_seq']
- version true
- texte column: 'texte'
- type column: 'type'
- ordre column: 'ordre'
- }
-
-
- public String toString() {
- return "ModeleAppreciation{" +
- "texte='" + texte + '\'' +
- ", type=" + type +
- '}';
- }
-}
--- /dev/null
+package org.lilie.services.eliot.notes
+
+import org.lilie.services.eliot.scolarite.Etablissement
+
+class TypeAvis implements Comparable {
+
+ Long id
+ String libelle
+ Integer ordre
+ Etablissement etablissement
+
+ static constraints = {
+ libelle(nullable: false, maxSize: 30)
+ etablissement(nullable: false)
+ ordre(nullable: false)
+ }
+
+ static mapping = {
+ table('entnotes.type_avis')
+ id column: 'id',
+ generator: 'sequence',
+ params: [sequence: 'entnotes.type_avis_id_seq']
+ version true
+ }
+
+ int compareTo(Object o) {
+ TypeAvis typeAvis = (TypeAvis) o
+ return this.ordre <=> typeAvis.ordre
+ }
+}
List<MatiereImpressionInfo> lignesTableau = [] // lignes de tableau
- String avisConseilDeClasse="" // Avis du conseil de classe
- String avisOrientation="" // Avis d'orientation
- String appreciationGenrale="" // Apprécation génerale
+ // TOREFACT bper : il ne faut plus utiliser ces attributs dans le modèle Jasper
+ String avisConseilDeClasse = "" // Avis du conseil de classe
+ String avisOrientation = "" // Avis d'orientation
+
+ String appreciationGenrale = "" // Apprécation génerale
+
+ String libelleAvis1 = ""
+ String avis1 = ""
+
+ String libelleAvis2 = ""
+ String avis2 = ""
// notes textuelles (annotations) qui se trouvent dans le document
List<NoteTextuelleImpression> annotationsUtilisees = []
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ ~ This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ ~
+ ~ Lilie is free software. You can redistribute it and/or modify since
+ ~ you respect the terms of either (at least one of the both license) :
+ ~ - under the terms of the GNU Affero General Public License as
+ ~ published by the Free Software Foundation, either version 3 of the
+ ~ License, or (at your option) any later version.
+ ~ - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ ~ License, or any later version
+ ~
+ ~ There are special exceptions to the terms and conditions of the
+ ~ licenses as they are applied to this software. View the full text of
+ ~ the exception in file LICENSE.txt in the directory of this software
+ ~ distribution.
+ ~
+ ~ Lilie is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ Licenses for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ and the CeCILL-C along with Lilie. If not, see :
+ ~ <http://www.gnu.org/licenses/> and
+ ~ <http://www.cecill.info/licences.fr.html>.
+ -->
+
+<databaseChangeLog
+ xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
+
+ <changeSet id="1" author="bper">
+
+ <comment>
+ Suppresion de l'avis de conseil de classe "Avertissement"
+ </comment>
+
+ <delete schemaName="entnotes" tableName="modele_appreciation" >
+ <where>texte='Avertissement'</where>
+ </delete>
+
+ <sql>
+ DELETE FROM entnotes.avis_conseil_de_classe
+ WHERE texte = 'Avertissement'
+ AND id NOT IN (
+ SELECT DISTINCT avis_conseil_de_classe_id
+ FROM entnotes.appreciation_eleve_periode
+ WHERE avis_conseil_de_classe_id IS NOT NULL
+ UNION
+ SELECT DISTINCT avis_conseil_de_classe_id
+ FROM entnotes_2011_2012.appreciation_eleve_periode
+ WHERE avis_conseil_de_classe_id IS NOT NULL
+ )
+ </sql>
+
+ </changeSet>
+
+
+ <changeSet id="2" author="bper">
+
+ <comment>
+ Migration de schéma pour la gestion des avis (orientation, conseil de classe) plus flexible
+ </comment>
+
+ <createTable schemaName="entnotes" tableName="type_avis" >
+ <column name="id" type="bigint">
+ <constraints primaryKey="true" nullable="false"/>
+ </column>
+
+ <column name="version" type="integer">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="libelle" type="varchar(30)">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="ordre" type="smallint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="etablissement_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+ </createTable>
+
+ <createSequence schemaName="entnotes" sequenceName="type_avis_id_seq"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="type_avis"
+ baseColumnNames="etablissement_id"
+ constraintName="fk_type_avis_etablissement"
+ referencedTableSchemaName="ent"
+ referencedTableName="etablissement"
+ referencedColumnNames="id"/>
+
+ <!-- Contrainte d'unicité non sensible à la casse -->
+ <createIndex schemaName="entnotes"
+ tableName="type_avis"
+ indexName="uix_type_avis_etablissement_id_libelle"
+ unique="true">
+
+ <column name="etablissement_id"/>
+ <column name="lower(libelle)"/>
+ </createIndex>
+
+ <addUniqueConstraint schemaName="entnotes"
+ tableName="type_avis"
+ columnNames="etablissement_id,ordre" />
+
+
+ <createTable tableName="avis" schemaName="entnotes" >
+ <column name="id" type="bigint">
+ <constraints primaryKey="true" nullable="false"/>
+ </column>
+
+ <column name="version" type="integer">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="libelle" type="varchar(30)">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="ordre" type="smallint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="type_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+ </createTable>
+
+ <createSequence schemaName="entnotes" sequenceName="avis_id_seq"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="avis"
+ baseColumnNames="type_id"
+ constraintName="fk_avis_type"
+ referencedTableSchemaName="entnotes"
+ referencedTableName="type_avis"
+ referencedColumnNames="id"/>
+
+ <!-- Contrainte d'unicité non sensible à la casse -->
+ <createIndex schemaName="entnotes"
+ tableName="avis"
+ indexName="uix_avis_type_id_libelle"
+ unique="true">
+
+ <column name="type_id"/>
+ <column name="lower(libelle)"/>
+ </createIndex>
+
+
+ <createTable tableName="avis_eleve_periode" schemaName="entnotes" >
+ <column name="id" type="bigint">
+ <constraints primaryKey="true" nullable="false"/>
+ </column>
+
+ <column name="version" type="integer">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="avis_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="eleve_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="periode_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="type_avis_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+ </createTable>
+
+ <createSequence schemaName="entnotes" sequenceName="avis_eleve_periode_id_seq"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="avis_id"
+ constraintName="fk_avis_eleve_periode_avis"
+ referencedTableSchemaName="entnotes"
+ referencedTableName="avis"
+ referencedColumnNames="id"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="eleve_id"
+ constraintName="fk_avis_eleve_periode_eleve"
+ referencedTableSchemaName="securite"
+ referencedTableName="autorite"
+ referencedColumnNames="id"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="periode_id"
+ constraintName="fk_avis_eleve_periode_periode"
+ referencedTableSchemaName="ent"
+ referencedTableName="periode"
+ referencedColumnNames="id"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="type_avis_id"
+ constraintName="fk_avis_eleve_periode_type_avis"
+ referencedTableSchemaName="entnotes"
+ referencedTableName="type_avis"
+ referencedColumnNames="id"/>
+
+ <addUniqueConstraint schemaName="entnotes"
+ tableName="avis_eleve_periode"
+ constraintName="uk_eleve_periode_type_avis"
+ columnNames="eleve_id,periode_id,type_avis_id" />
+
+
+ <!-- Replique pour le schéma entnotes_2011_2012 -->
+ <createTable tableName="avis_eleve_periode" schemaName="entnotes_2011_2012" >
+ <column name="id" type="bigint">
+ <constraints primaryKey="true" nullable="false"/>
+ </column>
+
+ <column name="version" type="integer">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="avis_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="eleve_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="periode_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="type_avis_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes_2011_2012"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="avis_id"
+ constraintName="fk_avis_eleve_periode_avis"
+ referencedTableSchemaName="entnotes"
+ referencedTableName="avis"
+ referencedColumnNames="id"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes_2011_2012"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="eleve_id"
+ constraintName="fk_avis_eleve_periode_eleve"
+ referencedTableSchemaName="securite"
+ referencedTableName="autorite"
+ referencedColumnNames="id"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes_2011_2012"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="periode_id"
+ constraintName="fk_avis_eleve_periode_periode"
+ referencedTableSchemaName="ent_2011_2012"
+ referencedTableName="periode"
+ referencedColumnNames="id"/>
+
+ <addForeignKeyConstraint baseTableSchemaName="entnotes_2011_2012"
+ baseTableName="avis_eleve_periode"
+ baseColumnNames="type_avis_id"
+ constraintName="fk_avis_eleve_periode_type_avis"
+ referencedTableSchemaName="entnotes"
+ referencedTableName="type_avis"
+ referencedColumnNames="id"/>
+
+ <addUniqueConstraint schemaName="entnotes_2011_2012"
+ tableName="avis_eleve_periode"
+ constraintName="uk_eleve_periode_type_avis"
+ columnNames="eleve_id,periode_id,type_avis_id" />
+
+
+ <!-- Migration des donées -->
+ <sql>
+ INSERT INTO entnotes.type_avis
+ SELECT nextval('entnotes.type_avis_id_seq') AS id,
+ 0 AS version,
+ 'Avis du conseil de classe' AS libelle,
+ 1 AS ordre,
+ etablissement_id
+ FROM entnotes.avis_conseil_de_classe
+ GROUP BY etablissement_id;
+
+ INSERT INTO entnotes.avis
+ SELECT nextval('entnotes.avis_id_seq') AS id,
+ 0 AS version,
+ texte AS libelle,
+ ordre,
+ (
+ SELECT id FROM entnotes.type_avis AS t
+ WHERE t.etablissement_id = a.etablissement_id
+ AND libelle = 'Avis du conseil de classe'
+ ) AS type_avis_id
+
+ FROM entnotes.avis_conseil_de_classe AS a
+ ORDER BY type_avis_id, ordre;
+
+ INSERT INTO entnotes.type_avis
+ SELECT nextval('entnotes.type_avis_id_seq') AS id,
+ 0 AS version,
+ 'Avis d''orientation' AS libelle,
+ 2 AS ordre,
+ etablissement_id
+ FROM entnotes.avis_orientation
+ GROUP BY etablissement_id;
+
+ INSERT INTO entnotes.avis
+ SELECT nextval('entnotes.avis_id_seq') AS id,
+ 0 AS version,
+ texte AS libelle,
+ ordre,
+ (
+ SELECT id FROM entnotes.type_avis AS t
+ WHERE t.etablissement_id = a.etablissement_id
+ AND libelle = 'Avis d''orientation'
+ ) AS type_avis_id
+
+ FROM entnotes.avis_orientation AS a
+ ORDER BY type_avis_id, ordre;
+
+ INSERT INTO entnotes_2011_2012.avis_eleve_periode
+ SELECT nextval('entnotes.avis_eleve_periode_id_seq') AS id,
+ 0 AS version,
+ a.id AS avis_id,
+ eleve_id,
+ periode_id,
+ a.type_id as type_avis_id
+ FROM entnotes_2011_2012.appreciation_eleve_periode AS appr
+ INNER JOIN entnotes.avis_conseil_de_classe AS acc ON appr.avis_conseil_de_classe_id = acc.id
+ INNER JOIN entnotes.type_avis AS ta ON acc.etablissement_id = ta.etablissement_id AND ta.libelle = 'Avis du conseil de classe'
+ INNER JOIN entnotes.avis AS a ON acc.texte = a.libelle AND a.type_id = ta.id;
+
+ INSERT INTO entnotes.avis_eleve_periode
+ SELECT nextval('entnotes.avis_eleve_periode_id_seq') AS id,
+ 0 AS version,
+ a.id AS avis_id,
+ eleve_id,
+ periode_id,
+ a.type_id as type_avis_id
+ FROM entnotes.appreciation_eleve_periode AS appr
+ INNER JOIN entnotes.avis_conseil_de_classe AS acc ON appr.avis_conseil_de_classe_id = acc.id
+ INNER JOIN entnotes.type_avis AS ta ON acc.etablissement_id = ta.etablissement_id AND ta.libelle = 'Avis du conseil de classe'
+ INNER JOIN entnotes.avis AS a ON acc.texte = a.libelle AND a.type_id = ta.id;
+
+ INSERT INTO entnotes_2011_2012.avis_eleve_periode
+ SELECT nextval('entnotes.avis_eleve_periode_id_seq') AS id,
+ 0 AS version,
+ a.id AS avis_id,
+ eleve_id,
+ periode_id,
+ a.type_id as type_avis_id
+ FROM entnotes_2011_2012.appreciation_eleve_periode AS appr
+ INNER JOIN entnotes.avis_orientation AS acc ON appr.avis_orientation_id = acc.id
+ INNER JOIN entnotes.type_avis AS ta ON acc.etablissement_id = ta.etablissement_id AND ta.libelle = 'Avis d''orientation'
+ INNER JOIN entnotes.avis AS a ON acc.texte = a.libelle AND a.type_id = ta.id;
+
+ INSERT INTO entnotes.avis_eleve_periode
+ SELECT nextval('entnotes.avis_eleve_periode_id_seq') AS id,
+ 0 AS version,
+ a.id AS avis_id,
+ eleve_id,
+ periode_id,
+ a.type_id as type_avis_id
+ FROM entnotes.appreciation_eleve_periode AS appr
+ INNER JOIN entnotes.avis_orientation AS acc ON appr.avis_orientation_id = acc.id
+ INNER JOIN entnotes.type_avis AS ta ON acc.etablissement_id = ta.etablissement_id AND ta.libelle = 'Avis d''orientation'
+ INNER JOIN entnotes.avis AS a ON acc.texte = a.libelle AND a.type_id = ta.id;
+ </sql>
+
+
+ <!-- Suppression des anciennes tables -->
+ <dropForeignKeyConstraint baseTableSchemaName="entnotes_2011_2012"
+ baseTableName="appreciation_eleve_periode"
+ constraintName="fk_appreciation_eleve_periode_avis_conseil_de_classe" />
+
+ <dropForeignKeyConstraint baseTableSchemaName="entnotes_2011_2012"
+ baseTableName="appreciation_eleve_periode"
+ constraintName="fk_appreciation_eleve_periode_avis_orientation" />
+
+ <dropColumn schemaName="entnotes_2011_2012"
+ tableName="appreciation_eleve_periode"
+ columnName="avis_conseil_de_classe_id" />
+
+ <dropColumn schemaName="entnotes_2011_2012"
+ tableName="appreciation_eleve_periode"
+ columnName="avis_orientation_id" />
+
+ <dropForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="appreciation_eleve_periode"
+ constraintName="fk_appreciation_eleve_periode_avis_conseil_de_classe" />
+
+ <dropForeignKeyConstraint baseTableSchemaName="entnotes"
+ baseTableName="appreciation_eleve_periode"
+ constraintName="fk_appreciation_eleve_periode_avis_orientation" />
+
+ <dropColumn schemaName="entnotes"
+ tableName="appreciation_eleve_periode"
+ columnName="avis_conseil_de_classe_id" />
+
+ <dropColumn schemaName="entnotes"
+ tableName="appreciation_eleve_periode"
+ columnName="avis_orientation_id" />
+
+ <dropTable schemaName="entnotes" tableName="avis_conseil_de_classe" />
+ <dropTable schemaName="entnotes" tableName="avis_orientation" />
+ <dropTable schemaName="entnotes" tableName="modele_appreciation" />
+
+ </changeSet>
+
+</databaseChangeLog>
<include file="changelogs/scolarite/2012-09-06-0022142.xml"/>
<include file="changelogs/scolarite/2012-09-07-0022245.xml"/>
<include file="changelogs/scolarite/2012-09-07-0022055.xml"/>
+ <include file="changelogs/scolarite/2012-10-08-0022910.xml"/>
<include file="changelogs/scolarite/2012-10-16-0022502.xml"/>
-
</databaseChangeLog>
\ No newline at end of file
import org.lilie.services.eliot.notes.AbstractNotesController
import org.lilie.services.eliot.scolarite.PeriodeService
import org.lilie.services.eliot.notes.ResultatEleveServicePeriode
+import org.lilie.services.eliot.notes.AvisElevePeriode
+import org.lilie.services.eliot.notes.TypeAvis
/**
* @author bper
/**
* Retourne le Map pour le composant Bulletin
- * @param eleve
- * @param periode
- * @return Map
*/
Map getComposantModele(Boolean asJSON) {
/**
* Recupere un resultat d'eleve pour une periode precedent et une service donne
- * @param service
- * @param periodePrecedente
- * @return
*/
private ResultatEleveServicePeriode getResultatPrecedent(Service service, Periode periodePrecedente) {
Bulletin bulletin = bulletinsPrecedents.get(periodePrecedente)
/**
* Les lignes de bulletin récapitulant les appréciations et les absences
- * @param controller
- * @param bulletin
- * @return List
*/
private List getRecapitulatifs() {
if (!bulletin) {return []}
List recapitulatifs = []
- Integer absencesExcusees = (Integer) bulletin?.bilan.get(BilanService.ABSENCES_EXCUSEES_NB)
- Integer absencesNonExcusees = (Integer) bulletin?.bilan.get(BilanService.ABSENCES_NON_EXCUSEES_NB)
- Integer retards = (Integer) bulletin?.bilan.get(BilanService.RETARDS_NB)
- String pasDecompte = bulletin?.bilan.get(BilanService.PAS_DECOMPTE)
+ Integer absencesExcusees = (Integer) bulletin?.bilan?.get(BilanService.ABSENCES_EXCUSEES_NB)
+ Integer absencesNonExcusees = (Integer) bulletin?.bilan?.get(BilanService.ABSENCES_NON_EXCUSEES_NB)
+ Integer retards = (Integer) bulletin?.bilan?.get(BilanService.RETARDS_NB)
+ String pasDecompte = bulletin?.bilan?.get(BilanService.PAS_DECOMPTE)
String libelleAbsence = controller.message(code: 'eliot.notes.libelle.absences')
valeur: retards ?: ''
])
- String avisConseilDeClasse = bulletin?.syntheseEleve?.appreciationElevePeriode?.
- avisConseilDeClasse?.texte
-
- recapitulatifs.add([
- libelle: controller.message(
- code: 'eliot.notes.libelle.avisConseilDeClasse',
- default: "Avis du conseil de classe"
- ),
- valeur: avisConseilDeClasse ?: ''
- ])
-
- String avisOrientation = bulletin?.syntheseEleve?.appreciationElevePeriode?.
- avisOrientation?.texte
-
- recapitulatifs.add([
- libelle: controller.message(
- code: 'eliot.notes.libelle.avisOrientation',
- default: "Avis d'orientation"
- ),
- valeur: avisOrientation ?: ''
- ])
+ bulletin.avisEleveParType.each {TypeAvis typeAvis, AvisElevePeriode avisElevePeriode ->
+ recapitulatifs.add([
+ libelle: typeAvis.libelle,
+ valeur: avisElevePeriode?.avis?.libelle ?: ''
+ ])
+ }
recapitulatifs.add([
libelle: controller.message(
/**
* Les lignes du bulletin avec les moyennes des services et des sous-services
- * @return List
* @author bper
*/
private List getMoyennesServices() {
/**
* Converteur pour BulletinServiceResultat
- * @param sRes
- * @return Map
* @author bper
*/
private Map toMap(BulletinServiceResultat sRes) {
/**
* Retourne le message qui va etre affiché si le relevé n'est pas encore
* disponible pour les élèves et les responsables.
- * @param periode
- * @return
* @author bper
*/
private String getMessagePublication(Periode periode) {
/**
* Converteur pour Service
- * @param service
- * @return
*/
private Map toMap(Service service) {
List<Enseignement> enseignements = service.enseignements.toList()
/**
* Converteur pour SousService
- * @param service
- * @return
*/
private Map toMap(SousService sousService) {
return [matiere: sousService.modaliteMatiere.libelle]
}
-
}
* <http://www.cecill.info/licences.fr.html>.
*/
-
-
-
-
-
-
package org.lilie.services.eliot.notes.domaine
import org.lilie.services.eliot.notes.AbstractNotesController
import org.lilie.services.eliot.scolarite.Periode
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.notes.ActionEnum
-import org.lilie.services.eliot.notes.resultat.resultat.eleve.ResultatElevePeriodeService
import org.lilie.services.eliot.notes.NotesDroitService
import org.lilie.services.eliot.notes.resultat.resultat.eleve.AppreciationElevePeriodeService
-import org.lilie.services.eliot.scolarite.Personne
-import org.lilie.services.eliot.notes.AvisOrientation
-import org.lilie.services.eliot.notes.AvisConseilDeClasse
-import org.lilie.services.eliot.notes.resultat.recap.RecapElevePeriodeService
-import org.lilie.services.eliot.notes.resultat.bulletin.BulletinService
-import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
-import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.annuaire.FonctionEnum
import org.lilie.services.eliot.notes.NotesFonction
class AppreciationElevePeriodeController extends AbstractNotesController {
NotesDroitService notesDroitService
- ResultatElevePeriodeService resultatElevePeriodeService
AppreciationElevePeriodeService appreciationElevePeriodeService
- RecapElevePeriodeService recapElevePeriodeService
- BulletinService bulletinService
- LocalPersonneService localPersonneService
- LocalStructureEnseignementService localStructureEnseignementService
/**
* Enregistre les appreciations générales des élève pour une periode
}
render result as JSON
}
-
- /**
- * Enregistre l'appreciation, l'avis de conseil de classe et l'avis d'orientation
- * pour l'élève et la période donnés.
- * @param eleveId
- * @param periodeId
- * @param avisConseilDeClasseId
- * @param avisOrientationId
- * @param appreciation
- * @author bper
- */
- def enregistreAppreciation = {
- Map result = tryCatch {
- notesDroitService.verifieAutorisationByEtablissement(
- securiteSession,
- etablissementCourant(),
- ActionEnum.MODIFICATION,
- [
- FonctionEnum.DIRECTION,
- FonctionEnum.CORRESPONDANT_DEPLOIEMENT
- ] + NotesFonction.ENSEIGNANT_ASSIMILE
- )
-
- Personne eleve = Personne.get(Long.valueOf(params.eleveId))
- Periode periode = Periode.get(Long.valueOf(params.periodeId))
-
- AvisConseilDeClasse avisConseilDeClasse = null
- if (params.avisConseilDeClasseId) {
- Long avisConseilDeClasseId = Long.valueOf(params.avisConseilDeClasseId)
- avisConseilDeClasse = AvisConseilDeClasse.get(avisConseilDeClasseId)
- }
-
- AvisOrientation avisOrientation = null
- if (params.avisOrientationId) {
- Long avisOrientationId = Long.valueOf(params.avisOrientationId)
- avisOrientation = AvisOrientation.get(avisOrientationId)
- }
-
- String appreciation = params.appreciation
-
- appreciationElevePeriodeService.saveAppreciation(
- securiteSession,
- eleve,
- periode,
- appreciation,
- avisConseilDeClasse,
- avisOrientation)
- }
-
- render result as JSON
- }
-
}
}
/**
- * Gestion du breadCrumbs
- * @return
- */
+ * Gestion du breadCrumbs
+ * @return
+ */
protected List getBreadCrumbsInfo(String nomStructure,
String nomMatiere,
String nomPeriodeCourt,
codeLabel: 'notes.menu.saisie.appreciations.titrePrincipal'
)
return breadCrumbsInfo
-
}
}
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.notes.domaine.PeriodeInfo
import org.lilie.services.eliot.notes.resultat.recap.RecapElevePeriode
-import org.lilie.services.eliot.notes.AvisConseilDeClasse
-import org.lilie.services.eliot.notes.AvisOrientation
/**
* Les configs pour la vue Saisie->conseilDeClasse
return [eleveId: personne.id, nom: personne.nomAffichage()]
}
- // Converteur JSON pour AvisConseilDeClasse
- cfg.registerObjectMarshaller(AvisConseilDeClasse) {AvisConseilDeClasse avis ->
- return [id: avis.id, texte: avis.texte]
- }
-
- // Converteur JSON pour AvisOrientation
- cfg.registerObjectMarshaller(AvisOrientation) {AvisOrientation avis ->
- return [id: avis.id, texte: avis.texte]
- }
-
// Converteur JSON pour RecapElevePeriode
cfg.registerObjectMarshaller(RecapElevePeriode) {RecapElevePeriode recap ->
- return [
- periode: recap.libellePeriode,
- periodeId: recap.periode.id,
- moyenneEleve: recap.resultatElevePeriode?.getValeurAffichage(),
- moyenneClasse: recap.resultatClassePeriode?.moyenne,
- appreciation: recap.appreciationElevePeriode?.appreciation,
- avisConseilDeClasseId: recap.appreciationElevePeriode?.avisConseilDeClasse?.id,
- avisOrientationId: recap.appreciationElevePeriode?.avisOrientation?.id
+ Map map = [
+ periode: recap.libellePeriode,
+ periodeId: recap.periode.id,
+ moyenneEleve: recap.resultatElevePeriode?.getValeurAffichage(),
+ moyenneClasse: recap.resultatClassePeriode?.moyenne,
+ appreciation: recap.appreciationElevePeriode?.appreciation
]
+
+ recap.avisElevePeriodes.each {
+ map.put("avisType${it.avis.type.ordre}Id".toString(), it.avis.id)
+ }
+
+ return map
}
}
}
import org.lilie.services.eliot.scolarite.Periode
import org.lilie.services.eliot.notes.resultat.recap.RecapElevePeriodeService
import org.lilie.services.eliot.notes.resultat.recap.RecapElevePeriode
-import org.lilie.services.eliot.notes.appreciation.AvisConseilDeClasseService
-import org.lilie.services.eliot.notes.appreciation.AvisOrientationService
-import org.lilie.services.eliot.notes.resultat.resultat.eleve.ResultatElevePeriodeService
+
import org.lilie.services.eliot.notes.consultation.BulletinComposant
import org.lilie.services.eliot.notes.resultat.bulletin.BulletinService
import org.lilie.services.eliot.notes.appreciation.ModeleAppreciationProfesseurService
import org.lilie.services.eliot.notes.NotesFonction
import org.lilie.services.eliot.scolarite.PeriodeService
import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
+import org.lilie.services.eliot.notes.avis.AvisService
+import org.lilie.services.eliot.notes.Avis
+import org.lilie.services.eliot.notes.TypeAvis
+import org.lilie.services.eliot.annuaire.FonctionEnum
+import org.lilie.services.eliot.notes.resultat.conseil.ConseilDeClasseService
+import org.lilie.services.eliot.notes.resultat.conseil.ConseilDeClasseParam
/**
* Appréciations saisie par le conseil de classe pour les élèves d'une classe
NotesDroitService notesDroitService
NotesStructureEnseignementService notesStructureEnseignementService
RecapElevePeriodeService recapElevePeriodeService
- AvisConseilDeClasseService avisConseilDeClasseService
- AvisOrientationService avisOrientationService
- ResultatElevePeriodeService resultatElevePeriodeService
BulletinService bulletinService
ModeleAppreciationProfesseurService modeleAppreciationProfesseurService
LocalPersonneService localPersonneService
LocalStructureEnseignementService localStructureEnseignementService
EleveAnnuaireService eleveAnnuaireService
PeriodeService periodeService
+ ConseilDeClasseService conseilDeClasseService
+ AvisService avisService
/**
* @param classeId identifiant de la classe sélectionnée
// La liste des classes auxquelles l'utilisateur a l'accès
List<StructureEnseignement> classes = notesStructureEnseignementService.
findAllClasseForUtilisateur(
- securiteSession,
- etablissementCourant(),
- ActionEnum.MODIFICATION)
+ securiteSession,
+ etablissementCourant(),
+ ActionEnum.MODIFICATION)
classes.sort {a, b -> cc.compare(a.code, b.code)}
result.verrouille = periode ? periode.verrouille : true
- result.avisConseilDeClasse = avisConseilDeClasseService.
- findAllForEtablissement(securiteSession, etablissementCourant()) as JSON
- result.avisOrientation = avisOrientationService.
- findAllForEtablissement(securiteSession, etablissementCourant()) as JSON
+ result.putAll(getAllAvis())
result.banqueAppreciations = modeleAppreciationProfesseurService.findAll(
securiteSession) as JSON
render(view: '/saisie/conseilDeClasse/index', model: result)
}
+ private Map getAllAvis() {
+ Map result = [:]
+
+ List<Avis> allAvises = avisService.findAllForEtablissement(
+ securiteSession,
+ etablissementCourant())
+
+ Map<TypeAvis,List<Avis>> avisParType = (TreeMap) allAvises.groupBy {it.type}
+
+ avisParType.each {TypeAvis typeAvis, List<Avis> listeAvis ->
+ result.put("listeAvisType${typeAvis.ordre}".toString(), listeAvis as JSON)
+ result.put("libelleTypeAvis${typeAvis.ordre}".toString(), typeAvis.libelle)
+ }
+
+ return result
+ }
+
/**
* @param eleveId - l'id de l'élève (Personne) sélectionné
* @param periodeId - l'id de période sélectionnée
/**
* Retourne le map avec les appréciation de l'élève pour une période donnée.
- * @param eleve
- * @param periode
- * @return
* @author bper
*/
- private def getAppreciationsEleve(Personne eleve, Periode periode) {
+ private Map getAppreciationsEleve(Personne eleve, Periode periode) {
if (!eleve || !periode) {
return [:]
}
// Vérifie si l'élève est parmi les élèves de la classe
Boolean isEleveOfClasse = localStructureEnseignementService.
isEleveDansStructureEnseignement(
- securiteSession,
- eleve,
- periode.classe)
+ securiteSession,
+ eleve,
+ periode.classe)
RecapEleve recapEleve = recapElevePeriodeService.
construisRecapElevePeriodes(securiteSession, eleve, periode.classe)
RecapElevePeriode recap = recaps.find {it.periode.id == periode.id}
Boolean actif = isEleveOfClasse
- if (!recap?.eleve?.autorite.estActive) {
+ if (!recap?.eleve?.autorite?.estActive) {
actif = false
}
- return [
+ Map map = [
appreciation: recap.appreciationElevePeriode?.appreciation,
- avisConseilDeClasseId: recap.appreciationElevePeriode?.avisConseilDeClasse?.id,
- avisOrientationId: recap.appreciationElevePeriode?.avisOrientation?.id,
tableauRecap: recaps,
moyennesAjour: recapEleve.moyennesAjour,
- messageMoyennesNonAJour: message(code: 'eliot.notes.message.MoyennesNonAJour', args: [recapEleve.dateDernierCalculMoyennes]),
+ messageMoyennesNonAJour: message(
+ code: 'eliot.notes.message.MoyennesNonAJour',
+ args: [recapEleve.dateDernierCalculMoyennes]),
actif: actif
]
+
+ recap.avisElevePeriodes.each {
+ map.put("avisType${it.avis.type.ordre}Id".toString(), it.avis.id)
+ }
+
+ return map
}
/**
- * Gestion du breadCrumbs
- * @return
- */
+ * Enregistre l'appreciation, les avis pour l'élève et la période données.
+ * @author bper
+ */
+ def enregistreAppreciations = {
+ Map result = tryCatch {
+ notesDroitService.verifieAutorisationByEtablissement(
+ securiteSession,
+ etablissementCourant(),
+ ActionEnum.MODIFICATION,
+ (List) [
+ FonctionEnum.DIRECTION,
+ FonctionEnum.CORRESPONDANT_DEPLOIEMENT
+ ] + NotesFonction.ENSEIGNANT_ASSIMILE
+ )
+
+ ConseilDeClasseParam param = new ConseilDeClasseParam(
+ eleve: Personne.get(params.eleveId),
+ periode: Periode.get(params.periodeId),
+ appreciation: params.appreciation
+ )
+
+ params.each {String k, String v ->
+ if (k.matches(/avis.*Id/)) {
+ Avis avis = Avis.get(v)
+ if (avis) {
+ param.listeAvis << avis
+ }
+ }
+ }
+
+ conseilDeClasseService.enregistreAppreciations(securiteSession, param)
+ }
+
+ render result as JSON
+ }
+
+ /**
+ * Gestion du breadCrumbs
+ */
protected List getBreadCrumbsInfo() {
List breadCrumbsInfo = super.getBreadCrumbsInfo()
)
breadCrumbsInfo << new BreadCrumbsItemInfo(
codeLabel: 'notes.menu.saisie.synthese.titrePrincipal',
- action : '',
+ action : '',
url : '',
fonctionJavaScript : 'eliot.notes.saisie.conseilDeClasse.application.ouvreSynthese'
)
breadCrumbsInfo << new BreadCrumbsItemInfo(
codeLabel: 'notes.menu.saisie.conseilDeClasse.titrePrincipal'
)
-
- return breadCrumbsInfo
+ return breadCrumbsInfo
}
-
}
+++ /dev/null
-/*
- * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
- * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
- *
- * Lilie is free software. You can redistribute it and/or modify since
- * you respect the terms of either (at least one of the both license) :
- * - under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- * - the CeCILL-C as published by CeCILL-C; either version 1 of the
- * License, or any later version
- *
- * There are special exceptions to the terms and conditions of the
- * licenses as they are applied to this software. View the full text of
- * the exception in file LICENSE.txt in the directory of this software
- * distribution.
- *
- * Lilie is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Licenses for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the CeCILL-C along with Lilie. If not, see :
- * <http://www.gnu.org/licenses/> and
- * <http://www.cecill.info/licences.fr.html>.
- */
-
-
-
-
-
-package org.lilie.services.eliot.notes.appreciation
-
-import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.notes.ModeleAppreciation
-import org.lilie.services.eliot.notes.TypeAppreciationEnum
-import org.lilie.services.eliot.notes.AvisConseilDeClasse
-import org.springframework.dao.DataIntegrityViolationException
-import org.lilie.services.eliot.exception.SauvegardeEchoueException
-import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.notes.NotesDroitService
-import org.lilie.services.eliot.notes.ActionEnum
-import org.lilie.services.eliot.notes.NotesFonction
-
-/**
- * @author bper
- */
-class AvisConseilDeClasseService {
-
- NotesDroitService notesDroitService
-
- static transactional = true
-
- /**
- * Crée les AvisConseilDeClasse par défaut à partir de ModeleAppreciation.
- * @param etablissement
- * @return List < AvisConseilDeClasse > les avis créés
- * @author bper
- */
- private List<AvisConseilDeClasse> internalCreeAvisParDefaut(Etablissement etablissement) {
-
- if (!etablissement) {
- throw new IllegalArgumentException("Le paramètre {etablissement} ne doit pas etre null")
- }
-
- List<ModeleAppreciation> modeleAppreciations = ModeleAppreciation.
- findAllByType(TypeAppreciationEnum.AVIS_CONSEIL_DE_CLASSE)
-
- List<AvisConseilDeClasse> listeAvis = []
- modeleAppreciations.each {ModeleAppreciation modeleAppreciation ->
-
- AvisConseilDeClasse avis = new AvisConseilDeClasse(
- etablissement: etablissement,
- texte: modeleAppreciation.texte,
- ordre: modeleAppreciation.ordre
- )
-
- try {
- avis.save(flush: true)
- if (avis.hasErrors()) {
- throw new SauvegardeEchoueException(avis)
- }
- } catch (DataIntegrityViolationException ex) {
- log.info("Appreciation [${modeleAppreciation.texte}] existe déjà pour établissement $etablissement")
- avis = AvisConseilDeClasse.findByTexteAndEtablissement(
- modeleAppreciation.texte,
- etablissement
- )
- }
- listeAvis << avis
- }
- return listeAvis
- }
-
- /**
- * Retourne les avis de conseil de classe de l'établissement donné, si les avis
- * n'existe pas ils sont créé à partir de ModeleAppreciation
- * @param securiteSession
- * @param etablissement
- * @return List < AvisConseilDeClasse >
- * @author bper
- */
- List<AvisConseilDeClasse> findAllForEtablissement(SecuriteSession securiteSession,
- Etablissement etablissement) {
-
- notesDroitService.verifieAutorisationByEtablissement(
- securiteSession,
- etablissement,
- ActionEnum.CONSULTATION,
- (List) (NotesFonction.ENSEIGNANT_ASSIMILE +
- NotesFonction.DIRECTION_ASSIMILE
- )
- )
-
- // Recherche les avis de l'établissement
- List<AvisConseilDeClasse> listeAvis = AvisConseilDeClasse.
- findAllByEtablissement(etablissement)
-
- // Si la liste est vide crée les avis par défaut
- if (!listeAvis) {
- listeAvis = internalCreeAvisParDefaut(etablissement)
- }
-
- return listeAvis.sort {it.ordre}
- }
-}
+++ /dev/null
-/*
- * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
- * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
- *
- * Lilie is free software. You can redistribute it and/or modify since
- * you respect the terms of either (at least one of the both license) :
- * - under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- * - the CeCILL-C as published by CeCILL-C; either version 1 of the
- * License, or any later version
- *
- * There are special exceptions to the terms and conditions of the
- * licenses as they are applied to this software. View the full text of
- * the exception in file LICENSE.txt in the directory of this software
- * distribution.
- *
- * Lilie is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Licenses for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the CeCILL-C along with Lilie. If not, see :
- * <http://www.gnu.org/licenses/> and
- * <http://www.cecill.info/licences.fr.html>.
- */
-
-
-
-
-
-package org.lilie.services.eliot.notes.appreciation
-
-import org.springframework.dao.DataIntegrityViolationException
-import org.lilie.services.eliot.exception.SauvegardeEchoueException
-import org.lilie.services.eliot.notes.ModeleAppreciation
-import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.notes.AvisOrientation
-import org.lilie.services.eliot.notes.NotesDroitService
-import org.lilie.services.eliot.notes.TypeAppreciationEnum
-import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.notes.ActionEnum
-import org.lilie.services.eliot.notes.NotesFonction
-
-class AvisOrientationService {
-
- NotesDroitService notesDroitService
-
- static transactional = true
-
- /**
- * Crée les AvisConseilDeClasse par défaut à partir de ModeleAppreciation.
- * @param etablissement
- * @return List < AvisConseilDeClasse > les avis créés
- * @author bper
- */
- private List<AvisOrientation> internalCreeAvisParDefaut(Etablissement etablissement) {
-
- if (!etablissement) {
- throw new IllegalArgumentException("Le paramètre {etablissement} ne doit pas etre null")
- }
-
- List<ModeleAppreciation> modeleAppreciations = ModeleAppreciation.
- findAllByType(TypeAppreciationEnum.AVIS_ORIENTATION)
-
- List<AvisOrientation> listeAvis = []
- modeleAppreciations.each {ModeleAppreciation modeleAppreciation ->
-
- AvisOrientation avis = new AvisOrientation(
- etablissement: etablissement,
- texte: modeleAppreciation.texte,
- ordre: modeleAppreciation.ordre
- )
-
- try {
- avis.save(flush: true)
- if (avis.hasErrors()) {
- throw new SauvegardeEchoueException(avis)
- }
- } catch (DataIntegrityViolationException ex) {
- log.info("Appreciation [${modeleAppreciation.texte}] existe déjà pour établissement $etablissement")
- avis = AvisOrientation.findByTexteAndEtablissement(
- modeleAppreciation.texte,
- etablissement
- )
- }
- listeAvis << avis
- }
- return listeAvis
- }
-
- /**
- * Retourne les avis d'orientation de classe de l'établissement donné, si les avis
- * n'existe pas ils sont créé à partir de ModeleAppreciation
- * @param securiteSession
- * @param etablissement
- * @return List < AvisOrientation >
- * @author bper
- */
- List<AvisOrientation> findAllForEtablissement(SecuriteSession securiteSession,
- Etablissement etablissement) {
-
- notesDroitService.verifieAutorisationByEtablissement(
- securiteSession,
- etablissement,
- ActionEnum.CONSULTATION,
- (List) (NotesFonction.ENSEIGNANT_ASSIMILE +
- NotesFonction.DIRECTION_ASSIMILE
- )
- )
-
- // Recherche les avis de l'établissement
- List<AvisOrientation> listeAvis = AvisOrientation.
- findAllByEtablissement(etablissement)
-
- // Si la liste est vide crée les avis par défaut
- if (!listeAvis) {
- listeAvis = internalCreeAvisParDefaut(etablissement)
- }
-
- return listeAvis.sort {it.ordre}
- }
-}
--- /dev/null
+package org.lilie.services.eliot.notes.avis
+
+import org.lilie.services.eliot.notes.AvisElevePeriode
+import org.lilie.services.eliot.securite.impl.Autorite
+import org.lilie.services.eliot.scolarite.Periode
+import org.lilie.services.eliot.notes.Avis
+import org.hibernate.SessionFactory
+import org.lilie.services.eliot.notes.ActionEnum
+import org.lilie.services.eliot.notes.NotesFonction
+import org.lilie.services.eliot.notes.NotesDroitService
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.notes.TypeAvis
+
+class AvisElevePeriodeService {
+
+ static transactional = true
+
+ SessionFactory sessionFactory
+ NotesDroitService notesDroitService
+
+ /**
+ * Retourne tous les avisElevePeriode correspondants aux élève et périodes
+ * passés en paramètre.
+ * @author bper
+ */
+ List<AvisElevePeriode> internalFindAll(List<Autorite> eleves,
+ List<Periode> periodes) {
+
+ if (eleves != null && eleves.isEmpty()) {
+ return []
+ }
+ if (periodes != null && periodes.isEmpty()) {
+ return []
+ }
+
+ return AvisElevePeriode.createCriteria().list {
+ if (eleves) {
+ 'in'('eleve', eleves)
+ }
+ if (periodes) {
+ 'in'('periode', periodes)
+ }
+ }
+ }
+
+ /**
+ * Retourne un les AvisElevePeriode mappés par typeAvis. Les clés de map contiennent
+ * tous les typeAvis de l'étab.
+ * @author bper
+ */
+ Map<TypeAvis, AvisElevePeriode> internalFindAllAvisMappedByTypeForEleveEtPeriode(Autorite eleve,
+ Periode periode) {
+ List<TypeAvis> allTypeAvisEtab =
+ TypeAvis.findAllByEtablissement(periode.classe.etablissement)
+
+ List<AvisElevePeriode> avisElevePeriodes = AvisElevePeriode.createCriteria().list {
+ avis {
+ 'in'('type', allTypeAvisEtab)
+ }
+ eq('eleve', eleve)
+ eq('periode', periode)
+ }
+
+ TreeMap<TypeAvis, AvisElevePeriode> avisEleveParType = (TreeMap) [:]
+
+ allTypeAvisEtab.each {TypeAvis type ->
+ avisEleveParType.put(type, avisElevePeriodes.find {it.avis.type.id == type.id})
+ }
+
+ return avisEleveParType
+ }
+
+ /**
+ * Supprime les avisElevePeriode existants pour un élève et période donnés
+ * et crée les nouvels avec les avis passés en paramètre.
+ * @author bper
+ */
+ List<AvisElevePeriode> majAllAvisPourEleveEtPeriode(SecuriteSession securiteSession,
+ List<Avis> listeAvis,
+ Personne eleve,
+ Periode periode) {
+
+ notesDroitService.verifieAutorisationByEleve(
+ securiteSession,
+ eleve,
+ ActionEnum.MODIFICATION,
+ (List) (NotesFonction.ENSEIGNANT_ASSIMILE + NotesFonction.DIRECTION_ASSIMILE )
+ )
+
+ // Supprime les anciens avis
+ List<AvisElevePeriode> avisElevePeriodeOlds = internalFindAll([eleve.autorite], [periode])
+ avisElevePeriodeOlds*.delete()
+ sessionFactory.currentSession.flush()
+
+ // Crée les nouvels avis
+ List<AvisElevePeriode> avisElevePeriodeNews = listeAvis.collect {
+ new AvisElevePeriode(avis: it, eleve: eleve.autorite, periode: periode)
+ }
+
+ avisElevePeriodeNews*.save(failOnError: true)
+ sessionFactory.currentSession.flush()
+
+ return avisElevePeriodeNews
+ }
+}
--- /dev/null
+package org.lilie.services.eliot.notes.avis
+
+/**
+ * @author bper
+ */
+public enum AvisParDefautEnum {
+ FELICITATIONS("Félicitations", 1, TypeAvisParDefautEnum.CONSEIL_DE_CLASSE),
+ ENCOURAGEMENTS("Encouragements", 2, TypeAvisParDefautEnum.CONSEIL_DE_CLASSE),
+ DOIT_PROGRESSER("Doit progresser", 3, TypeAvisParDefautEnum.CONSEIL_DE_CLASSE),
+ MANQUE_DE_TRAVAIL("Manque de travail", 4, TypeAvisParDefautEnum.CONSEIL_DE_CLASSE),
+
+ ADMIS("Admis en classe supérieure", 1, TypeAvisParDefautEnum.ORIENTATION),
+ REDOUBLEMENT("Redoublement", 2, TypeAvisParDefautEnum.ORIENTATION),
+ REORIENTATION("Réorientation", 3, TypeAvisParDefautEnum.ORIENTATION)
+
+ String libelle
+ Integer ordre
+ TypeAvisParDefautEnum type
+
+ AvisParDefautEnum(String libelle, Integer ordre, TypeAvisParDefautEnum type) {
+ this.libelle = libelle
+ this.ordre = ordre
+ this.type = type
+ }
+}
\ No newline at end of file
--- /dev/null
+package org.lilie.services.eliot.notes.avis
+
+import org.lilie.services.eliot.notes.NotesFonction
+import org.lilie.services.eliot.notes.ActionEnum
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.notes.NotesDroitService
+import org.lilie.services.eliot.notes.Avis
+import org.lilie.services.eliot.notes.TypeAvis
+
+class AvisService {
+
+ static transactional = true
+
+ NotesDroitService notesDroitService
+ TypeAvisService typeAvisService
+
+ /**
+ * Retourne tous les avis existant pour un établissement.
+ * @author bper
+ */
+ List<Avis> findAllForEtablissement(SecuriteSession securiteSession,
+ Etablissement etablissement) {
+
+ notesDroitService.verifieAutorisationByEtablissement(
+ securiteSession,
+ etablissement,
+ ActionEnum.CONSULTATION,
+ (List) (NotesFonction.ENSEIGNANT_ASSIMILE + NotesFonction.DIRECTION_ASSIMILE)
+ )
+
+ return internalFindAllForEtablissement(etablissement)
+ }
+
+ List<Avis> internalFindAllForEtablissement(Etablissement etablissement) {
+ List<Avis> listeAvis = Avis.createCriteria().list {
+ type {
+ eq('etablissement', etablissement)
+ }
+ }
+
+ // Si la liste est vide crée les avis par défaut
+ if (!listeAvis) {
+ listeAvis = internalFindOrCreeAllAvisParDefaut(etablissement)
+ }
+
+ return listeAvis
+ }
+
+ List<Avis> internalFindOrCreeAllAvisParDefaut(Etablissement etablissement) {
+
+ Map<TypeAvisParDefautEnum, TypeAvis> types =
+ typeAvisService.internalFindOrCreeAllTypeParDefaut(etablissement)
+
+ List<Avis> listeAvis = []
+
+ AvisParDefautEnum.values().each {AvisParDefautEnum avisParDefaut ->
+ TypeAvis type = types.get(avisParDefaut.type)
+
+ Avis avis = Avis.createCriteria().get {
+ eq('type', type)
+ eq('libelle', avisParDefaut.libelle)
+ }
+
+ if (!avis) {
+ avis = new Avis(
+ libelle: avisParDefaut.libelle,
+ ordre: avisParDefaut.ordre,
+ type: type)
+ }
+
+ listeAvis << avis
+ }
+
+ listeAvis*.save(failOnError: true)
+
+ return listeAvis
+ }
+
+}
--- /dev/null
+package org.lilie.services.eliot.notes.avis
+
+/**
+ * @author bper
+ */
+public enum TypeAvisParDefautEnum {
+ CONSEIL_DE_CLASSE("Avis du conseil de classe", 1),
+ ORIENTATION("Avis d'orientation", 2)
+
+ String libelle
+ Integer ordre
+
+ TypeAvisParDefautEnum(String libelle, Integer ordre) {
+ this.libelle = libelle
+ this.ordre = ordre
+ }
+}
--- /dev/null
+package org.lilie.services.eliot.notes.avis
+
+import org.lilie.services.eliot.notes.TypeAvis
+import org.lilie.services.eliot.scolarite.Etablissement
+
+class TypeAvisService {
+
+ static transactional = true
+
+
+ TypeAvis internalFindOrCreeTypeParDefaut(Etablissement etablissement,
+ TypeAvisParDefautEnum typeParDefaut) {
+
+
+ TypeAvis type = TypeAvis.createCriteria().get {
+ eq('etablissement', etablissement)
+ eq('libelle', typeParDefaut.libelle)
+ }
+
+ if (!type) {
+ type = new TypeAvis(
+ libelle: typeParDefaut.libelle,
+ ordre: typeParDefaut.ordre,
+ etablissement: etablissement
+ )
+
+ type.save(failOnError: true)
+ }
+
+ return type
+ }
+
+
+ Map<TypeAvisParDefautEnum, TypeAvis> internalFindOrCreeAllTypeParDefaut(Etablissement etablissement) {
+
+ Map<TypeAvisParDefautEnum, TypeAvis> map = [:]
+
+ TypeAvisParDefautEnum.values().each {
+ map.put(it, internalFindOrCreeTypeParDefaut(etablissement, it))
+ }
+
+ return map
+ }
+
+
+
+
+}
package org.lilie.services.eliot.notes.exception
import org.lilie.services.eliot.scolarite.Periode
-import org.lilie.services.eliot.securite.impl.Autorite
+import org.lilie.services.eliot.securite.Autorite
/**
* Levé dans le cas où les profiles non autorisés assyent d'accéder aux donnée
import org.lilie.services.eliot.utils.NoteFormateur
import org.lilie.services.eliot.impression.donnees.eleve.NoteTextuelleImpression
import org.lilie.services.eliot.notes.NoteTextuelle
+import org.lilie.services.eliot.notes.TypeAvis
/**
* Récupération d'informations pour le publipostage des notes
tab.moyenneMin = null // on ne l'a pas
tab.moyenneMax = null // on ne l'a pas
+ List<TypeAvis> listeTypeAvis = bulletin.avisEleveParType.keySet().toList().sort()
+ TypeAvis typeAvis1 = listeTypeAvis.size() > 0 ? listeTypeAvis.get(0) : null
+ TypeAvis typeAvis2 = listeTypeAvis.size() > 1 ? listeTypeAvis.get(1) : null
+
// avis et appreciations
- tab.avisConseilDeClasse = bulletin.syntheseEleve.appreciationElevePeriode?.avisConseilDeClasse?.texte
- tab.avisOrientation = bulletin.syntheseEleve.appreciationElevePeriode?.avisOrientation?.texte
+ // TOREFACT bper : il ne faut plus utiliser ces attributs dans le modèle Jasper
+ tab.avisConseilDeClasse = bulletin.avisEleveParType?.get(typeAvis1)?.avis?.libelle
+ tab.avisOrientation = bulletin.avisEleveParType?.get(typeAvis2)?.avis?.libelle
+
+ tab.libelleAvis1 = typeAvis1.libelle
+ tab.avis1 = bulletin.avisEleveParType?.get(typeAvis1)?.avis?.libelle
+
+ tab.libelleAvis2 = typeAvis2.libelle
+ tab.avis2 = bulletin.avisEleveParType?.get(typeAvis2)?.avis?.libelle
+
tab.appreciationGenrale = bulletin.syntheseEleve.appreciationElevePeriode?.appreciation
// recupére l'info filtré. services sans notes où appreciations ne sont pas retenus
import org.lilie.services.eliot.notes.NoteTextuelle
import org.lilie.services.eliot.notes.resultat.synthese.SyntheseClasse
import org.lilie.services.eliot.notes.resultat.synthese.SyntheseEleve
+import org.lilie.services.eliot.notes.TypeAvis
+import org.lilie.services.eliot.notes.AvisElevePeriode
/**
* Regroupe l'ensemble des informations d'un bulletin de notes
Boolean moyennesAjour
Date dateDernierCalculMoyennes
List<NoteTextuelle> annotationsUtilisees
+ TreeMap<TypeAvis, AvisElevePeriode> avisEleveParType
/**
* Dispatche les résultats de l'élève de la classe par services et sous-services
import org.lilie.services.eliot.applications.absences.BilanService
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.annuaire.FonctionEnum
-import org.lilie.services.eliot.securite.impl.Autorite
+import org.lilie.services.eliot.securite.Autorite
import org.lilie.services.eliot.notes.NotesFonction
import org.lilie.services.eliot.notes.NoteTextuelle
import org.lilie.services.eliot.notes.ResultatEleveSousServicePeriode
import org.lilie.services.eliot.notes.resultat.synthese.SyntheseEleveService
import org.lilie.services.eliot.notes.resultat.MoyenneService
import org.lilie.services.eliot.notes.resultat.CalcMoyennesInfo
+import org.lilie.services.eliot.notes.avis.AvisElevePeriodeService
+
+import org.lilie.services.eliot.notes.TypeAvis
+import org.lilie.services.eliot.notes.AvisElevePeriode
/**
* @author bper
NotesServiceService notesServiceService
LocalStructureEnseignementService localStructureEnseignementService
BilanService bilanService
+ AvisElevePeriodeService avisElevePeriodeService
static transactional = true
Bulletin construisBulletin(SecuriteSession securiteSession,
Personne eleve,
Periode periode,
- Boolean seulementNotesEleve = false
- )
+ Boolean seulementNotesEleve = false)
throws PeriodeNonPublieException, AutorisationException {
notesDroitService.verifieAutorisationByEleve(
)
)
- // Récupère la classe de l'élève
StructureEnseignement classe = periode.classe
- if (securiteSession.defaultAutorite.type != org.lilie.services.eliot.securite.Autorite.TYPE_ELIOT) {
+ if (securiteSession.defaultAutorite.type != Autorite.TYPE_ELIOT) {
// Si la personne n'est pas Directeur ni Enseignant on vérifie
// si la période est publiée
- if (
- !securiteSession.hasFonctionIn(
- NotesFonction.ENSEIGNANT_ASSIMILE + NotesFonction.DIRECTION_ASSIMILE,
- classe.etablissement.id
- ) &&
- !periode.bulletinsPublies
- ) {
+ if (!securiteSession.hasFonctionIn(
+ (List) NotesFonction.ENSEIGNANT_ASSIMILE + NotesFonction.DIRECTION_ASSIMILE,
+ classe.etablissement.id
+ ) && !periode.bulletinsPublies) {
throw new PeriodeNonPublieException(
periode,
(Autorite) securiteSession.defaultAutorite
// Récupère les services sur lesquelles élève est noté
List<Service> services = notesServiceService.findAllServiceByClasseAndPeriodes(
- securiteSession, classe, [periode], true)
+ securiteSession,
+ classe,
+ [periode],
+ true)
// Trie les services dans l'ordre defini pour la période donnée
notesServiceService.trieServices(services, periode)
// Récupère les résultats de l'élève sur la période
- SyntheseEleve syntheseEleve =
- syntheseEleveService.construisSyntheseEleve(
- securiteSession, eleve, services, periode)
+ SyntheseEleve syntheseEleve = syntheseEleveService.construisSyntheseEleve(
+ securiteSession,
+ eleve,
+ services,
+ periode)
// Recupere les notes textuelles presentes dans la synthese d'eleve
List<NoteTextuelle> annotationsUtilisees = recupereAnnotations(syntheseEleve)
SyntheseClasse syntheseClasse = new SyntheseClasse()
if (!seulementNotesEleve) {
syntheseClasse = syntheseClasseService.internalConstruisSyntheseClasse(
- classe, services, periode)
+ classe,
+ services,
+ periode)
}
Map bilan = [:]
}
}
- Bulletin bulletin = new Bulletin()
- bulletin.classe = classe
- bulletin.eleve = eleve
- bulletin.periode = periode
- bulletin.services = services
- bulletin.syntheseEleve = syntheseEleve
- bulletin.syntheseClasse = syntheseClasse
- bulletin.bilan = bilan
- bulletin.moyennesAjour = calcInfo.moyennesAjour
- bulletin.dateDernierCalculMoyennes = calcInfo.dateDernierCalculMoyennes
- bulletin.annotationsUtilisees = annotationsUtilisees
+ TreeMap<TypeAvis, AvisElevePeriode> avisEleveParType = (TreeMap) avisElevePeriodeService.
+ internalFindAllAvisMappedByTypeForEleveEtPeriode(eleve.autorite, periode)
+
+ Bulletin bulletin = new Bulletin(
+ classe: classe,
+ eleve: eleve,
+ periode: periode,
+ services: services,
+ syntheseEleve: syntheseEleve,
+ syntheseClasse: syntheseClasse,
+ bilan: bilan,
+ moyennesAjour: calcInfo.moyennesAjour,
+ dateDernierCalculMoyennes: calcInfo.dateDernierCalculMoyennes,
+ annotationsUtilisees: annotationsUtilisees,
+ avisEleveParType: avisEleveParType
+ )
return bulletin
}
--- /dev/null
+package org.lilie.services.eliot.notes.resultat.conseil
+
+import org.lilie.services.eliot.notes.Avis
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.Periode
+
+/**
+ * @author bper
+ */
+class ConseilDeClasseParam {
+ Personne eleve
+ Periode periode
+ String appreciation
+ List<Avis> listeAvis = []
+}
--- /dev/null
+package org.lilie.services.eliot.notes.resultat.conseil
+
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.notes.avis.AvisElevePeriodeService
+import org.lilie.services.eliot.notes.resultat.resultat.eleve.AppreciationElevePeriodeService
+import org.lilie.services.eliot.notes.ActionEnum
+import org.lilie.services.eliot.notes.NotesFonction
+import org.lilie.services.eliot.notes.NotesDroitService
+
+class ConseilDeClasseService {
+
+ static transactional = true
+
+ AvisElevePeriodeService avisElevePeriodeService
+ AppreciationElevePeriodeService appreciationElevePeriodeService
+ NotesDroitService notesDroitService
+
+ /**
+ * Enregistre la saisie de conseil de classe dans une transaction.
+ * @author bper
+ */
+ void enregistreAppreciations(SecuriteSession securiteSession, ConseilDeClasseParam param) {
+
+ notesDroitService.verifieAutorisationByEleve(
+ securiteSession,
+ param.eleve,
+ ActionEnum.MODIFICATION,
+ (List) (NotesFonction.ENSEIGNANT_ASSIMILE + NotesFonction.DIRECTION_ASSIMILE)
+ )
+
+ avisElevePeriodeService.majAllAvisPourEleveEtPeriode(
+ securiteSession,
+ param.listeAvis,
+ param.eleve,
+ param.periode)
+
+ appreciationElevePeriodeService.majAppreciation(
+ securiteSession,
+ param.eleve,
+ param.periode,
+ param.appreciation)
+ }
+}
import org.lilie.services.eliot.notes.ResultatElevePeriode
import org.lilie.services.eliot.notes.ResultatClassePeriode
import org.lilie.services.eliot.notes.AppreciationElevePeriode
+import org.lilie.services.eliot.notes.AvisElevePeriode
/**
* Regroupe les résultats de l'élève et de sa classe pour une période.
ResultatElevePeriode resultatElevePeriode
ResultatClassePeriode resultatClassePeriode
AppreciationElevePeriode appreciationElevePeriode
+ List<AvisElevePeriode> avisElevePeriodes
int compareTo(Object o) {
RecapElevePeriode recap = (RecapElevePeriode) o
import org.lilie.services.eliot.notes.resultat.MoyenneService
import org.lilie.services.eliot.notes.resultat.resultat.eleve.AppreciationElevePeriodeService
import org.lilie.services.eliot.notes.resultat.CalcMoyennesInfo
+import org.lilie.services.eliot.notes.AvisElevePeriode
+import org.lilie.services.eliot.notes.avis.AvisElevePeriodeService
/**
* @author bper
ResultatClassePeriodeService resultatClassePeriodeService
MoyenneService moyenneService
AppreciationElevePeriodeService appreciationElevePeriodeService
+ AvisElevePeriodeService avisElevePeriodeService
static transactional = true
/**
* Retourne la liste des RecapElevePeriode pour toutes les périodes de sa classe.
- * @param securiteSession
- * @param eleve
- * @return List < RecapElevePeriode >
* @author bper
*/
RecapEleve construisRecapElevePeriodes(SecuriteSession securiteSession,
CalcMoyennesInfo calcInfo = moyenneService.internalVerifieMoyennesAjour(classe)
-// // maj les moyennes avant les afficher
-// moyenneService.majMoyennes(classe, securiteSession)
-
List<Periode> periodes = Periode.findAllByClasse(classe)
// Résultat de l'élève pour toutes les périodes
- List<AppreciationElevePeriode> appreciationElevePeriodes = appreciationElevePeriodeService.
- internalFindAll([eleve.autorite], periodes, null)
+ List<AppreciationElevePeriode> appreciationElevePeriodes =
+ appreciationElevePeriodeService.internalFindAll([eleve.autorite], periodes, null)
// Résultat de l'élève pour toutes les périodes
- List<ResultatElevePeriode> resultatElevePeriodes = resultatElevePeriodeService.
- internalFindAll([eleve.autorite], periodes, null)
+ List<ResultatElevePeriode> resultatElevePeriodes =
+ resultatElevePeriodeService.internalFindAll([eleve.autorite], periodes, null)
// Résultat de la classe pour toutes les périodes
- List<ResultatClassePeriode> resultatClassePeriodes = resultatClassePeriodeService.
- internalFindAll([classe], periodes, null)
+ List<ResultatClassePeriode> resultatClassePeriodes =
+ resultatClassePeriodeService.internalFindAll([classe], periodes, null)
+
+ List<AvisElevePeriode> avisElevePeriodes =
+ avisElevePeriodeService.internalFindAll([eleve.autorite], periodes)
// Crée les Recaps pour chaque période
List<RecapElevePeriode> recaps = periodes.collect {Periode periode ->
recap.appreciationElevePeriode = appreciationElevePeriodes.find {it.periode.id == periode.id}
recap.resultatElevePeriode = resultatElevePeriodes.find {it.periode.id == periode.id}
recap.resultatClassePeriode = resultatClassePeriodes.find {it.periode.id == periode.id}
+ recap.avisElevePeriodes = avisElevePeriodes.findAll {it.periode.id == periode.id}
return recap
}
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.scolarite.Periode
-import org.lilie.services.eliot.notes.AvisConseilDeClasse
-import org.lilie.services.eliot.notes.AvisOrientation
import org.lilie.services.eliot.notes.exception.PeriodeVerrouilleException
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
import org.lilie.services.eliot.notes.NotesDroitService
/**
* Enregistre l'appreciation générale d'un élèves pour une période
- * @param eleve
- * @param appreciation
- * @param periode
- * @param avisConseilDeClasse
- * @param avisOrientation
* @author msan
*/
- AppreciationElevePeriode saveAppreciation(SecuriteSession securiteSession,
- Personne eleve,
- Periode periode,
- String appreciation,
- AvisConseilDeClasse avisConseilDeClasse,
- AvisOrientation avisOrientation)
+ AppreciationElevePeriode majAppreciation(SecuriteSession securiteSession,
+ Personne eleve,
+ Periode periode,
+ String appreciation)
throws PeriodeVerrouilleException {
notesDroitService.verifieAutorisationByEleve(
securiteSession,
eleve,
ActionEnum.MODIFICATION,
- NotesFonction.ENSEIGNANT_ASSIMILE + [
+ (List) NotesFonction.ENSEIGNANT_ASSIMILE + [
FonctionEnum.DIRECTION,
FonctionEnum.CORRESPONDANT_DEPLOIEMENT
]
classe)
if (!isEleveOfClasse) {
- throw new IllegalArgumentException("Enregistrement de l'appréciation impossible pour L'élève [$eleve]. Il n'est pas dans la classe [$classe]")
+ throw new IllegalArgumentException(
+ "Enregistrement de l'appréciation impossible pour L'élève [$eleve]. Il n'est pas dans la classe [$classe]")
}
if (!eleve.autorite.estActive) {
- throw new IllegalArgumentException("Enregistrement de notes impossibles pour un élève inactif : " + eleve.nomAffichage())
+ throw new IllegalArgumentException(
+ "Enregistrement de notes impossibles pour un élève inactif : " + eleve.nomAffichage())
}
if (periode.verrouille) {
AppreciationElevePeriode app = internalFindOrCree(eleve.autorite, periode)
app.appreciation = appreciation
- app.avisConseilDeClasse = avisConseilDeClasse
- app.avisOrientation = avisOrientation
save(app)
return app
/**
* Enregistre l'appreciation générale d'un élèves pour une période
- * @param eleve
- * @param appreciation
- * @param periode
* @author msan
*/
private AppreciationElevePeriode internalSaveAppreciation(Autorite eleve,
/**
* Enregistre une appreciation
- * @param app
- * @return AppreciationElevePeriode
* @author msan
*/
AppreciationElevePeriode save(AppreciationElevePeriode app) {
/**
* Retourne l'app qui existe dans la BBD, s'il n'existe pas crée
* une nouvelle instance.
- * @param eleve
- * @param periode
- * @return AppreciationElevePeriode
* @author msan
*/
AppreciationElevePeriode internalFindOrCree(Autorite eleve,
/**
* Retourne l'app unique. Si une des clés (eleve,periode)
* est null, retourne null.
- * @param eleve
- * @param periode
- * @return AppreciationElevePeriode
* @author msan
*/
AppreciationElevePeriode internalFind(Autorite eleve,
/**
* Enregistre les appreciations générales des élèves pour une période
- * @param mapEleveAppreciation
- * @param securiteSession
- * @param periode
- * @throws org.lilie.services.eliot.securite.AutorisationException
* @author bper
*/
void saveAppreciations(SecuriteSession securiteSession,
securiteSession,
eleve,
ActionEnum.MODIFICATION,
- NotesFonction.ENSEIGNANT_ASSIMILE + [
+ (List) NotesFonction.ENSEIGNANT_ASSIMILE + [
FonctionEnum.DIRECTION,
FonctionEnum.CORRESPONDANT_DEPLOIEMENT
]
<g:setJsValueLink name="bulletinDeNotes" controller="consultationBulletin" action="bulletinDeNotes"/>
<g:setJsValueLink name="urlSynthese" controller="saisieSynthese"/>
<g:setJsValueLink name="urlConseilDeClasse" controller="saisieConseilDeClasse" action="appreciationsEleve"/>
- <g:setJsValueLink name="enregistreAppreciations" controller="appreciationElevePeriode" action="enregistreAppreciation"/>
+ <g:setJsValueLink name="enregistreAppreciations" controller="saisieConseilDeClasse" action="enregistreAppreciations"/>
// Libellés
<g:setJsVar value="ConfigServeur.libelle"/>
<g:setJsValueMessage name="periode" code="eliot.notes.libelle.periode"/>
<g:setJsValueMessage name="moyenneEleve" code="eliot.notes.conseilDeClasse.libelle.moyenneEleve"/>
<g:setJsValueMessage name="moyenneClasse" code="eliot.notes.libelle.moyenneClasse"/>
- <g:setJsValueMessage name="avisConseilDeClasse" code="eliot.notes.libelle.avisConseilDeClasse"/>
- <g:setJsValueMessage name="avisOrientation" code="eliot.notes.libelle.avisOrientation"/>
<g:setJsValueMessage name="appreciation" code="eliot.notes.libelle.appreciation"/>
<g:setJsValueMessage name="noteMaxMoyenneClasse" code="eliot.notes.libelle.noteMaxMoyenneClasse"/>
<g:setJsValueJson name="appreciationsEleve" value="${appreciationsEleve}"/>
- <g:setJsValueJson name="avisConseilDeClasse" value="${avisConseilDeClasse}"/>
- <g:setJsValueJson name="avisOrientation" value="${avisOrientation}"/>
+ <g:setJsValueJson name="listeAvisType1" value="${listeAvisType1}"/>
+ <g:setJsValueJson name="listeAvisType2" value="${listeAvisType2}"/>
+
+ <g:setJsValue name="libelleTypeAvis1" value="${libelleTypeAvis1}"/>
+ <g:setJsValue name="libelleTypeAvis2" value="${libelleTypeAvis2}"/>
</g:javascript>
* <http://www.cecill.info/licences.fr.html>.
*/
-
-
package org.lilie.services.eliot.notes
import grails.test.GrailsUnitTestCase
import org.lilie.services.eliot.notes.resultat.resultat.eleve.AppreciationElevePeriodeService
import org.lilie.services.eliot.test.PopulationTestClasse
import org.lilie.services.eliot.securite.impl.CompteUtilisateurEtat
+import org.lilie.services.eliot.test.ProprieteScolariteTestUtilService
/**
* Tests :ResultatElevePeriodeService
NotesPeriodeService notesPeriodeService
AnneeScolaireService anneeScolaireService
AppreciationElevePeriodeService appreciationElevePeriodeService
- org.lilie.services.eliot.test.ProprieteScolariteTestUtilService proprieteScolariteTestUtilService
+ ProprieteScolariteTestUtilService proprieteScolariteTestUtilService
Calendar dateFinSaisie1 = Calendar.getInstance()
Calendar dateFinSaisie2 = Calendar.getInstance()
AnneeScolaire anneeScolaire = null
- AvisConseilDeClasse avisConseilDeClasse = null
- AvisOrientation avisOrientation = null
String appreciation = null
classe1enTrimestres
)
- // AvisConseilDeClasse
- avisConseilDeClasse = creeAvisConseilDeClasse("Trés bien", etablissement1)
-
- //AvisOrientation
- avisOrientation = creeAvisOrientation("Reorientation", etablissement1)
-
//appreciation
appreciation = "Eleve serieux"
Boolean exceptionLeve = false
try {
- appreciationElevePeriodeService.saveAppreciation(
+ appreciationElevePeriodeService.majAppreciation(
securiteSessionEnseignant,
eleve,
periodeT1_1,
- appreciation,
- avisConseilDeClasse,
- avisOrientation
+ appreciation
)
} catch (PeriodeVerrouilleException e) {
exceptionLeve = true
periodeT1_1.dateFinSaisie = dateFinSaisie1.getTime()
exceptionLeve = false
try {
- appreciationElevePeriodeService.saveAppreciation(
+ appreciationElevePeriodeService.majAppreciation(
securiteSessionEnseignant,
eleve,
periodeT1_1,
- appreciation,
- avisConseilDeClasse,
- avisOrientation
+ appreciation
)
} catch (PeriodeVerrouilleException e) {
exceptionLeve = true
return personneProprietesScolarite
}
-/**
- * Crée un avisConseilDeClasse
- * @param texte le texte d'avisConseildeClasse
- * @param etablissement l'etablissement
- * @return l'avisConseilDeClasse crée
- * @author mjao
- */
- private AvisConseilDeClasse creeAvisConseilDeClasse(String texte,
- Etablissement etablissement) {
-
- AvisConseilDeClasse avisConseilDeClasse = new AvisConseilDeClasse(
- texte: texte,
- etablissement: etablissement1,
- )
-
- avisConseilDeClasse.save(flush: true)
-
- if (avisConseilDeClasse.hasErrors()) {
- println(avisConseilDeClasse.errors)
- }
-
- return avisConseilDeClasse
- }
-
-/**
- * Crée un avisOrientation
- * @param texte le texte d'avisOrientation
- * @param etablissement l'etablissement
- * @author mjao
- */
- private AvisOrientation creeAvisOrientation(String texte,
- Etablissement etablissement) {
-
- AvisOrientation avisOrientation = new AvisOrientation(
- texte: texte,
- etablissement: etablissement1,
- )
-
- avisOrientation.save(flush: true)
-
- if (avisOrientation.hasErrors()) {
- println(avisOrientation.errors)
- }
-
- return avisOrientation
- }
-
}
+++ /dev/null
-/*
- * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
- * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
- *
- * Lilie is free software. You can redistribute it and/or modify since
- * you respect the terms of either (at least one of the both license) :
- * - under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- * - the CeCILL-C as published by CeCILL-C; either version 1 of the
- * License, or any later version
- *
- * There are special exceptions to the terms and conditions of the
- * licenses as they are applied to this software. View the full text of
- * the exception in file LICENSE.txt in the directory of this software
- * distribution.
- *
- * Lilie is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Licenses for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the CeCILL-C along with Lilie. If not, see :
- * <http://www.gnu.org/licenses/> and
- * <http://www.cecill.info/licences.fr.html>.
- */
-
-package org.lilie.services.eliot.notes
-
-import grails.test.GrailsUnitTestCase
-
-import org.lilie.services.eliot.test.InitPeriodeTestService
-import org.lilie.services.eliot.notes.test.InitDonneesNotesTestService
-import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
-import org.lilie.services.eliot.test.PopulationTestEtablissement
-import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.test.PopulationTestActeur
-import org.lilie.services.eliot.notes.appreciation.AvisConseilDeClasseService
-
-/**
- * Teste les méthodes de AvisConseilDeClasseService
- * @author mjao
- * @author bper
- */
-class AvisConseilDeClasseServiceTests extends GrailsUnitTestCase {
-
- LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
- InitDonneesNotesTestService initDonneesNotesTestService
- InitPeriodeTestService initPeriodeTestService
- AvisConseilDeClasseService avisConseilDeClasseService
-
- Etablissement etablissement = null
-
- protected void setUp() {
- super.setUp()
-
- initPeriodeTestService.initialisePeriodesDeTest()
- initDonneesNotesTestService.initDonneesTest()
-
- etablissement = localInitDonneesCommunesTestService.
- getEtablissement(PopulationTestEtablissement.ETABLISSEMENT_1)
-
- // Creer des ModelesAppreciations
- creeModeleAppreciation(
- "Avis par défaut 1",
- TypeAppreciationEnum.AVIS_CONSEIL_DE_CLASSE)
-
- creeModeleAppreciation(
- "Avis par défaut 2",
- TypeAppreciationEnum.AVIS_CONSEIL_DE_CLASSE)
- }
-
- protected void tearDown() {
- super.tearDown()
- }
-
- /**
- * Teste la métthode findAllForEtablissement()
- * @author bper
- */
- void testFindAllForEtablissement() {
-
- // Le securité session d'un enseignant
- SecuriteSession securiteSessionEnseignant =
- localInitDonneesCommunesTestService.getSecuriteSession(
- PopulationTestActeur.ENSEIGNANT_1)
-
- List<AvisConseilDeClasse> listAvis = AvisConseilDeClasse.
- findAllByEtablissement(etablissement)
-
- // On peut tester la création des avis par défaut uniquement si les avis pour
- // l'établissement donné n'existent pas dans la base
- if (listAvis.isEmpty()) {
- List<ModeleAppreciation> modeleAvis =
- ModeleAppreciation.findAllByType(TypeAppreciationEnum.AVIS_CONSEIL_DE_CLASSE)
-
- // La méthode doit créer les avis pour chaque modèle
- listAvis = avisConseilDeClasseService.
- findAllForEtablissement(securiteSessionEnseignant,etablissement)
-
- List<String> avisNonCrees = []
- modeleAvis.each {ModeleAppreciation modele ->
- if (!listAvis.find{it.texte == modele.texte}) {
- avisNonCrees << modele.texte
- }
- }
-
- assertTrue (
- "Les AvisConseilDeClasse '${avisNonCrees}' n'ont pas été créés à partir des modèles",
- avisNonCrees.isEmpty())
- }
-
- AvisConseilDeClasse avis1 = creeAvisConseilDeClasse("Avis 1",etablissement)
- AvisConseilDeClasse avis2 = creeAvisConseilDeClasse("Avis 2",etablissement)
-
- listAvis = avisConseilDeClasseService.
- findAllForEtablissement(securiteSessionEnseignant,etablissement)
-
- assertTrue (
- "Les avis trouvés n'appartiennent pas tous au bon établissement",
- !listAvis.any{it.etablissement.id != etablissement.id})
-
- assertNotNull (
- "L'avis de conseil de classe '${avis1.texte}' n'est pas trouvé",
- listAvis.find{it.texte == avis1.texte})
-
- assertNotNull (
- "L'avis de conseil de classe '${avis2.texte}' n'est pas trouvé",
- listAvis.find{it.texte == avis2.texte})
- }
-
-
- /**
- * Crée un modeleAppreciation
- * @param texte le texte d'appreciation
- * @param type le type :avis conseil de classe ou avis d'orientation
- * @return ModeleAppreciation le modeleAppreciation creer
- * @author mjao
- */
- private ModeleAppreciation creeModeleAppreciation(String texte,
- TypeAppreciationEnum type) {
-
- ModeleAppreciation modele = new ModeleAppreciation(texte:texte,type:type)
-
- modele.save(flush:true)
-
- if (modele.hasErrors()) {
- throw new Exception(modele.errors.toString())
- }
-
- return modele
- }
-
-
- /**
- * Crée un avisConseilDeClasse
- * @param texte le texte d'avisConseildeClasse
- * @param etablissement l'etablissement
- * @return l'avisConseilDeClasse crée
- * @author mjao
- */
- private AvisConseilDeClasse creeAvisConseilDeClasse(String texte,
- Etablissement etablissement) {
-
- AvisConseilDeClasse avis = new AvisConseilDeClasse(
- texte:texte,
- etablissement:etablissement,
- )
-
- avis.save(flush:true)
-
- if (avis.hasErrors()) {
- throw new Exception(avis.errors.toString())
- }
-
- return avis
- }
-
-}
+++ /dev/null
-/*
- * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
- * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
- *
- * Lilie is free software. You can redistribute it and/or modify since
- * you respect the terms of either (at least one of the both license) :
- * - under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- * - the CeCILL-C as published by CeCILL-C; either version 1 of the
- * License, or any later version
- *
- * There are special exceptions to the terms and conditions of the
- * licenses as they are applied to this software. View the full text of
- * the exception in file LICENSE.txt in the directory of this software
- * distribution.
- *
- * Lilie is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * Licenses for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the CeCILL-C along with Lilie. If not, see :
- * <http://www.gnu.org/licenses/> and
- * <http://www.cecill.info/licences.fr.html>.
- */
-
-package org.lilie.services.eliot.notes
-
-import grails.test.GrailsUnitTestCase
-import org.lilie.services.eliot.scolarite.anneescolaire.AnneeScolaireService
-import org.lilie.services.eliot.notes.scolarite.NotesPeriodeService
-import org.lilie.services.eliot.test.InitPeriodeTestService
-import org.lilie.services.eliot.notes.test.InitDonneesNotesTestService
-import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
-import org.lilie.services.eliot.test.PopulationTestEtablissement
-import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.test.PopulationTestActeur
-import org.lilie.services.eliot.notes.appreciation.AvisOrientationService
-
-/**
- * Teste les méthodes de AvisConseilDeClasseService
- * @author mjao
- * @author bper
- */
-class AvisOrientationServiceTests extends GrailsUnitTestCase {
-
- LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
- InitDonneesNotesTestService initDonneesNotesTestService
- InitPeriodeTestService initPeriodeTestService
- NotesPeriodeService notesPeriodeService
- AnneeScolaireService anneeScolaireService
- AvisOrientationService avisOrientationService
-
- Etablissement etablissement = null
-
- protected void setUp() {
- super.setUp()
-
- initPeriodeTestService.initialisePeriodesDeTest()
- initDonneesNotesTestService.initDonneesTest()
-
- etablissement = localInitDonneesCommunesTestService.
- getEtablissement(PopulationTestEtablissement.ETABLISSEMENT_1)
-
- // Creer des ModelesAppreciations
- creeModeleAppreciation(
- "Avis par défaut 1",
- TypeAppreciationEnum.AVIS_ORIENTATION)
-
- creeModeleAppreciation(
- "Avis par défaut 2",
- TypeAppreciationEnum.AVIS_ORIENTATION)
- }
-
- protected void tearDown() {
- super.tearDown()
- }
-
- /**
- * Teste la métthode findAllForEtablissement()
- * @author bper
- */
- void testFindAllForEtablissement() {
-
- // Le securité session d'un enseignant
- SecuriteSession securiteSessionEnseignant =
- localInitDonneesCommunesTestService.getSecuriteSession(
- PopulationTestActeur.ENSEIGNANT_1)
-
- List<AvisOrientation> listAvis = AvisConseilDeClasse.
- findAllByEtablissement(etablissement)
-
- // On peut tester la création des avis par défaut uniquement si les avis pour
- // l'établissement donné n'existent pas dans la base
- if (listAvis.isEmpty()) {
- List<ModeleAppreciation> modeleAvis =
- ModeleAppreciation.findAllByType(TypeAppreciationEnum.AVIS_ORIENTATION)
-
- // La méthode doit créer les avis pour chaque modèle
- listAvis = avisOrientationService.
- findAllForEtablissement(securiteSessionEnseignant,etablissement)
-
- List<String> avisNonCrees = []
- modeleAvis.each {ModeleAppreciation modele ->
- if (!listAvis.find{it.texte == modele.texte}) {
- avisNonCrees << modele.texte
- }
- }
-
- assertTrue (
- "Les AvisOrientations '${avisNonCrees}' n'ont pas été créés à partir des modèles",
- avisNonCrees.isEmpty())
- }
-
- AvisOrientation avis1 = creeAvisOrientation("Avis 1",etablissement)
- AvisOrientation avis2 = creeAvisOrientation("Avis 2",etablissement)
-
- listAvis = avisOrientationService.
- findAllForEtablissement(securiteSessionEnseignant,etablissement)
-
- assertTrue (
- "Les avis trouvés n'appartiennent pas tous au bon établissement",
- !listAvis.any{it.etablissement.id != etablissement.id})
-
- assertNotNull (
- "L'avis d'orientation '${avis1.texte}' n'est pas trouvé",
- listAvis.find{it.texte == avis1.texte})
-
- assertNotNull (
- "L'avis d'orientation '${avis2.texte}' n'est pas trouvé",
- listAvis.find{it.texte == avis2.texte})
- }
-
-
- /**
- * Crée un modeleAppreciation
- * @param texte le texte d'appreciation
- * @param type le type :avis conseil de classe ou avis d'orientation
- * @return ModeleAppreciation le modeleAppreciation creer
- * @author mjao
- */
- private ModeleAppreciation creeModeleAppreciation(String texte,
- TypeAppreciationEnum type) {
-
- ModeleAppreciation modele = new ModeleAppreciation(texte:texte,type:type)
-
- modele.save(flush:true)
-
- if (modele.hasErrors()) {
- throw new Exception(modele.errors.toString())
- }
-
- return modele
- }
-
-
- /**
- * Crée un avisOrientation
- * @param texte le texte d'avisConseildeClasse
- * @param etablissement l'etablissement
- * @return l'avisConseilDeClasse crée
- * @author mjao
- */
- private AvisOrientation creeAvisOrientation(String texte,
- Etablissement etablissement) {
-
- AvisOrientation avis = new AvisOrientation(
- texte:texte,
- etablissement:etablissement
- )
-
- avis.save(flush:true)
-
- if (avis.hasErrors()) {
- throw new Exception(avis.errors.toString())
- }
-
- return avis
- }
-
-}
import org.lilie.services.eliot.test.PopulationTestClasse
import org.lilie.services.eliot.utils.NoteFormateur
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+import org.lilie.services.eliot.notes.avis.AvisService
/**
* tests:NotesImpressionServiceTests.
org.lilie.services.eliot.test.ProprieteScolariteTestUtilService proprieteScolariteTestUtilService
InfoCalculMoyennesClasseService infoCalculMoyennesClasseService
LocalStructureEnseignementService localStructureEnseignementService
+ AvisService avisService
Etablissement etablissement1 = null
StructureEnseignement classe1enTrimestres = null
Note note_SS1_T3_E2 = null
Note note_SS2_T3_E2 = null
- AvisConseilDeClasse avisConseildeClasse1 = null
- AvisConseilDeClasse avisConseildeClasse2 = null
-
- AvisOrientation avisOrientation1 = null
- AvisOrientation avisOrientation2 = null
+ AvisElevePeriode avis1Eleve1 = null
+ AvisElevePeriode avis2Eleve1 = null
AppreciationElevePeriode appreciationElevePeriode1 = null
AppreciationElevePeriode appreciationElevePeriode2 = null
//get Etablissement
etablissement1 = localInitDonneesCommunesTestService.getEtablissement(
- PopulationTestEtablissement.ETABLISSEMENT_1
+ PopulationTestEtablissement.ETABLISSEMENT_1
)
//get Eleves
//creer une classe classe1Trimestres
classe1enTrimestres = localInitDonneesCommunesTestService.getClasse(
- PopulationTestClasse.CLASSE_1
+ PopulationTestClasse.CLASSE_1
)
classe1enTrimestres.typeIntervalle = TypeIntervalleEnum.TRIMESTRE
//get periode de notation
periodeT1_1 = initDonneesNotesTestService.getOuCreePeriode(
- initPeriodeTestService.t1, classe1enTrimestres,
- new Date(111, 9, 1),
- new Date(111, 12, 31)
+ initPeriodeTestService.t1, classe1enTrimestres,
+ new Date(111, 9, 1),
+ new Date(111, 12, 31)
)
periodeT2_1 = initDonneesNotesTestService.getOuCreePeriode(
- initPeriodeTestService.t2, classe1enTrimestres,
- new Date(112, 1, 1),
- new Date(112, 03, 31)
+ initPeriodeTestService.t2, classe1enTrimestres,
+ new Date(112, 1, 1),
+ new Date(112, 03, 31)
)
periodeT3_1 = initDonneesNotesTestService.getOuCreePeriode(
- initPeriodeTestService.t3, classe1enTrimestres,
- new Date(112, 4, 1),
- new Date(112, 07, 31)
+ initPeriodeTestService.t3, classe1enTrimestres,
+ new Date(112, 4, 1),
+ new Date(112, 07, 31)
)
periodeAnnee_1 = initDonneesNotesTestService.getOuCreePeriode(
- initPeriodeTestService.annee, classe1enTrimestres)
+ initPeriodeTestService.annee, classe1enTrimestres)
//ajouter (inscription) l' eleve1 au classe1Trimestres
proprieteScolariteTestUtilService.inscrireEleveClasse(
- eleve1,
- etablissement1,
- classe1enTrimestres,
- anneeScolaireService.anneeScolaireEnCours(),
- null,
- null,
- null,
- true
+ eleve1,
+ etablissement1,
+ classe1enTrimestres,
+ anneeScolaireService.anneeScolaireEnCours(),
+ null,
+ null,
+ null,
+ true
)
//ajouter (inscription) l' eleve2 au classe1Trimestres
proprieteScolariteTestUtilService.inscrireEleveClasse(
- eleve2,
- etablissement1,
- classe1enTrimestres,
- anneeScolaireService.anneeScolaireEnCours(),
- null,
- null,
- null,
- true
+ eleve2,
+ etablissement1,
+ classe1enTrimestres,
+ anneeScolaireService.anneeScolaireEnCours(),
+ null,
+ null,
+ null,
+ true
)
//Enseignant
//get Matieres
matiere1 = localInitDonneesCommunesTestService.
- getMatiere(PopulationTestMatiere.ANGLAIS)
+ getMatiere(PopulationTestMatiere.ANGLAIS)
matiere2 = localInitDonneesCommunesTestService.
- getMatiere(PopulationTestMatiere.FRANCAIS)
+ getMatiere(PopulationTestMatiere.FRANCAIS)
//les ModaliteMatiere
modaliteMatiere1 = creeModaliteMatiere(
- "code1",
- "libelle1",
- etablissement1)
+ "code1",
+ "libelle1",
+ etablissement1)
modaliteMatiere2 = creeModaliteMatiere(
- "code2",
- "libelle2",
- etablissement1)
+ "code2",
+ "libelle2",
+ etablissement1)
// crée des services pour C1
service1 = initDonneesNotesTestService.creeService(matiere1, classe1enTrimestres)
note_SS1_T3_E2 = creeNote(eleve2.autorite, eval_SS1_T3, 20)
note_SS2_T3_E2 = creeNote(eleve2.autorite, eval_SS2_T3, 18)
- // Creer une AvisConseildeClasse pour l'eleve1 et eleve2
- avisConseildeClasse1 = new AvisConseilDeClasse(
- Etablissement: etablissement1,
- texte: "Eleve serieux"
- )
- avisConseildeClasse1.save()
+ List<Avis> listeAvis = avisService.internalFindOrCreeAllAvisParDefaut(etablissement1)
- avisConseildeClasse2 = new AvisConseilDeClasse(
- Etablissement: etablissement1,
- texte: "Bonne continuation"
- )
- avisConseildeClasse2.save()
+ List<TypeAvis> listeTypeAvis = listeAvis.groupBy{it.type}.keySet().toList().sort()
- //creer une AvisOrientation pour l'eleve1 et l'eleve2
- avisOrientation1 = new AvisOrientation(
- Etablissement: etablissement1,
- texte: "Redoublant"
+ avis1Eleve1 = new AvisElevePeriode(
+ eleve: eleve1.autorite,
+ periode: periodeT1_1,
+ avis: listeAvis.find {it.type == listeTypeAvis.first()}
)
- avisOrientation1.save()
+ avis1Eleve1.save()
- avisOrientation2 = new AvisOrientation(
- Etablissement: etablissement1,
- texte: "Passage"
+ avis2Eleve1 = new AvisElevePeriode(
+ eleve: eleve1.autorite,
+ periode: periodeT1_1,
+ avis: listeAvis.find {it.type == listeTypeAvis.last()}
)
- avisOrientation2.save()
+ avis2Eleve1.save()
//creer une AppreciationElevePeriode pour l'eleve1 et pour la periode T1_1
appreciationElevePeriode1 = new AppreciationElevePeriode(
-
- eleve: eleve1.autorite,
- periode: periodeT1_1,
- avisConseilDeClasse: avisConseildeClasse1,
- avisOrientation: avisOrientation1,
- appreciation: "A serious boy",
+ eleve: eleve1.autorite,
+ periode: periodeT1_1,
+ appreciation: "A serious boy",
)
appreciationElevePeriode1.save()
//creer une AppreciationElevePeriode pour l'eleve1 et pour la periode T1_1
appreciationElevePeriode2 = new AppreciationElevePeriode(
-
- eleve: eleve2.autorite,
- periode: periodeT1_1,
- avisConseilDeClasse: avisConseildeClasse2,
- avisOrientation: avisOrientation2,
- appreciation: "A bad boy",
+ eleve: eleve2.autorite,
+ periode: periodeT1_1,
+ appreciation: "A bad boy",
)
appreciationElevePeriode2.save()
// La securité session d'un directeur
securiteSessionDicerteur =
localInitDonneesCommunesTestService.getSecuriteSession(
- PopulationTestActeur.DIRECTION_1)
+ PopulationTestActeur.DIRECTION_1)
}
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT1_1,
- enseignement1,
- null
+ eleves,
+ periodeT1_1,
+ enseignement1,
+ null
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT2_1,
- enseignement1,
- null
+ eleves,
+ periodeT2_1,
+ enseignement1,
+ null
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT3_1,
- enseignement1,
- null
+ eleves,
+ periodeT3_1,
+ enseignement1,
+ null
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT1_1,
- enseignement2,
- null
+ eleves,
+ periodeT1_1,
+ enseignement2,
+ null
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT2_1,
- enseignement2,
- null
+ eleves,
+ periodeT2_1,
+ enseignement2,
+ null
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT3_1,
- enseignement2,
- null
+ eleves,
+ periodeT3_1,
+ enseignement2,
+ null
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT1_1,
- enseignement3,
- sousServicesT1.collect { it.modaliteMatiere }
+ eleves,
+ periodeT1_1,
+ enseignement3,
+ sousServicesT1.collect { it.modaliteMatiere }
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT2_1,
- enseignement3,
- sousServicesT2.collect { it.modaliteMatiere }
+ eleves,
+ periodeT2_1,
+ enseignement3,
+ sousServicesT2.collect { it.modaliteMatiere }
)
uptodateService.marqueDirtyEleves(securiteSessionDicerteur,
- eleves,
- periodeT3_1,
- enseignement3,
- sousServicesT3.collect { it.modaliteMatiere }
+ eleves,
+ periodeT3_1,
+ enseignement3,
+ sousServicesT3.collect { it.modaliteMatiere }
)
infoCalculMoyennesClasseService.creeVerrou(classe1enTrimestres)
// recuperer les ResultatEleve-classePeriode
ResultatElevePeriode resultElevePeriodeT1 = ResultatElevePeriode.
- findByEleveAndPeriode(eleve1.autorite, periodeT1_1)
+ findByEleveAndPeriode(eleve1.autorite, periodeT1_1)
ResultatClassePeriode resultClassePeriodeT1 = ResultatClassePeriode.
- findByClasseAndPeriode(classe1enTrimestres, periodeT1_1)
+ findByClasseAndPeriode(classe1enTrimestres, periodeT1_1)
//Recuperer les resultats des services
ResultatEleveServicePeriode rES1P1 = getResultatEleveServicePeriode(
- periodeT1_1,
- service1,
- eleve1.autorite)
+ periodeT1_1,
+ service1,
+ eleve1.autorite)
// creer les EleveImpressionInfos
EleveImpressionInfo EleveImpressionInfo1 = new EleveImpressionInfo(
- personne: eleve1
+ personne: eleve1
)
EleveImpressionInfo EleveImpressionInfo2 = new EleveImpressionInfo(
- personne: eleve2
+ personne: eleve2
)
List<EleveImpressionInfo> eleveInfos = [EleveImpressionInfo1, EleveImpressionInfo2]
// Récupère les données du Bulletin
eleveInfos = notesImpressionService.findAllInfoNoteEleve(
- securiteSessionDicerteur,
- eleveInfos,
- periodeT1_1.typePeriode,
- null,
- true,
- false)
+ securiteSessionDicerteur,
+ eleveInfos,
+ periodeT1_1.typePeriode,
+ null,
+ true,
+ false)
//Recuperation de EleveImpressionInfo pour eleve1 , periodeT1_1
EleveImpressionInfo eleveImpressionInfo1 = eleveInfos.find {it.personne.id == eleve1.id}
//Tester la bonne recuperation des données dans eleveImpressionInfo1
assertNotNull("Les données de l'eleve1 {eleve1} pour Notes ne sont pas recuperés",
- eleveImpressionInfo1)
+ eleveImpressionInfo1)
assertEquals("Le donneesTableau doit avoir exactement 2 lignes qui correspondent aux 2 services",
- eleveImpressionInfo1.donneesTableau.lignesTableau.size(), 2)
-
- assertNotNull("L'avisConseilDeClasse pour l'eleve1 ne doit pas etre nulle",
- eleveImpressionInfo1.donneesTableau.avisConseilDeClasse)
+ eleveImpressionInfo1.donneesTableau.lignesTableau.size(), 2)
- assertEquals("L'avisConseilDeClasse pour l'eleve1 {eleve1} est incorrecte",
- eleveImpressionInfo1.donneesTableau.avisConseilDeClasse, avisConseildeClasse1.texte)
+ assertEquals("L'avis1 pour l'eleve1 est incorrecte",
+ eleveImpressionInfo1.donneesTableau.avis1, avis1Eleve1.avis.libelle)
- assertNotNull("L'avisOrientation pour l'eleve1 ne doit pas etre nulle",
- eleveImpressionInfo1.donneesTableau.avisOrientation)
+ assertEquals("Le libellé de l'avis1 est incorrecte",
+ eleveImpressionInfo1.donneesTableau.libelleAvis1, avis1Eleve1.avis.type.libelle)
- assertEquals("L'avisOrientation pour l'eleve1 {eleve1} est incorrecte",
- eleveImpressionInfo1.donneesTableau.avisOrientation, avisOrientation1.texte)
+ assertEquals("L'avis2 pour l'eleve1 est incorrecte",
+ eleveImpressionInfo1.donneesTableau.avis2, avis2Eleve1.avis.libelle)
+ assertEquals("Le libellé de l'avis2 est incorrecte",
+ eleveImpressionInfo1.donneesTableau.libelleAvis2, avis2Eleve1.avis.type.libelle)
assertNotNull("L'appreciation generale pour l'eleve1 ne doit pas etre nulle",
- eleveImpressionInfo1.donneesTableau.appreciationGenrale)
+ eleveImpressionInfo1.donneesTableau.appreciationGenrale)
assertEquals("L'appreciation generale pour l'eleve1 {eleve1} est incorrecte",
- eleveImpressionInfo1.donneesTableau.appreciationGenrale, appreciationElevePeriode1.appreciation)
+ eleveImpressionInfo1.donneesTableau.appreciationGenrale, appreciationElevePeriode1.appreciation)
//verifier la bonne recuperation des moyennes de l'eleve1
assertEquals("La moyenne générale récupérée pour l'élève {eleve1} et la periode {periodeT1_1} est incorrecte",
- eleveImpressionInfo1.donneesTableau.moyenneGeneraleEleve, nf.format(resultElevePeriodeT1.moyenne))
+ eleveImpressionInfo1.donneesTableau.moyenneGeneraleEleve, nf.format(resultElevePeriodeT1.moyenne))
assertEquals("La moyenne générale récupérée pour la calsse et la periode {periodeT1_1} est incorrecte",
- eleveImpressionInfo1.donneesTableau.moyenneGeneraleClasse, nf.format(resultClassePeriodeT1.moyenne))
+ eleveImpressionInfo1.donneesTableau.moyenneGeneraleClasse, nf.format(resultClassePeriodeT1.moyenne))
//tester la bonne recuperation des données dans MatiereImpressionInfo
MatiereImpressionInfo matiereImpressionInfo1 = eleveImpressionInfo1.
- donneesTableau.lignesTableau.find {it.sousMatieres.size() == 0}
+ donneesTableau.lignesTableau.find {it.sousMatieres.size() == 0}
MatiereImpressionInfo matiereImpressionInfo2 = eleveImpressionInfo1.
- donneesTableau.lignesTableau.find {it.sousMatieres.size() != 0}
+ donneesTableau.lignesTableau.find {it.sousMatieres.size() != 0}
//Tester la bonne recuperation des données dans matiereImpressionInfo1 ( Anglais)
assertTrue("Les noms des Co-enseignants {enseignant1, enseignant2} doivent figurer dans la liste des profs de l'eleve1 {eleve1}",
- matiereImpressionInfo1.prof.contains(Personne.findByAutorite(enseignant1).nomAffichageInitiales()))
+ matiereImpressionInfo1.prof.contains(Personne.findByAutorite(enseignant1).nomAffichageInitiales()))
assertTrue("Les noms des Co-enseignants {enseignant1, enseignant2} doivent figurer dans la liste des profs de l'eleve1 {eleve1}",
- matiereImpressionInfo1.prof.contains(Personne.findByAutorite(enseignant2).nomAffichageInitiales()))
+ matiereImpressionInfo1.prof.contains(Personne.findByAutorite(enseignant2).nomAffichageInitiales()))
assertEquals("Le nom de professeur {enseignant3} doit figurer dans la liste des profs de l'eleve1 {eleve1}",
- Personne.findByAutorite(enseignant3).nomAffichageInitiales(), matiereImpressionInfo2.prof)
+ Personne.findByAutorite(enseignant3).nomAffichageInitiales(), matiereImpressionInfo2.prof)
assertEquals("La moyenne de la matière {matiere1} pour la periode T1_1 {periodeT1_1} est incorrecte",
- matiereImpressionInfo1.moyenneEleve, nf.format(rES1P1.moyenne))
+ matiereImpressionInfo1.moyenneEleve, nf.format(rES1P1.moyenne))
//Tester la bonn recuperations des données dans la liste sousMatieres
SousMatiereImpressionInfo sousMatiereImpressionInfo1 =
- matiereImpressionInfo2.sousMatieres.find {it.libelle == modaliteMatiere1.libelle}
+ matiereImpressionInfo2.sousMatieres.find {it.libelle == modaliteMatiere1.libelle}
SousMatiereImpressionInfo sousMatiereImpressionInfo2 =
- matiereImpressionInfo2.sousMatieres.find {it.libelle == modaliteMatiere2.libelle}
+ matiereImpressionInfo2.sousMatieres.find {it.libelle == modaliteMatiere2.libelle}
assertNotNull("La modaliteMatiere {modaliteMatiere1} doit exister dans la liste des sousMatieres!!!!",
- sousMatiereImpressionInfo1)
+ sousMatiereImpressionInfo1)
assertNotNull("La modaliteMatiere {modaliteMatiere2} doit exister dans la liste des sousMatieres!!!",
- sousMatiereImpressionInfo2)
+ sousMatiereImpressionInfo2)
ResultatEleveSousServicePeriode rESS1P1 = getResultatEleveSousServicePeriode(
- periodeT1_1,
- service2,
- eleve1.autorite,
- sousServiceT1_1)
+ periodeT1_1,
+ service2,
+ eleve1.autorite,
+ sousServiceT1_1)
ResultatEleveSousServicePeriode rESS2P1 = getResultatEleveSousServicePeriode(
- periodeT1_1,
- service2,
- eleve1.autorite,
- sousServiceT1_2)
+ periodeT1_1,
+ service2,
+ eleve1.autorite,
+ sousServiceT1_2)
ResultatClasseSousServicePeriode rCSS1P1 = getResultatClasseSousServicePeriode(
- periodeT1_1,
- service2,
- classe1enTrimestres,
- sousServiceT1_1)
+ periodeT1_1,
+ service2,
+ classe1enTrimestres,
+ sousServiceT1_1)
ResultatClasseSousServicePeriode rCSS2P1 = getResultatClasseSousServicePeriode(
- periodeT1_1,
- service2,
- classe1enTrimestres,
- sousServiceT1_2)
+ periodeT1_1,
+ service2,
+ classe1enTrimestres,
+ sousServiceT1_2)
assertEquals("La moyenne eleve de sousMatiere {modaliteMatiere1} pour la periode {periodeT1_1} n'est pas correcte",
- sousMatiereImpressionInfo1.moyenneEleve, nf.format(rESS1P1.moyenne))
+ sousMatiereImpressionInfo1.moyenneEleve, nf.format(rESS1P1.moyenne))
assertEquals("La moyenne eleve de sousMatiere {modaliteMatiere2} pour la periode {periodeT1_1} n'est pas correcte",
- sousMatiereImpressionInfo2.moyenneEleve, nf.format(rESS2P1.moyenne))
+ sousMatiereImpressionInfo2.moyenneEleve, nf.format(rESS2P1.moyenne))
assertEquals("La moyenne classe de sousMatiere {modaliteMatiere1} pour la periode {periodeT1_1} n'est pas correcte",
- sousMatiereImpressionInfo1.moyenneClasse, nf.format(rCSS1P1.moyenne))
+ sousMatiereImpressionInfo1.moyenneClasse, nf.format(rCSS1P1.moyenne))
assertEquals("La moyenne classe de sousMatiere {modaliteMatiere2} pour la periode {periodeT1_1} n'est pas correcte",
- sousMatiereImpressionInfo2.moyenneClasse, nf.format(rCSS2P1.moyenne))
+ sousMatiereImpressionInfo2.moyenneClasse, nf.format(rCSS2P1.moyenne))
}
// creer les EleveImpressionInfos
EleveImpressionInfo eleveImpressionInfo1 = new EleveImpressionInfo(
- personne: eleve1
+ personne: eleve1
)
EleveImpressionInfo eleveImpressionInfo2 = new EleveImpressionInfo(
- personne: eleve2
+ personne: eleve2
)
List<EleveImpressionInfo> eleveInfos = [eleveImpressionInfo1, eleveImpressionInfo2]
// Récupère les données du Bulletin
eleveInfos = notesImpressionService.findAllInfoNoteEleve(
- securiteSessionDicerteur,
- eleveInfos,
- periodeT1_1.typePeriode,
- null,
- false,
- true)
+ securiteSessionDicerteur,
+ eleveInfos,
+ periodeT1_1.typePeriode,
+ null,
+ false,
+ true)
StructureEnseignement classe =
localStructureEnseignementService.findClasseForEleve(
EleveImpressionInfo eleveImpressionInfo = eleveInfos.find {it.personne.id == eleve1.id}
MatiereImpressionInfo matiereImpressionInfo = eleveImpressionInfo.
- donneesTableau.lignesTableau.find {it.sousMatieres.size() != 0}
+ donneesTableau.lignesTableau.find {it.sousMatieres.size() != 0}
SousMatiereImpressionInfo sousMatiereImpressionInfo1 =
- matiereImpressionInfo.sousMatieres.find {it.libelle == modaliteMatiere1.libelle}
+ matiereImpressionInfo.sousMatieres.find {it.libelle == modaliteMatiere1.libelle}
List<NoteImpressionInfo> controleImpressions1 = sousMatiereImpressionInfo1.noteImpressions
NoteImpressionInfo controleImpressionInfo1 =
- controleImpressions1.find {it.libelle == eval_SS1_T1.titre}
+ controleImpressions1.find {it.libelle == eval_SS1_T1.titre}
assertNotNull("Les notes pour le devoir {eval_SS1_T1} ne sont pas recuperés",
- controleImpressionInfo1)
+ controleImpressionInfo1)
}
/**
* Crée ou get une evaluation attaché a une periode
- * @param periode
- * @param enseignement
- * @param dateCreation
- * @return evaluation
* @author mjao
*/
private Evaluation creeEvaluation(List<Periode> periodes,
Date dateCreation,
Date dateEvaluation) {
Evaluation evaluation = new Evaluation(
- enseignement: enseignement,
- dateCreation: dateCreation,
- dateEvaluation: dateEvaluation,
- periodes: periodes,
- publiable: true,
- titre: "libelleInitial",
- coefficient: 1,
- noteMaxPossible: 50
+ enseignement: enseignement,
+ dateCreation: dateCreation,
+ dateEvaluation: dateEvaluation,
+ periodes: periodes,
+ publiable: true,
+ titre: "libelleInitial",
+ coefficient: 1,
+ noteMaxPossible: 50
)
evaluation.save(flush: true)
if (evaluation.hasErrors()) {
/**
* Crée une note
- * @param eleve
- * @param evaluation qui correspond à l'eleve
- * @param valeur : la valeur numerique de note
* @author mjao
*/
private Note creeNote(Autorite eleve,
Evaluation evaluation,
BigDecimal valeur) {
Note note = new Note(
- eleve: eleve,
- evaluation: evaluation,
- valeurNumerique: valeur
+ eleve: eleve,
+ evaluation: evaluation,
+ valeurNumerique: valeur
)
note.save(flush: true)
if (note.hasErrors()) {
private Personne creePersonne(String idExterne, String nom, String prenom) {
Autorite autorite = new Autorite(
- type: Autorite.TYPE_ACTEUR,
- idExterne: idExterne,
- estActive: true
+ type: Autorite.TYPE_ACTEUR,
+ idExterne: idExterne,
+ estActive: true
)
autorite.save()
}
Personne personne = new Personne(
- nom: nom,
- Prenom: prenom,
- autorite: autorite,
- etablissementRattachement: etablissement1
+ nom: nom,
+ Prenom: prenom,
+ autorite: autorite,
+ etablissementRattachement: etablissement1
)
personne.save()
if (personne.hasErrors()) {
* @author mjao
*/
private PersonneProprietesScolarite creePersonneProprietesScolarite(
- Personne personne,
- ProprietesScolarite proprietesScolarite
+ Personne personne,
+ ProprietesScolarite proprietesScolarite
) {
PersonneProprietesScolarite personneProprietesScolarite =
- new PersonneProprietesScolarite(
- personne: personne,
- proprietesScolarite: creeProprietesScolarite(),
- estActive: true
+ new PersonneProprietesScolarite(
+ personne: personne,
+ proprietesScolarite: creeProprietesScolarite(),
+ estActive: true
- )
+ )
personneProprietesScolarite.save()
return personneProprietesScolarite
* @author mjao
*/
private ResultatEleveServicePeriode getResultatEleveServicePeriode(
- Periode periode,
- Service service,
- Autorite eleve) {
+ Periode periode,
+ Service service,
+ Autorite eleve) {
def criteria = ResultatEleveServicePeriode.createCriteria()
ResultatEleveServicePeriode resultatEleveServicePeriode = criteria.get {
and {
TypePeriode typePeriode) {
SousService sousService = new SousService(
- service: service,
- modaliteMatiere: modaliteMatiere,
- coeff: coeff,
- typePeriode: typePeriode,
- evaluable: true
+ service: service,
+ modaliteMatiere: modaliteMatiere,
+ coeff: coeff,
+ typePeriode: typePeriode,
+ evaluable: true
)
sousService.save(flush: true)
private ModaliteMatiere creeModaliteMatiere(String code,
String libelle,
Etablissement etablissement) {
- ModaliteMatiere modaliteMatiere = new ModaliteMatiere(
- code: code,
- libelle: libelle,
- etablissement: etablissement
+ ModaliteMatiere modaliteMatiere = new ModaliteMatiere(
+ code: code,
+ libelle: libelle,
+ etablissement: etablissement
)
modaliteMatiere.save(flush: true)
}
/**
* return un ResultatEleveSousServicePeriode
- * @param periode
- * @param service
- * @param eleve
* @author mjao
*/
- private ResultatEleveSousServicePeriode getResultatEleveSousServicePeriode(
- Periode periode,
- Service service,
- Autorite eleve,
- SousService sousService) {
+ private ResultatEleveSousServicePeriode getResultatEleveSousServicePeriode(Periode periode,
+ Service service,
+ Autorite eleve,
+ SousService sousService) {
return ResultatEleveSousServicePeriode.createCriteria().get {
resultatEleveServicePeriode {
}
/**
* get un ResultatClasseServicePeriode
- * @param periode
- * @param service
- * @param classe
* @author mjao
*/
- private ResultatClasseSousServicePeriode getResultatClasseSousServicePeriode(
- Periode periode,
- Service service,
- StructureEnseignement classe,
- SousService sousService) {
+ private ResultatClasseSousServicePeriode getResultatClasseSousServicePeriode(Periode periode,
+ Service service,
+ StructureEnseignement classe,
+ SousService sousService) {
return ResultatClasseSousServicePeriode.createCriteria().get {
resultatClasseServicePeriode {
eq('classe', classe)
return personneProprietesScolarite
}
- /**
- * Crée un avisConseilDeClasse
- * @param texte le texte d'avisConseildeClasse
- * @param etablissement l'etablissement
- * @return l'avisConseilDeClasse crée
- * @author mjao
- */
- private AvisConseilDeClasse creeAvisConseilDeClasse(
- String texte,
- Etablissement etablissement) {
-
- AvisConseilDeClasse avisConseilDeClasse = new AvisConseilDeClasse(
-
- texte: texte,
- etablissement: etablissement1,
- )
-
- avisConseilDeClasse.save(flush: true)
-
- if (avisConseilDeClasse.hasErrors()) {
- println(avisConseilDeClasse.errors)
- }
-
- return avisConseilDeClasse
- }
-
- /**
- * Crée un avisOrientation
- * @param texte le texte d'avisOrientation
- * @param etablissement l'etablissement
- * @author mjao
- */
- private AvisOrientation creeAvisOrientation(
- String texte,
- Etablissement etablissement) {
-
- AvisOrientation avisOrientation = new AvisOrientation(
-
- texte: texte,
- etablissement: etablissement1,
- )
-
- avisOrientation.save(flush: true)
-
- if (avisOrientation.hasErrors()) {
- println(avisOrientation.errors)
- }
-
- return avisOrientation
- }
-
-
}
this.conseilDeClasseView = new this.ns.ConseilDeClasseView({
storeSaisie: this.conseilDeClasseController.storeSaisie,
storeAppreciation: this.conseilDeClasseController.storeAppreciation,
- storeAvisConseilDeClasse: this.conseilDeClasseController.storeAvisConseilDeClasse,
- storeAvisOrientation: this.conseilDeClasseController.storeAvisOrientation,
+ storeAvisType1: this.conseilDeClasseController.storeAvisType1,
+ storeAvisType2: this.conseilDeClasseController.storeAvisType2,
banqueAppreciation: this.banqueAppreciation,
periodeModel: this.periodeModel
});
periode: undefined,
moyenneEleve: undefined,
moyenneClasse: undefined,
- avisConseilDeClasse: undefined,
- avisOrientation: undefined,
appreciation: undefined,
noteMaxMoyenneClasse: undefined,
appreciationsEleve: undefined,
- avisConseilDeClasse: [],
- avisOrientation: [],
+ listeAvisType1: [],
+ listeAvisType2: [],
+
+ libelleTypeAvis1: undefined,
+ libelleTypeAvis2: undefined,
graphPeriodes: []
}
root: 'saisie',
fields: [
{name: 'appreciation', type: 'string'},
- {name: 'avisConseilDeClasseId'},
- {name: 'avisOrientationId'},
+ {name: 'avisType1Id'},
+ {name: 'avisType2Id'},
{name: 'verrouille', type: 'boolean'},
{name: 'actif'}
]
saisie: [
{
appreciation: data.appreciation,
- avisConseilDeClasseId: data.avisConseilDeClasseId,
- avisOrientationId: data.avisOrientationId,
+ avisType1Id: data.avisType1Id,
+ avisType2Id: data.avisType2Id,
verrouille: this.ConfigServeur.data.verrouille,
actif: data.actif
}
this.storeSaisie = new Ext.data.Store(storeConfig);
- var dataAvisConseilDeClasse = [
+ var dataAvisType1 = [
{
id: undefined,
- texte: undefined
+ libelle: undefined
}
];
- Ext.each(this.ConfigServeur.data.avisConseilDeClasse, function(item) {
- dataAvisConseilDeClasse.push(item);
+ Ext.each(this.ConfigServeur.data.listeAvisType1, function(item) {
+ dataAvisType1.push(item);
});
- // Avis du conseil de classe
- this.storeAvisConseilDeClasse = new Ext.data.Store({
+ this.storeAvisType1 = new Ext.data.Store({
autoDestroy: true,
autoLoad: false,
reader: new Ext.data.JsonReader({
- root: 'avisConseilDeClasse',
+ root: 'avisType1',
idProperty: 'id',
fields: [
{name: 'id'},
- {name: 'texte', type: 'string'}
+ {name: 'libelle', type: 'string'}
]
}),
data: {
- avisConseilDeClasse: dataAvisConseilDeClasse
+ avisType1: dataAvisType1
}
});
- var dataAvisOrientation = [
+ var dataAvisType2 = [
{
id: undefined,
- texte: undefined
+ libelle: undefined
}
];
- Ext.each(this.ConfigServeur.data.avisOrientation, function(item) {
- dataAvisOrientation.push(item);
+ Ext.each(this.ConfigServeur.data.listeAvisType2, function(item) {
+ dataAvisType2.push(item);
});
- // Avis d'orientation
- this.storeAvisOrientation = new Ext.data.Store({
+ this.storeAvisType2 = new Ext.data.Store({
autoDestroy: true,
autoLoad: false,
reader: new Ext.data.JsonReader({
- root: 'avisOrientation',
+ root: 'avisType2',
idProperty: 'id',
fields: [
{name: 'id'},
- {name: 'texte', type: 'string'}
+ {name: 'libelle', type: 'string'}
]
}),
data: {
- avisOrientation: dataAvisOrientation
+ avisType2: dataAvisType2
}
});
},
{name: 'periode', type: 'string'},
{name: 'moyenneEleve'},
{name: 'moyenneClasse'},
- {name: 'avisConseilDeClasseId', type: 'integer'},
- {name: 'avisOrientationId', type: 'integer'},
+ {name: 'avisType1Id', type: 'integer'},
+ {name: 'avisType2Id', type: 'integer'},
{name: 'appreciation', type: 'string'}
]
})
this.afficheConseilDeClasse(
reponse.appreciation,
- reponse.avisConseilDeClasseId,
- reponse.avisOrientationId,
+ reponse.avisType1Id,
+ reponse.avisType2Id,
reponse.tableauRecap,
reponse.verrouille,
reponse.actif);
/**
* Affiche le conseil de classe
* @param appreciation
- * @param avisConseilDeClasseId
- * @param avisOrientationId
+ * @param avisType1Id
+ * @param avisType2Id
* @param tableauRecap
* @param verrouille
* @param actif
*/
- afficheConseilDeClasse: function(appreciation, avisConseilDeClasseId, avisOrientationId, tableauRecap, verrouille, actif) {
+ afficheConseilDeClasse: function(appreciation, avisType1Id, avisType2Id, tableauRecap, verrouille, actif) {
if (appreciation !== undefined) {
saisie: [
{
appreciation: appreciation,
- avisConseilDeClasseId: avisConseilDeClasseId,
- avisOrientationId: avisOrientationId,
+ avisType1Id: avisType1Id,
+ avisType2Id: avisType2Id,
verrouille: verrouille,
actif: actif
}
this.afficheConseilDeClasse(
reponse.appreciation,
- reponse.avisConseilDeClasseId,
- reponse.avisOrientationId,
+ reponse.avisType1Id,
+ reponse.avisType2Id,
reponse.tableauRecap,
reponse.verrouille,
reponse.actif);
saisie: [
{
appreciation: record.get('appreciation'),
- avisConseilDeClasseId: record.get('avisConseilDeClasseId'),
- avisOrientationId: record.get('avisOrientationId')
+ avisType1Id: record.get('avisType1Id'),
+ avisType2Id: record.get('avisType2Id')
}
]
});
eleveId: eleve.get('eleveId'),
periodeId: periode.get('idPeriode'),
appreciation: record.get('appreciation'),
- avisConseilDeClasseId: record.get('avisConseilDeClasseId'),
- avisOrientationId: record.get('avisOrientationId')
+ avisType1Id: record.get('avisType1Id'),
+ avisType2Id: record.get('avisType2Id')
},
success: function(reponse) {
if ((appreciationRecord !== undefined) && (appreciationRecord !== null)) {
appreciationRecord.set('appreciation', record.get('appreciation'));
- appreciationRecord.set('avisConseilDeClasseId', record.get('avisConseilDeClasseId'));
- appreciationRecord.set('avisOrientationId', record.get('avisOrientationId'));
+ appreciationRecord.set('avisType1Id', record.get('avisType1Id'));
+ appreciationRecord.set('avisType2Id', record.get('avisType2Id'));
this.storeAppreciation.commitChanges();
}
* Constructeur
* cfg storeSaisie
* cfg storeAppreciation
- * cfg storeAvisConseilDeClasse
- * cfg storeAvisOrientation
+ * cfg storeavisType1
+ * cfg storeavisType2
* cfg banqueAppreciation
*/
constructor: function(config) {
var cfg = {
storeSaisie: undefined,
storeAppreciation: undefined,
- storeAvisConseilDeClasse: undefined,
- storeAvisOrientation: undefined,
+ storeAvisType1: undefined,
+ storeAvisType2: undefined,
banqueAppreciation: undefined,
periodeModel: undefined
};
this.storeSaisie = cfg.storeSaisie;
this.storeAppreciation = cfg.storeAppreciation;
- this.storeAvisConseilDeClasse = cfg.storeAvisConseilDeClasse;
- this.storeAvisOrientation = cfg.storeAvisOrientation;
+ this.storeAvisType1 = cfg.storeAvisType1;
+ this.storeAvisType2 = cfg.storeAvisType2;
this.banqueAppreciation = cfg.banqueAppreciation;
this.periodeModel = cfg.periodeModel;
});
// Avis du conseil de classe
- this.avisConseilComboBox = new Ext.form.ComboBox({
- name: 'avisConseilDeClasseId',
- store: this.storeAvisConseilDeClasse,
- fieldLabel: this.ConfigServeur.libelle.avisConseilDeClasse,
+ this.avisType1ComboBox = new Ext.form.ComboBox({
+ name: 'avisType1Id',
+ store: this.storeAvisType1,
+ fieldLabel: this.ConfigServeur.data.libelleTypeAvis1,
width: 150,
labelStyle: 'width: 160px',
labelSeparator: ' : ',
selectOnFocus:true,
mode:'local',
valueField:'id',
- displayField:'texte',
+ displayField:'libelle',
editable: false,
disabled: true,
listeners: {
var record = this.storeSaisie.getAt(0);
if ((record !== undefined) && (record !== null)) {
- record.set('avisConseilDeClasseId', newValue.data.id);
+ record.set('avisType1Id', newValue.data.id);
this.fireEvent(
this.Constantes.eventId.saisieChange,
this.isSaisieValid());
},
scope: this
},
- tpl: '<tpl for="."><div class="x-combo-list-item">{texte} </div></tpl>'
+ tpl: '<tpl for="."><div class="x-combo-list-item">{libelle} </div></tpl>'
});
- // Avis d'orientation
- this.avisOrientationComboBox = new Ext.form.ComboBox({
- name: 'avisOrientationId',
- store: this.storeAvisOrientation,
- fieldLabel: this.ConfigServeur.libelle.avisOrientation,
+ this.avisType2ComboBox = new Ext.form.ComboBox({
+ name: 'avisType2Id',
+ store: this.storeAvisType2,
+ fieldLabel: this.ConfigServeur.data.libelleTypeAvis2,
width: 161,
labelStyle: 'width: 120px',
labelSeparator: ' : ',
selectOnFocus:true,
mode:'local',
valueField:'id',
- displayField:'texte',
+ displayField:'libelle',
editable: false,
disabled: true,
listeners: {
var record = this.storeSaisie.getAt(0);
if ((record !== undefined) && (record !== null)) {
- record.set('avisOrientationId', newValue.data.id);
+ record.set('avisType2Id', newValue.data.id);
this.fireEvent(
this.Constantes.eventId.saisieChange,
this.isSaisieValid());
},
scope: this
},
- tpl: '<tpl for="."><div class="x-combo-list-item">{texte} </div></tpl>'
+ tpl: '<tpl for="."><div class="x-combo-list-item">{libelle} </div></tpl>'
});
this.formSaisie = new Ext.form.FormPanel({
(record.get('actif') !== false)) {
this.appreciationTextArea.enable();
this.banqueAppreciationBoutonEnregistrer.enable();
- this.avisConseilComboBox.enable();
- this.avisOrientationComboBox.enable();
+ this.avisType1ComboBox.enable();
+ this.avisType2ComboBox.enable();
}
}
renderer: eliot.notes.commun.Utils.noteRendererBold
},
- // Avis du conseil de classe
{
- header: this.ConfigServeur.libelle.avisConseilDeClasse,
- dataIndex: 'avisConseilDeClasseId',
+ header: this.ConfigServeur.data.libelleTypeAvis1,
+ dataIndex: 'avisType1Id',
width: 150,
renderer: {
fn: function(value) {
- var item = this.storeAvisConseilDeClasse.getById(value);
+ var item = this.storeAvisType1.getById(value);
if (item === undefined) {
return '';
}
else {
- return eliot.notes.commun.Utils.textRenderer(item.get('texte'));
+ return eliot.notes.commun.Utils.textRenderer(item.get('libelle'));
}
},
scope: this
}
},
- // Avis d'orientation
{
- header: this.ConfigServeur.libelle.avisOrientation,
- dataIndex: 'avisOrientationId',
+ header: this.ConfigServeur.data.libelleTypeAvis2,
+ dataIndex: 'avisType2Id',
width: 150,
renderer: {
fn: function(value) {
- var item = this.storeAvisOrientation.getById(value);
+ var item = this.storeAvisType2.getById(value);
if (item === undefined) {
return '';
}
else {
- return eliot.notes.commun.Utils.textRenderer(item.get('texte'));
+ return eliot.notes.commun.Utils.textRenderer(item.get('libelle'));
}
},
scope: this
border: false,
frame: false,
items:[
- this.avisConseilComboBox
+ this.avisType1ComboBox
]
},
{
border: false,
frame: false,
items:[
- this.avisOrientationComboBox
+ this.avisType2ComboBox
]
}
]}
this.appreciationTextArea.enable();
this.banqueAppreciationBoutonEnregistrer.enable();
this.banqueAppreciation.enable();
- this.avisConseilComboBox.enable();
- this.avisOrientationComboBox.enable();
+ this.avisType1ComboBox.enable();
+ this.avisType2ComboBox.enable();
}
else {
this.appreciationTextArea.disable();
this.banqueAppreciationBoutonEnregistrer.disable();
this.banqueAppreciation.disable();
- this.avisConseilComboBox.disable();
- this.avisOrientationComboBox.disable();
+ this.avisType1ComboBox.disable();
+ this.avisType2ComboBox.disable();
}
}
else {
this.appreciationTextArea.disable();
this.banqueAppreciationBoutonEnregistrer.disable();
this.banqueAppreciation.disable();
- this.avisConseilComboBox.disable();
- this.avisOrientationComboBox.disable();
+ this.avisType1ComboBox.disable();
+ this.avisType2ComboBox.disable();
}
},
this);
labelSeparator: ' : ',
triggerAction: 'all',
selectOnFocus:true,
- mode:'local',
- valueField:'idPeriode',
- displayField:'libelle',
+ mode: 'local',
+ valueField: 'idPeriode',
+ displayField: 'libelle',
editable: false
});