--- /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.impression
+
+/**
+ * Options d'impression du bulletin
+ * @author othe
+ */
+class BulletinOptions {
+
+ TemplateDocument templateDocument
+
+ Boolean moyenneGenerale = true
+ Boolean coefficient = true
+ Boolean moyennePrecedente = true
+ Boolean moyenneMinMax = false
+ Boolean nombreNotes = true
+ Boolean rangs = false
+
+ static constraints = {
+ templateDocument(nullable: false)
+ }
+
+ static mapping = {
+ table('impression.bulletin_options')
+ id column: 'id', generator: 'sequence', params: [sequence: 'impression.bulletin_options_id_seq']
+ version false
+ }
+
+
+
+}
TemplateDocument templateDocument
String champ
String template
+ Integer size
+
static constraints = {
champ(nullable: false)
templateDocument(nullable: true)
template(nullable: true)
+ size(nullable: true)
}
static mapping = {
String descriptif
Boolean systeme
Integer numeroVersion
+ String police
Etablissement etablissement
TemplateEliot templateEliot
int media
descriptif nullable: true
templateEliot nullable: true
etablissement nullable: true
+ police nullable: true
media inList: TypeMedia.values().collect { it.code }
}
Periode periode // Résultat est supprimé en cascade quand la période proprietaire est supprimé.
BigDecimal moyenne // moyenne de la matière, calculée lors de MAJ des notes
+ Integer nbNotes
NoteTextuelle noteTextuelle
+ Integer rang
+ Integer nbEleves
+
Set<ResultatEleveSousServicePeriode> resultatsEleveSousServicePeriode
static hasMany = [
periode nullable: false
moyenne nullable: true
noteTextuelle nullable: true
+ rang nullable: true
+ nbEleves nullable: true
+ nbNotes nullable: true
}
static mapping = {
service column: 'service_id'
periode column: 'periode_id'
moyenne column: 'moyenne'
+ nbEleves column: 'nb_eleves'
+ nbNotes column: 'nb_notes'
version false
}
SousService sousService
BigDecimal moyenne
+ Integer nbNotes
NoteTextuelle noteTextuelle
static belongsTo = [
sousService nullable:false
moyenne nullable: true
noteTextuelle nullable: true
+ nbNotes nullable: true
}
static mapping = {
sousService column:'sous_service_id'
resultatEleveServicePeriode column:'resultat_eleve_service_periode_id'
moyenne column: 'moyenne'
+ nbNotes column: 'nb_notes'
version false
}
public static final String PAS_DECOMPTE = 'pasDecompte'
public static final String ABSENCES_EXCUSEES = 'absencesExcusees'
public static final String ABSENCES_NON_EXCUSEES = 'absencesNonExcusees'
+ public static final String ABSENCES_JUSTIFIEES_RECEVABLES = 'absencesJustifieesRecevables'
+ public static final String ABSENCES_JUSTIFIEES_NON_RECEVABLES = 'absencesJustifieesNonRecevables'
+ public static final String ABSENCES_DEMI_PENSION = 'absencesDemiPension'
+ public static final String ABSENCES_INTERNAT = 'absencesInternat'
+ public static final String DEPARTS_ANTICIPES = 'departsAnticipes'
protected static final Byte AUCUN = 0
* @param preferences les préférences de l'établissement courant
* @return
*/
- List<StatAbsences> getByEleveStatsExcusesNonExcusesFromData(BilanAbsencesParPersonneInfo datas,
- Etablissement etablissement
+ List<StatAbsences> getStatsAbsencesByEleveFromData(
+ BilanAbsencesParPersonneInfo datas,
+ Etablissement etablissement
) {
List<StatAbsences> listEleveStats = []
Motif motifSansMotif = motifService.getMotifSansMotif(preferences)
// Sépare les absences en deux types : absences excusées et non excusées
- Map<String, BilanAbsencesParPersonneInfo> excusesNonExcuses = separeAbsencesExcusesEtNonExcuses(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType = separeAbsencesParType(
datas,
motifSansMotif
)
- BilanAbsencesParPersonneInfo dataAbsencesExcuses = excusesNonExcuses[ABSENCES_EXCUSEES]
- BilanAbsencesParPersonneInfo dataAbsencesNonExcuses = excusesNonExcuses[ABSENCES_NON_EXCUSEES]
+ extraitAbsencesExcusees(absencesParType, preferences, listEleveStats)
+ extraitAbsencesNonExcusees(absencesParType, preferences, listEleveStats)
+ extraitAbsencesJustifieesRecevables(
+ absencesParType,
+ preferences,
+ listEleveStats
+ )
+ extraitAbsencesJustifieesNonRecevables(
+ absencesParType,
+ preferences,
+ listEleveStats
+ )
+ extraitAbsencesDemiPension(
+ absencesParType,
+ listEleveStats
+ )
+ extraitAbsencesInternat(
+ absencesParType,
+ listEleveStats
+ )
+ extraitDepartsAnticipes(
+ absencesParType,
+ listEleveStats
+ )
+
+ extraitAbsencesTotales(datas, preferences, listEleveStats)
+
+ return listEleveStats
+ }
+
+ /**
+ * Retourne la liste des absences excusées
+ * @param absencesParType
+ * @param preferences
+ * @return List < StatAbsences >
+ */
+ private extraitAbsencesExcusees(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ PreferencesEtablissementAbsences preferences,
+ List<StatAbsences> listEleveStats) {
Map calculsAbsencesExcuses = calculeNbAbsencesParEleve(
- dataAbsencesExcuses,
- preferences
- )
- Map calculsAbsencesNonExcuses = calculeNbAbsencesParEleve(
- dataAbsencesNonExcuses,
+ absencesParType[ABSENCES_EXCUSEES],
preferences
)
+
+ calculsAbsencesExcuses.each { Personne eleve, Float nbAbsencesExcusees ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesExcusees =
+ arrondiSuperieur(nbAbsencesExcusees)
+ }
+ }
+
+ private extraitAbsencesDemiPension(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ List<StatAbsences> listEleveStats) {
+
+ BilanAbsencesParPersonneInfo dataAbsencesDemiPension =
+ absencesParType[ABSENCES_DEMI_PENSION]
+ dataAbsencesDemiPension.eachAbsence {
+ Personne eleve, List<BilanAbsenceInfo> absenceInfos ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesDemiPension =
+ absenceInfos.size()
+ }
+ }
+
+ private extraitAbsencesInternat(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ List<StatAbsences> listEleveStats) {
+
+ BilanAbsencesParPersonneInfo dataAbsencesDemiPension =
+ absencesParType[ABSENCES_INTERNAT]
+ dataAbsencesDemiPension.eachAbsence {
+ Personne eleve, List<BilanAbsenceInfo> absenceInfos ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesInternat =
+ absenceInfos.size()
+ }
+ }
+
+ private extraitDepartsAnticipes(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ List<StatAbsences> listEleveStats) {
+
+ BilanAbsencesParPersonneInfo dataAbsencesDemiPension =
+ absencesParType[DEPARTS_ANTICIPES]
+ dataAbsencesDemiPension.eachAbsence {
+ Personne eleve, List<BilanAbsenceInfo> absenceInfos ->
+ getStatsForEleve(eleve, listEleveStats).nbDepartsAnticipes =
+ absenceInfos.size()
+ }
+ }
+
+ private extraitAbsencesTotales(
+ BilanAbsencesParPersonneInfo datas,
+ PreferencesEtablissementAbsences preferences,
+ List<StatAbsences> listEleveStats) {
+
Map calculsAbsencesTotales = calculeNbAbsencesParEleve(
datas,
preferences
)
- // Ajoute pour chaque élève son nombre d'absences excusés
- calculsAbsencesExcuses.each { Personne eleve, Float nbAbsencesExcusees ->
- listEleveStats << new StatAbsences(
- eleve: eleve,
- nbAbsencesExcusees: arrondiSuperieur(nbAbsencesExcusees)
- )
+ // Ajoute pour chaque élève son nombre d'absences total
+ calculsAbsencesTotales.each { Personne eleve, Float nbAbsencesTotal ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesTotal =
+ arrondiSuperieur(nbAbsencesTotal)
}
+ }
- // Ajoute pour chaque élève son nombre d'absences non excusés
- calculsAbsencesNonExcuses.each { Personne eleve, Float nbAbsencesNonExcusees ->
- StatAbsences stateEleve = (StatAbsences) listEleveStats.find {
- it.eleve == eleve
- }
- if (!stateEleve) {
- stateEleve = new StatAbsences()
- listEleveStats << stateEleve
- stateEleve.eleve = eleve
- }
+ /**
+ * Retourne la ligne de stats correspondant à l'élève en la créant si nécessaire
+ * @param eleve
+ * @param listEleveStats
+ * @return une ligne de stats : StatAbsences
+ */
+ private StatAbsences getStatsForEleve(Personne eleve,
+ List<StatAbsences> listEleveStats) {
+ List<StatAbsences> result
+ StatAbsences statEleve = (StatAbsences) listEleveStats.find {
+ it.eleve == eleve
+ }
+ if (!statEleve) {
+ statEleve = new StatAbsences()
+ listEleveStats << statEleve
+ statEleve.eleve = eleve
+ }
+ statEleve
+ }
- stateEleve.nbAbsencesNonExcusees = arrondiSuperieur(nbAbsencesNonExcusees)
+ /**
+ * Extrait les absences non excusées
+ * @param absencesParType
+ * @param preferences
+ * @param listEleveStats
+ */
+ private extraitAbsencesNonExcusees(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ PreferencesEtablissementAbsences preferences,
+ List<StatAbsences> listEleveStats) {
+
+ Map calculsAbsencesNonExcuses = calculeNbAbsencesParEleve(
+ absencesParType[ABSENCES_NON_EXCUSEES],
+ preferences
+ )
+
+ calculsAbsencesNonExcuses.each { Personne eleve, Float nbAbsencesNonExcusees ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesNonExcusees =
+ arrondiSuperieur(nbAbsencesNonExcusees)
}
+ }
- // Ajoute pour chaque élève son nombre d'absences total
- calculsAbsencesTotales.each { Personne eleve, Float nbAbsencesTotal ->
- StatAbsences stateEleve = (StatAbsences) listEleveStats.find {
- it.eleve == eleve
- }
- if (!stateEleve) {
- stateEleve = new StatAbsences()
- listEleveStats << stateEleve
- stateEleve.eleve = eleve
- }
+ /**
+ * Extrait les absences justifiées recevables
+ * @param absencesParType
+ * @param preferences
+ * @param listEleveStats
+ */
+ private extraitAbsencesJustifieesRecevables(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ PreferencesEtablissementAbsences preferences,
+ List<StatAbsences> listEleveStats) {
- stateEleve.nbAbsencesTotal = arrondiSuperieur(nbAbsencesTotal)
+ Map calculsAbsencesJustifieesRecevables = calculeNbAbsencesParEleve(
+ absencesParType[ABSENCES_JUSTIFIEES_RECEVABLES],
+ preferences
+ )
+ calculsAbsencesJustifieesRecevables.each { Personne eleve, Float nbAbsences ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesJustifieesRecevables =
+ arrondiSuperieur(nbAbsences)
}
+ }
- return listEleveStats
+ /**
+ * Extrait les absences justifiées non recevables
+ * @param absencesParType
+ * @param preferences
+ * @param listEleveStats
+ */
+ private extraitAbsencesJustifieesNonRecevables(
+ Map<String, BilanAbsencesParPersonneInfo> absencesParType,
+ PreferencesEtablissementAbsences preferences,
+ List<StatAbsences> listEleveStats) {
+
+ Map calculsAbsencesJustifieesNonRecevables = calculeNbAbsencesParEleve(
+ absencesParType[ABSENCES_JUSTIFIEES_NON_RECEVABLES],
+ preferences
+ )
+
+ calculsAbsencesJustifieesNonRecevables.each { Personne eleve, Float nbAbsences ->
+ getStatsForEleve(eleve, listEleveStats).nbAbsencesJustifieesNonRecevables =
+ arrondiSuperieur(nbAbsences)
+ }
}
/**
* - la Personne élève
* - l'absenceJournee
*/
- Map<String, BilanAbsencesParPersonneInfo> separeAbsencesExcusesEtNonExcuses(BilanAbsencesParPersonneInfo datas,
- Motif motifSansMotif
+ Map<String, BilanAbsencesParPersonneInfo> separeAbsencesParType(
+ BilanAbsencesParPersonneInfo datas,
+ Motif motifSansMotif
) {
Map<String, BilanAbsencesParPersonneInfo> resultats = (Map<String, BilanAbsencesParPersonneInfo>) [:]
+
BilanAbsencesParPersonneInfo nonExcusees = new BilanAbsencesParPersonneInfo()
BilanAbsencesParPersonneInfo excusees = new BilanAbsencesParPersonneInfo()
+ BilanAbsencesParPersonneInfo excuseesRecevables = new BilanAbsencesParPersonneInfo()
+ BilanAbsencesParPersonneInfo excuseesNonRecevables = new BilanAbsencesParPersonneInfo()
+ BilanAbsencesParPersonneInfo demiPension = new BilanAbsencesParPersonneInfo()
+ BilanAbsencesParPersonneInfo internat = new BilanAbsencesParPersonneInfo()
+ BilanAbsencesParPersonneInfo departAnticipes = new BilanAbsencesParPersonneInfo()
datas.eachAbsence {
Personne personne, BilanAbsenceInfo absenceInfo ->
if (absenceInfo.appelLigne.motif == motifSansMotif) {
nonExcusees.ajouteAbsence(personne, absenceInfo)
+ if (absenceInfo.appelLigne.absenceJustifiee) {
+ excuseesRecevables.ajouteAbsence(personne, absenceInfo)
+ } else {
+ excuseesNonRecevables.ajouteAbsence(personne, absenceInfo)
+ }
} else {
excusees.ajouteAbsence(personne, absenceInfo)
}
+
+ if (absenceInfo.appelLigne.demiPension) {
+ demiPension.ajouteAbsence(personne, absenceInfo)
+ }
+
+ if (absenceInfo.appelLigne.internat) {
+ internat.ajouteAbsence(personne, absenceInfo)
+ }
+
+ if (absenceInfo.appelLigne.departAnticipe) {
+ departAnticipes.ajouteAbsence(personne, absenceInfo)
+ }
}
resultats.put((ABSENCES_EXCUSEES), excusees)
resultats.put((ABSENCES_NON_EXCUSEES), nonExcusees)
+ resultats.put((ABSENCES_JUSTIFIEES_RECEVABLES), excuseesRecevables)
+ resultats.put((ABSENCES_JUSTIFIEES_NON_RECEVABLES), excuseesNonRecevables)
+ resultats.put((ABSENCES_DEMI_PENSION), demiPension)
+ resultats.put((ABSENCES_INTERNAT), internat)
+ resultats.put((DEPARTS_ANTICIPES), departAnticipes)
return resultats
}
--- /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.applications.absences
+
+/**
+ * Définit les critères de recherche pour les incidents, punitions et sanctions
+ * @author jbui
+ */
+class DisciplineCriteresRecherche {
+ List<Long> elevePersonneIds
+ Date dateDebut
+ Date dateFin
+}
--- /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.applications.absences
+
+import org.lilie.services.eliot.absences.Punition
+
+/**
+ * Gestion des punitions.
+ * Etendu par AbsencePunitionService
+ * @author jbui
+ */
+class PunitionService {
+
+ /**
+ * @param criteres
+ * @return une liste de punitions correspondant aux critères
+ */
+ List<Punition> findPunitionsForCriteres(DisciplineCriteresRecherche criteres) {
+ if (criteres.elevePersonneIds) {
+ return []
+ }
+ String hql = """
+ from Punition
+ where date >= :dateDebut
+ and date <= :dateFin
+ and eleve.id in (:eleveIds)
+ """
+ return Punition.executeQuery(
+ hql,
+ [
+ dateDebut: criteres.dateDebut,
+ dateFin: criteres.dateFin,
+ eleveIds: criteres.elevePersonneIds
+ ]
+ )
+ }
+
+ /**
+ * @param criteres : critères de recherche
+ * @return les stats sur les punitions par élève selon les critères
+ */
+ List<StatPunitions> countPunitionsParEleveForCriteres(
+ DisciplineCriteresRecherche criteres){
+ if (!criteres.elevePersonneIds) {
+ return []
+ }
+ String hql = """
+ select new org.lilie.services.eliot.applications.absences.StatPunitions(pers, count(p.id))
+ from Punition as p
+ inner join p.eleve as pers
+ where date >= :dateDebut
+ and date <= :dateFin
+ and pers.id in (:eleveIds)
+ group by pers
+ """
+ return (List<StatPunitions>)Punition.executeQuery(
+ hql,
+ [
+ dateDebut: criteres.dateDebut,
+ dateFin: criteres.dateFin,
+ eleveIds: criteres.elevePersonneIds
+ ]
+ )
+ }
+}
--- /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.applications.absences
+
+import org.lilie.services.eliot.absences.Sanction
+
+/**
+ * Gestion des sanctions.
+ * Etendu par absenceSanctionService
+ * @author jbui
+ */
+class SanctionService {
+ /**
+ * @param criteres
+ * @return une liste de sanctions correspondant aux critères
+ */
+ List<Sanction> findSanctionsForCriteres(DisciplineCriteresRecherche criteres) {
+ if (criteres.elevePersonneIds) {
+ return []
+ }
+ String hql = """
+ from Sanction
+ where date >= :dateDebut
+ and date <= :dateFin
+ and eleve.id in (:eleveIds)
+ """
+ return Sanction.executeQuery(
+ hql,
+ [
+ dateDebut: criteres.dateDebut,
+ dateFin: criteres.dateFin,
+ eleveIds: criteres.elevePersonneIds
+ ]
+ )
+ }
+
+ /**
+ * @param criteres : critères de recherche
+ * @return les stats sur les sanctions par élève selon les critères
+ */
+ List<StatSanctions> countSanctionsParEleveForCriteres(
+ DisciplineCriteresRecherche criteres){
+ if (!criteres.elevePersonneIds) {
+ return []
+ }
+ String hql = """
+ select new org.lilie.services.eliot.applications.absences.StatSanctions(pers, count(s.id))
+ from Sanction as s
+ inner join s.eleve as pers
+ where date >= :dateDebut
+ and date <= :dateFin
+ and pers.id in (:eleveIds)
+ group by pers
+ """
+ return (List<StatSanctions>)Sanction.executeQuery(
+ hql,
+ [
+ dateDebut: criteres.dateDebut,
+ dateFin: criteres.dateFin,
+ eleveIds: criteres.elevePersonneIds
+ ]
+ )
+ }
+
+}
Integer nbAbsencesExcusees = 0
Integer nbAbsencesNonExcusees = 0
Integer nbAbsencesTotal = 0
+ Integer nbAbsencesJustifieesRecevables = 0
+ Integer nbAbsencesJustifieesNonRecevables = 0
+ Integer nbAbsencesDemiPension = 0
+ Integer nbAbsencesInternat = 0
+ Integer nbDepartsAnticipes = 0
+ Integer nbPunitions = 0
+ Integer nbSanctions = 0
}
--- /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.applications.absences
+
+import org.lilie.services.eliot.scolarite.Personne
+
+/**
+ * Représente une statistique sur les punitions d'un élève
+ * @author jbui
+ */
+class StatPunitions {
+ Personne eleve
+ Integer nbPunitions = 0
+
+ StatPunitions(Personne eleve, Long nbPunitions){
+ this.eleve = eleve
+ this.nbPunitions = nbPunitions
+ }
+}
--- /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.applications.absences
+
+import org.lilie.services.eliot.scolarite.Personne
+
+/**
+ * Représente les stats sur les sanctions d'un élève
+ * @author jbui
+ */
+class StatSanctions {
+ Personne eleve
+ Integer nbSanctions = 0
+
+ StatSanctions(Personne eleve, Long nbSanctions){
+ this.eleve = eleve
+ this.nbSanctions = nbSanctions
+ }
+
+}
import net.sf.jasperreports.engine.export.JRPdfExporter
import org.lilie.services.eliot.impression.utils.ChampMemosResolver
import net.sf.jasperreports.engine.JasperReport
-import net.sf.jasperreports.engine.util.JRLoader
import net.sf.jasperreports.engine.design.JasperDesign
import net.sf.jasperreports.engine.xml.JRXmlLoader
import org.lilie.services.eliot.impression.constantes.ConfigImpression
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.scolarite.etablissement.PreferenceEtablissementService
-import net.sf.jasperreports.engine.export.JRXlsExporter
-import net.sf.jasperreports.engine.JRPrintPage
-import net.sf.jasperreports.engine.export.JRHtmlExporter
-import net.sf.jasperreports.engine.export.JRHtmlExporterParameter
+import org.lilie.services.eliot.impression.template.ImpressionTemplateFactoryService
+import org.lilie.services.eliot.impression.image.ImpressionImageService
+import org.lilie.services.eliot.impression.image.ImageType
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import net.sf.jasperreports.engine.export.JRXmlExporter
/**
* Service d'org.lilie.services.eliot.impression
static transactional = false
PreferenceEtablissementService preferenceEtablissementService
+ ImpressionTemplateFactoryService impressionTemplateFactoryService
+ ImpressionImageService impressionImageService
public ImpressionMoteurService() {
System.setProperty("java.awt.headless", "true")
}
/**
- * fusion pour les documents systèmes (eliot)
- * @param etab : etablissement
- * @param codeTemplateDocument : code du template
- * @param data : données pour la fusion
- * @return objet descriptif du document final
- * @throws ImpressionServiceException
+ * Impression d'un état système en PDF
+ * @param etab
+ * @param codeTemplateDocument
+ * @param data
+ * @return
*/
- JasperPrint fusionne(Etablissement etab,
- String codeTemplateDocument,
- List data) {
-
+ public ByteArrayOutputStream creePdf(Etablissement etab,
+ String codeTemplateDocument,
+ Object data
+ ) {
TemplateDocument templateDocument = TemplateDocument.findByCode(
codeTemplateDocument
)
- if (!templateDocument){
+ if (!templateDocument) {
throw new IllegalStateException("Le modèle $codeTemplateDocument n'existe pas en base.")
}
- return fusionne(etab, (TemplateDocument)templateDocument, data)
- }
-
- /**
- * Impression d'un état système en PDF
- * @param etab
- * @param codeTemplateDocument
- * @param data
- * @return
- */
- ByteArrayOutputStream creePdf(Etablissement etab,
- String codeTemplateDocument,
- List data
- ) {
- JasperPrint jasperPrint = fusionne(etab, codeTemplateDocument, data)
+ JasperPrint jasperPrint = construitJasperPrint(data, etab, templateDocument)
return printPdf(jasperPrint)
}
/**
- * Impression d'un état système en PDF
+ * Imprime un document en pdf
* @param etab
- * @param codeTemplateDocument
+ * @param templateDocument
* @param data
* @return
*/
- ByteArrayOutputStream creeXls(Etablissement etab,
- String codeTemplateDocument,
- List data
- ) {
- JasperPrint jasperPrint = fusionne(etab, codeTemplateDocument, data)
- return printXls(jasperPrint)
+ public ByteArrayOutputStream creePdf(Etablissement etab,
+ TemplateDocument templateDocument,
+ Object data) {
+
+ JasperPrint jasperPrint = construitJasperPrint(
+ data,
+ etab,
+ templateDocument
+ )
+
+ return printPdf(jasperPrint)
}
/**
public void pdfToOutputStream(OutputStream outputStream,
Etablissement etab,
TemplateDocument templateDocument,
- List data
+ Object data
) {
- JasperPrint jasperPrint = fusionne(etab, templateDocument, data)
- printPdf(outputStream, jasperPrint)
- }
- /**
- * Imprime un document en pdf
- * @param etab
- * @param templateDocument
- * @param data
- * @return
- */
- ByteArrayOutputStream creePdf(Etablissement etab,
- TemplateDocument templateDocument,
- List data) {
- JasperPrint jasperPrint = fusionne(etab, templateDocument, data)
- return printPdf(jasperPrint)
+ JasperPrint jasperPrint = construitJasperPrint(
+ data,
+ etab,
+ templateDocument
+ )
+
+ printPdf(
+ outputStream,
+ jasperPrint
+ )
+
}
/**
- * Imprime un document en html
+ * Construit le jasperprint résultat en fonction des données contenus dans data. Tiens compte de la structure de
+ * données dans data (List ou DonneesOptions)
+ * @param data
* @param etab
* @param templateDocument
- * @param data
* @return
*/
- ByteArrayOutputStream creeHtml(Etablissement etab,
- TemplateDocument templateDocument,
- List data) {
- JasperPrint jasperPrint = fusionne(etab, templateDocument, data)
- return printHtml(jasperPrint)
- }
+ public JasperPrint construitJasperPrint(Object data, Etablissement etab, TemplateDocument templateDocument) {
+ JasperPrint jasperPrint
+
+ switch (data.getClass()) {
+ case List:
+
+ jasperPrint = fusionne(etab, templateDocument, (List) data)
+ break
+
+ case DonneesOptions:
+
+ DonneesOptions donneesOptions = (DonneesOptions) data
+
+ jasperPrint = fusionne(
+ etab,
+ templateDocument,
+ donneesOptions.data,
+ donneesOptions.options
+ )
+
+ break
+ default:
+ throw new IllegalArgumentException("Les données passés en paramètre sont erronées.")
+
+ }
+
+ return jasperPrint
+ }
/**
* fusionne le modèle utilisateur et les données pour retourner un descriptif du
* @param data données de publipostage
* @return un objet JasperPrint
*/
- JasperPrint fusionne(Etablissement etab,
- TemplateDocument templateDocument,
- List data) throws ImpressionServiceException {
- log.info("fusionne : " + templateDocument.nom)
+ private JasperPrint fusionne(Etablissement etab,
+ TemplateDocument templateDocument,
+ List data,
+ Object options = null) throws ImpressionServiceException {
+
+ log.info("Fusionne : " + templateDocument.nom)
JasperPrint jasperPrint = null
try {
// tests preliminaires
TemplateJasper templateJasper =
- templateDocument?.templateEliot?.templateJasper
+ templateDocument?.templateEliot?.templateJasper
if (templateJasper?.jasper == null) {
throw new ImpressionServiceException(
)
}
- JasperReport jasperReport = binaryTemplateJasperFactory(
- templateJasper
+ log.info("Chargement modèle principal")
+
+ JasperReport jasperReport = impressionTemplateFactoryService.binaryTemplateJasperFactory(
+ templateDocument,
+ templateJasper,
+ options
+ )
+
+ // résoud les champs memos
+ gestionChampsMemo(
+ templateDocument,
+ data
)
- // resoud les champs memos
- gestionChampsMemo(templateDocument, data)
-
// cree le datasource
JRBeanCollectionDataSource jrBeanCollectionDataSource =
- new JRBeanCollectionDataSource(data)
+ new JRBeanCollectionDataSource(data)
// Set les parametres
ListeParametresImpression parameters = findParametresTemplateDocument(
- templateDocument
+ templateDocument,
+ options
+ )
+
+ // gestion d'éventuels options
+ parameters = gestionParametreOptions(
+ etab,
+ templateDocument,
+ parameters,
+ options
)
// gestion du logo
- gestionLogo(
+ parameters = gestionLogo(
etab,
templateDocument,
- parameters)
+ parameters
+ )
// gestion du cachet
- gestionCachet(
+ parameters = gestionCachet(
etab,
templateDocument,
- parameters)
+ parameters
+ )
// lance la fusion
log.info("fusion jasper")
return jasperPrint
}
+ /**
+ * Gestion des zones de mémo
+ * @param templateDocument
+ * @param data
+ */
private void gestionChampsMemo(TemplateDocument templateDocument, List data) {
- log.info("debut gestionChampsMemo")
+
+ log.info("Gestion champs memo")
+
List<TemplateChampMemo> champMemoList =
- TemplateChampMemo.findAllByTemplateDocument(templateDocument)
+ TemplateChampMemo.findAllByTemplateDocument(templateDocument)
if (champMemoList) {
try {
log.error "Gestion memo:" + e.message
}
}
- log.info("fin gestionChampsMemo")
+
}
+ /**
+ * Permet de charger un paramètre complementaire pour le modèle jasper. Ce paramètre
+ * dépend complètement du type d'état et n'est pas obligatoire.
+ * @param etab
+ * @param templateDocument
+ * @param parameters
+ * @param options
+ */
+ private ListeParametresImpression gestionParametreOptions(Etablissement etab,
+ TemplateDocument templateDocument,
+ ListeParametresImpression parameters,
+ Object options) {
- private void gestionCachet(Etablissement etab,
- TemplateDocument templateDocument,
- ListeParametresImpression parameters) {
- log.info("Gestion cachet")
-// set le parametre correspondant au cachet si un element image est trouvé
- byte[] logoAsBytes = preferenceEtablissementService.getCachet(etab)
- if (logoAsBytes) {
+ log.info("Gestion paramètre complémentaire")
- String jrxml = templateDocument.templateEliot.templateJasper.jrxml
- if (jrxml == null) {
- throw new ImpressionServiceException(
- "Aucun template jrxml pour template utilisateur ${templateDocument}"
- )
- }
+ if (options) {
- ByteArrayInputStream is = new ByteArrayInputStream(
- jrxml.getBytes(ConfigImpression.DEFAULT_ENCODING)
+ return affecteParametre(
+ templateDocument,
+ parameters,
+ ConfigImpression.PARAM_OPTIONS,
+ options
)
- JasperDesign jasperDesign = JRXmlLoader.load(is)
- if (jasperDesign.parametersMap.get(ConfigImpression.PARAM_CACHET)) {
- parameters.put(
- ConfigImpression.PARAM_CACHET,
- new ByteArrayInputStream(logoAsBytes)
- )
- }
}
+
+ return parameters
+
}
- private void gestionLogo(Etablissement etab,
- TemplateDocument templateDocument,
- ListeParametresImpression parameters) {
- log.info("Gestion logo")
-// set le parametre correspondant au logo si un element image est trouvé
- byte[] logoAsBytes = preferenceEtablissementService.getLogo(etab)
- if (logoAsBytes) {
+ /**
+ * Gestion du cachet
+ * @param etab
+ * @param templateDocument
+ * @param parameters
+ * @return la liste parameters avec le cachet en plus
+ */
+ private ListeParametresImpression gestionCachet(Etablissement etab,
+ TemplateDocument templateDocument,
+ ListeParametresImpression parameters) {
- String jrxml = templateDocument.templateEliot.templateJasper.jrxml
- if (jrxml == null) {
- throw new ImpressionServiceException(
- "Aucun template jrxml pour template utilisateur ${templateDocument}"
- )
- }
+ log.info("Gestion cachet")
- ByteArrayInputStream is = new ByteArrayInputStream(
- jrxml.getBytes(ConfigImpression.DEFAULT_ENCODING)
- )
+ return chargeImageDansParametre(
+ ImageType.CACHET,
+ ConfigImpression.PARAM_CACHET,
+ etab,
+ templateDocument,
+ parameters
+ )
+
+ }
+
+ private ListeParametresImpression gestionLogo(Etablissement etab,
+ TemplateDocument templateDocument,
+ ListeParametresImpression parameters) {
+ log.info("Gestion logo")
+
+ return chargeImageDansParametre(
+ ImageType.LOGO,
+ ConfigImpression.PARAM_LOGO,
+ etab,
+ templateDocument,
+ parameters
+ )
- JasperDesign jasperDesign = JRXmlLoader.load(is)
- if (jasperDesign.parametersMap.get(ConfigImpression.PARAM_LOGO)) {
- parameters.put(
- ConfigImpression.PARAM_LOGO,
- new ByteArrayInputStream(logoAsBytes)
- )
- }
- }
}
/**
- * Lecture des modèles jasper en base et préparation des paramètres pour jasperReport
- * @param templateDocument
- * @return Liste des paramètres sous la forme nom=objet
- * nom est de type string et object contient un objet JasperReport
+ * Permet de charger les données d'une image dans un paramètre de modèle jasper
+ * @param imageType : type d'image à charger
+ * @param nomParametre : nom du paramètre dans le modèle jasper
+ * @param etab : etablissement concerné
+ * @param templateDocument : modèle concerné
+ * @param parameters : objet contenant la liste des paramètres
*/
- private ListeParametresImpression findParametresTemplateDocument(TemplateDocument templateDocument)
- {
- ListeParametresImpression parameters = new ListeParametresImpression()
- // set les parametres correspondant au sous template
- List<TemplateDocumentSousTemplateEliot> docSsTemplatesEliot =
- TemplateDocumentSousTemplateEliot.findAllByTemplateDocument(templateDocument)
+ private ListeParametresImpression chargeImageDansParametre(ImageType imageType,
+ String nomParametre,
+ Etablissement etab,
+ TemplateDocument templateDocument,
+ ListeParametresImpression parameters) {
- docSsTemplatesEliot.each {
- TemplateDocumentSousTemplateEliot templateDocumentSousTemplateEliot ->
+// set le parametre correspondant au cachet si un element image est trouvé
+ byte[] image = impressionImageService.load(
+ imageType,
+ etab,
+ templateDocument
+ )
- log.info("Chargement " + templateDocumentSousTemplateEliot.param)
- // fsil : le champ param de l'entite TemplateDocumentSousTemplateEliot n'est
- //pas utilise. Le champ param de l'entite TemplateJasper est preferee.
- // resoud les parametres des sous templates
- TemplateJasper currentTemplateJasper =
- templateDocumentSousTemplateEliot.templateEliot?.templateJasper
+ if (image) {
+ if (image.length != 0) {
- while (currentTemplateJasper) {
- JasperReport jasperReport = binaryTemplateJasperFactory(
- currentTemplateJasper
+ affecteParametre(
+ templateDocument,
+ parameters,
+ nomParametre,
+ new ByteArrayInputStream(image)
)
- parameters.put(currentTemplateJasper.param, jasperReport)
- currentTemplateJasper = currentTemplateJasper.sousTemplate
}
}
+
return parameters
+
}
/**
- * Lecture des données binaires compilés
- * @param currentTemplateJasper
- * @return
+ * Modifie la liste des paramètres avec une nouvelle valeur de paramètre
+ * @param templateDocument : modèle concerné
+ * @param parameters : liste de paramètres
+ * @param nom : nom du paramètre dans la liste
+ * @param parametre : nouvelle valeur
+ * @return la liste modifiée
*/
- private JasperReport binaryTemplateJasperFactory(TemplateJasper currentTemplateJasper) {
-
- ByteArrayInputStream modeleBinaire = new ByteArrayInputStream(
- currentTemplateJasper.jasper
- )
+ private ListeParametresImpression affecteParametre(TemplateDocument templateDocument,
+ ListeParametresImpression parameters,
+ String nom,
+ Object parametre) {
- JasperReport jasperReport = (JasperReport) JRLoader.loadObject(modeleBinaire)
- return jasperReport
- }
+ if (!parameters) {
+ throw new IllegalArgumentException("La liste des paramètre n'est pas définie.")
+ }
-/**
- * Imprime le descriptif du document au format PDF
- * @param jasperPrint document final à imprimer
- * @return un tableau d'octet contenant le fichier PDF
- */
- ByteArrayOutputStream printPdf(JasperPrint jasperPrint
- ) throws ImpressionServiceException {
- ByteArrayOutputStream byteArray = null
- try {
- byteArray = new ByteArrayOutputStream()
- JRExporter jrExporter = new JRPdfExporter()
+ String jrxml = templateDocument.templateEliot.templateJasper.jrxml
- jrExporter.setParameter(
- JRExporterParameter.OUTPUT_STREAM,
- byteArray
+ if (jrxml == null) {
+ throw new ImpressionServiceException(
+ "Aucun template jrxml pour template utilisateur ${templateDocument}"
)
+ }
- jrExporter.setParameter(
- JRExporterParameter.JASPER_PRINT,
- jasperPrint
+ ByteArrayInputStream is = new ByteArrayInputStream(
+ jrxml.getBytes(ConfigImpression.DEFAULT_ENCODING)
+ )
+
+ JasperDesign jasperDesign = JRXmlLoader.load(is)
+ if (jasperDesign.parametersMap.get(nom)) {
+ parameters.put(
+ nom,
+ parametre
)
- jrExporter.exportReport()
- } catch (Exception e) {
- log.error e.message
- throw new ImpressionServiceException("L'export PDF a echoue.", e)
}
- return byteArray
-
+ return parameters
}
/**
- * Imprime le descriptif du document au format HTML
- * Permettra de faire une version plus "wysiwig" en ajoutant les boutons sur les controle
- * @param jasperPrint document final à imprimer
- * @return un tableau d'octet contenant le fichier PDF
+ * Lecture des modèles jasper en base et préparation des paramètres pour jasperReport
+ * @param templateDocument
+ * @return Liste des paramètres sous la forme nom=objet
+ * nom est de type string et object contient un objet JasperReport
*/
- ByteArrayOutputStream printHtml(JasperPrint jasperPrint
- ) throws ImpressionServiceException {
- ByteArrayOutputStream byteArray = null
- try {
- byteArray = new ByteArrayOutputStream()
- JRExporter jrExporter = new JRHtmlExporter()
+ private ListeParametresImpression findParametresTemplateDocument(TemplateDocument templateDocument, Object options) {
- jrExporter.setParameter(
- JRExporterParameter.OUTPUT_STREAM,
- byteArray
- )
+ ListeParametresImpression parameters = new ListeParametresImpression()
- jrExporter.setParameter(
- JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN,
- false
- )
+ // set les parametres correspondant au sous template
+ List<TemplateDocumentSousTemplateEliot> docSsTemplatesEliot =
+ TemplateDocumentSousTemplateEliot.findAllByTemplateDocument(templateDocument)
- jrExporter.setParameter(
- JRExporterParameter.JASPER_PRINT,
- jasperPrint
- )
- jrExporter.exportReport()
- } catch (Exception e) {
- log.error e.message
- throw new ImpressionServiceException("L'export HTML a echoue.", e)
- }
+ docSsTemplatesEliot.each {
+ TemplateDocumentSousTemplateEliot templateDocumentSousTemplateEliot ->
- return byteArray
+ TemplateJasper currentTemplateJasper =
+ templateDocumentSousTemplateEliot.templateEliot?.templateJasper
- }
+ while (currentTemplateJasper) {
+
+ log.info("Chargement sous-modèle " + currentTemplateJasper.param)
+
+ JasperReport jasperReport = impressionTemplateFactoryService.binaryTemplateJasperFactory(
+ templateDocument,
+ currentTemplateJasper,
+ options
+ )
+
+ parameters.put(
+ currentTemplateJasper.param,
+ jasperReport
+ )
+
+ currentTemplateJasper = currentTemplateJasper.sousTemplate
+ }
+
+ }
+ return parameters
+ }
/**
* Imprime le descriptif du document au format PDF
* @param jasperPrint document final à imprimer
* @return un tableau d'octet contenant le fichier PDF
*/
- ByteArrayOutputStream printXls(JasperPrint jasperPrint
+ private ByteArrayOutputStream printPdf(JasperPrint jasperPrint
) throws ImpressionServiceException {
ByteArrayOutputStream byteArray = null
try {
byteArray = new ByteArrayOutputStream()
- JRExporter jrExporter = new JRXlsExporter()
+ JRExporter jrExporter = new JRPdfExporter()
jrExporter.setParameter(
JRExporterParameter.OUTPUT_STREAM,
jrExporter.exportReport()
} catch (Exception e) {
log.error e.message
- throw new ImpressionServiceException("L'export XLS a echoue.", e)
+ throw new ImpressionServiceException("L'export PDF a echoue.", e)
}
return byteArray
* @param jasperPrint document final à imprimer
* @return un tableau d'octet contenant le fichier PDF
*/
- public void printPdf(OutputStream outputStream,
- JasperPrint jasperPrint
+ private void printPdf(OutputStream outputStream,
+ JasperPrint jasperPrint
) throws ImpressionServiceException {
try {
}
/**
- * fusionne plusieurs rapports
- * @param reportsList : liste d'impressions à fusionner
- * @return un seul rapport
+ * fusion pour les documents systèmes (eliot)
+ * @param etab : etablissement
+ * @param codeTemplateDocument : code du template
+ * @param data : données pour la fusion
+ * @return objet descriptif du document final
+ * @throws ImpressionServiceException
*/
- public JasperPrint mergeRapports(List<JasperPrint> reportsList) {
-
- JasperPrint jrPrint = new JasperPrint()
-
- // c'est le premier rapport qui va donner les informations
- // générales de pagination. On part du principe que tous
- // les rapports sont paginés de la même manière
- JasperPrint jp = reportsList.get(0)
-
- jrPrint.setOrientation(jp.getOrientation())
- jrPrint.setLocaleCode(jp.getLocaleCode())
- jrPrint.setPageHeight(jp.getPageHeight())
- jrPrint.setPageWidth(jp.getPageWidth())
- jrPrint.setTimeZoneId(jp.getTimeZoneId())
- jrPrint.setName(jp.getName())
-
- // on parcourt les rapports
- for (int i = 0; i < reportsList.size(); i++) {
+ private JasperPrint fusionne(Etablissement etab,
+ String codeTemplateDocument,
+ List data,
+ Object options) {
- jp = reportsList.get(i)
- List list = jp.getPages()
-
- // on parcourt les pages des rapports
- for (int j = 0; j < list.size(); j++) {
- jrPrint.addPage((JRPrintPage) list.get(j))
- }
+ TemplateDocument templateDocument = TemplateDocument.findByCode(
+ codeTemplateDocument
+ )
+ if (!templateDocument) {
+ throw new IllegalStateException("Le modèle $codeTemplateDocument n'existe pas en base.")
}
- return jrPrint;
-
+ return fusionne(etab, (TemplateDocument) templateDocument, data, options)
}
}
import org.lilie.services.eliot.scolarite.anneescolaire.AnneeScolaireService
import org.lilie.services.eliot.CodeComparator
import org.lilie.services.eliot.impression.constantes.TypeMedia
+import org.lilie.services.eliot.scolarite.structureenseignement.EffectifsClasseGroupe
/**
* Ce service a pour but de rechercher les données générales des élèves pour les
}
Map classesProfPrincipaux =
- enseignantAnnuaireService.findAllProfesseurPrincipalForAllClasse(
- securiteSession,
- (List<StructureEnseignement>) (elevesClasse.values()).toList()
- )
+ enseignantAnnuaireService.findAllProfesseurPrincipalForAllClasse(
+ securiteSession,
+ (List<StructureEnseignement>) (elevesClasse.values()).toList()
+ )
Map elevesResponsables =
- responsableEleveService.findAllResponsableForAllEleve(
- eleves,
- [1, 2]
- )
+ responsableEleveService.findAllResponsableForAllEleve(
+ eleves,
+ [1, 2]
+ )
AnneeScolaire anneeScolaire = anneeScolaireService.anneeScolaireEnCours()
String anneeDebut = (anneeScolaire?.extraitAnneeDebut()) ?: ''
eleves.each { Personne eleve ->
StructureEnseignement classeEleve =
- (StructureEnseignement) elevesClasse[eleve]
+ (StructureEnseignement) elevesClasse[eleve]
List<Personne> responsablesClasse =
- (List<Personne>) classesProfPrincipaux[classeEleve]
+ (List<Personne>) classesProfPrincipaux[classeEleve]
List<ResponsableEleve> responsablesLegaux =
- (List<ResponsableEleve>) elevesResponsables[eleve]
+ (List<ResponsableEleve>) elevesResponsables[eleve]
ResponsableEleve premierResponsableLegal =
- (ResponsableEleve) responsablesLegaux.find {it.responsableLegal == 1}
+ (ResponsableEleve) responsablesLegaux.find {it.responsableLegal == 1}
ResponsableEleve deuxiemeResponsableLegal =
- (ResponsableEleve) responsablesLegaux.find {it.responsableLegal == 2}
+ (ResponsableEleve) responsablesLegaux.find {it.responsableLegal == 2}
EleveImpressionInfo info = this.getInfosSpecifiqueEleve(
clazzEleve,
selectionAdresseResponsableEnum
)
+ EffectifsClasseGroupe effectifClasseGroupe = localStructureEnseignementService.
+ findEffectifsClasseGroupe([classeEleve])
+ info.classe_Effectif = effectifClasseGroupe.getEffectifClasse(classeEleve)
+
info.typeMedia = typeMedia
// infos communs
info.responsable1 = premierResponsableLegal?.personne
info.responsable2 = deuxiemeResponsableLegal?.personne
- info.structureEnseignement= classeEleve
+ info.structureEnseignement = classeEleve
info.personneId = eleve.id
info.personne = eleve
import grails.validation.ValidationException
import org.lilie.services.eliot.sms.SmsStatut
import org.lilie.services.eliot.sms.SmsFournisseurService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
class ImpressionSuiviEleveService {
SmsFournisseurEtablissement smsFournisseurEtablissement = null
if (media == TypeMedia.SMS) {
- smsFournisseurEtablissement =
+ smsFournisseurEtablissement =
smsFournisseurService.getFournisseurEtablissementActif(etablissement)
}
) {
Map classeEleves =
- localStructureEnseignementService.findAllClassesForAllEleves(personneEleves)
+ localStructureEnseignementService.findAllClassesForAllEleves(personneEleves)
personneEleves.each {
Personne eleve ->
* @param demandeur
* @param periode
*/
- public void traceImpressionCourrierDiffere(List<EleveImpressionInfo> eleveImpressionInfos,
+ public void traceImpressionCourrierDiffere(Object donnees,
TemplateDocument templateDocument,
TemplateTypeFonctionnaliteEnum templateTypeFonctionnaliteEnum,
Etablissement etablissementCourant,
String periode = ""
) {
+ List<EleveImpressionInfo> eleveImpressionInfos = []
+
+ switch (donnees.getClass()) {
+ case List:
+ eleveImpressionInfos = (List<EleveImpressionInfo>) donnees
+ break
+
+ case DonneesOptions:
+ DonneesOptions donneesOptions = (DonneesOptions) donnees
+ eleveImpressionInfos = (List<EleveImpressionInfo>) donneesOptions.data
+ break
+
+ default:
+
+ throw new IllegalStateException("La classe des données est incorrecte : " +
+ donnees.getClass().getCanonicalName())
+ }
+
Set<Personne> personneEleves = []
eleveImpressionInfos.each { EleveImpressionInfo eleveImpressionInfo ->
personneEleves << eleveImpressionInfo.personne
}
TemplateTypeFonctionnalite templateTypeFonctionnalite =
- TemplateTypeFonctionnalite.findByCode(
- templateTypeFonctionnaliteEnum.toString()
- )
+ TemplateTypeFonctionnalite.findByCode(
+ templateTypeFonctionnaliteEnum.toString()
+ )
traceImpressionCourrier(
personneEleves,
package org.lilie.services.eliot.impression
/**
- * Created by IntelliJ IDEA.
- * User: olivier
- * Date: 21 sept. 2011
- * Time: 09:27:38
- * To change this template use File | Settings | File Templates.
+ * Contient la liste des paramètres à passer à un modèle jasper
+ * String : nom du paramètre dans le modèle jasper
+ * Object : valeur du paramètre
+ * @author othe
*/
class ListeParametresImpression extends HashMap<String, Object>{
}
package org.lilie.services.eliot.impression.batch
import org.lilie.services.eliot.scolarite.Personne
-import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
+
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.impression.publipostage.PublipostageParametresService
import org.lilie.services.eliot.demon.DemandeTraitement
import org.codehaus.groovy.grails.web.json.JSONObject
-import grails.converters.JSON
+
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
/**
* Ce service assure le traitement des demandes d'impressions différées
ImpressionMoteurService impressionMoteurService
ImpressionSuiviEleveService impressionSuiviEleveService
PublipostageStockageFichierService publipostageStockageFichierService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
// ce service dépend de l'application (notes ou absences)
PublipostageRequetageService publipostageRequetageService
Etablissement etablissement,
TemplateDocument template,
TemplateTypeFonctionnaliteEnum typeFonctionnalite,
- List<EleveImpressionInfo> eleveImpressionInfos,
+ def eleveImpressionInfos,
Personne demandeur,
String periode = ""
) {
OutputStream outputStream =
- publipostageStockageFichierService.getFichierOutputStream(
- securiteSession,
- demande
- )
+ publipostageStockageFichierService.getFichierOutputStream(
+ securiteSession,
+ demande
+ )
impressionMoteurService.pdfToOutputStream(
outputStream,
SecuriteSession securiteSession = publipostageRequetageService.
getSecuriteSessionSysteme(etablissement)
- List<EleveImpressionInfo> eleveImpressionInfos = publipostageRequetageService.
+ Object eleveImpressionInfos = publipostageRequetageService.
lectureDonneesEleve(
- securiteSession,
- etablissement,
- template,
- demande
- )
+ securiteSession,
+ etablissement,
+ template,
+ demande
+ )
String libelleTypePeriode = (params.libelleTypePeriode == JSONObject.NULL) ?
"" : params.libelleTypePeriode.toString()
* @param demande : paramètres de la demandes
* @return : la liste des données des élèves correspondant à la demande
*/
- List<EleveImpressionInfo> lectureDonneesEleve(
+ Object lectureDonneesEleve(
SecuriteSession securiteSession,
Etablissement etablissement,
TemplateDocument template,
* le nom du parametre décrivant le cachet de l'établissement
*/
static final String PARAM_CACHET = "cachet"
+
+/**
+ * le nom des options d'impression
+ */
+ static final String PARAM_OPTIONS = "options"
/**
* La taille max du logo en ko
*/
package org.lilie.services.eliot.impression.constantes
+/**
+ * Type d'élément composant un état eliot. Permet de définir au niveau front l'éditeur qui va avec.
+ * Note complémentaire : dans les différentes parties de l'éditeur on emploi pour désigner la même
+ * chose les notions d'élément et de zone.
+ * @author othe
+ */
public enum TypeZone {
+ // zone de texte éditable par l'utilisateur
MEMO(1),
+ // zone de texte non éditable par l'utilisateur. Ne revient donc jamais lors d'un enregsitrement
TEXT(2),
+ // zone de sous-modèle (tableau)
SOUSMODEL(3),
+ // zone d'edition du logo
LOGO(4),
- CACHET(5)
+ // zone d'edition du cachat
+ CACHET(5),
+ //zone des options d'impression du bulletin
+ BULLETIN(6)
private int code
--- /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.impression.donnees
+
+/**
+ * Représente les données necessaires pour imprimer un bulletin de notes
+ * @author othe
+ */
+class DonneesOptions {
+ List data
+ Object options
+}
String eleve_Classe
@ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES, ModuleEliot.BREVET, ModuleEliot.SMS])
String eleve_ClasseLibelleLong
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ String classe_Effectif = ""
@ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES, ModuleEliot.BREVET, ModuleEliot.SMS])
String eleve_DateNaissance
@ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES, ModuleEliot.BREVET, ModuleEliot.SMS])
Integer eleve_NbAbsNonExc = 0
@ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES, ModuleEliot.SMS])
Integer eleve_NbAbsExc = 0
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ Integer eleve_NbAbsJusRec = 0
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ Integer eleve_NbAbsJusNonRec = 0
+
+
@ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES, ModuleEliot.SMS])
Integer eleve_NbAbsence = 0
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ String eleve_NbAbsDemiPens = ""
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ String eleve_NbAbsInternat = ""
+
@ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES, ModuleEliot.SMS])
Integer eleve_NbRetard = 0
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ String eleve_NbDepAnti = ""
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ String eleve_NbPunitions = ""
+ @ChampPublipostage(applications = [ModuleEliot.ELIOT_ABSENCES, ModuleEliot.ELIOT_NOTES])
+ String eleve_NbSanctions = ""
+
@ChampPublipostage(applications = [ModuleEliot.ELIOT_NOTES])
String eleve_ApprGenerale
}
-
}
String prof // nom de prof (Nom + prenom) ou des profs pour le cas de co-enseignement
List<SousMatiereImpressionInfo> sousMatieres = []
- /**
- * Nombre de notes pour la sous-matière.
- * @return Integer
- */
- Integer getNbNotes() {
- if (sousMatieres?.size() > 0) {
- return sousMatieres.collect {it.nbNotes}.sum()
- } else {
- return super.nbNotes
- }
- }
}
* (l'echelle)
*/
class NoteImpressionInfo {
+ // titre
String libelle
+ // note
String note
+ // coeff
+ String coeff
+ //type
+ String typeNote
+ // date
+ String date
+
String noteMax
+
}
-/*\r
- * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009\r
- * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).\r
- *\r
- * Lilie is free software. You can redistribute it and/or modify since\r
- * you respect the terms of either (at least one of the both license) :\r
- * - under the terms of the GNU Affero General Public License as\r
- * published by the Free Software Foundation, either version 3 of the\r
- * License, or (at your option) any later version.\r
- * - the CeCILL-C as published by CeCILL-C; either version 1 of the\r
- * License, or any later version\r
- *\r
- * There are special exceptions to the terms and conditions of the\r
- * licenses as they are applied to this software. View the full text of\r
- * the exception in file LICENSE.txt in the directory of this software\r
- * distribution.\r
- *\r
- * Lilie is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
- * Licenses for more details.\r
- *\r
- * You should have received a copy of the GNU General Public License\r
- * and the CeCILL-C along with Lilie. If not, see :\r
- * <http://www.gnu.org/licenses/> and\r
- * <http://www.cecill.info/licences.fr.html>.\r
- */\r
-\r
-package org.lilie.services.eliot.impression.donnees.eleve\r
-\r
-/**\r
- * Informations concernant les sous-matières\r
- */\r
-class SousMatiereImpressionInfo {\r
- // Nom de la matière/sous-matière (libellé court)\r
- String libelle = ""\r
- // moyennes de l'élève et de la classe par trimestre\r
-\r
- String moyenneClasse = null\r
- String moyenneEleve = null\r
-\r
- String rang = ""\r
-\r
- String moyenneMin = null // min moyenne des élèves de classe\r
- String moyenneMax = null // max moyenne des élèves de classe\r
-\r
- Integer nbNotes = null\r
- // coefficient de la matiere/sous-matiere\r
- String coeff = null\r
-\r
- String appreciation = null\r
-\r
- // liste des notes\r
- List<NoteImpressionInfo> noteImpressions = []\r
-\r
- /**\r
- * Retourne une liste formatée de notes.\r
- * Utilise seulement pour le Releve de Notes\r
- * @return String\r
- */\r
- String getListeNotes() {\r
- String result = "";\r
- noteImpressions.each { NoteImpressionInfo noteImpression ->\r
- String noteFormatee = noteImpression.note\r
- String noteMaxFormatee = noteImpression.noteMax\r
- result = result +\r
- noteImpression.libelle +\r
- " <b>(" +\r
- noteFormatee +'/'+noteMaxFormatee+\r
- ")</b> "\r
- }\r
- return result\r
- }\r
-\r
- /**\r
- * Retourne le nombre de notes pour la sous-matière.\r
- * @return Integer\r
- */\r
- Integer getNbNotes() {\r
- return noteImpressions ? noteImpressions.size() : 0\r
- }\r
-}\r
+/*
+ * 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.impression.donnees.eleve
+
+/**
+ * Informations concernant les sous-matières
+ */
+class SousMatiereImpressionInfo {
+
+ // Moyenne précédente (T1 ou S1)
+ String moyennePrec1 = ""
+ // Moyenne précédente (T2 ou S2)
+ String moyennePrec2 = ""
+ // Moyenne précédente (T3)
+ String moyennePrec3 = ""
+
+ // Nom de la matière/sous-matière (libellé court)
+ String libelle = ""
+ // moyennes de l'élève et de la classe par trimestre
+ String moyenneClasse = null
+ String moyenneEleve = null
+ // coefficient de la matiere/sous-matiere
+ String coeff = null
+ // rang de l'élève pour la matière
+ String rangs = ""
+ // min moyenne des élèves de classe
+ String moyenneMin = null
+ // max moyenne des élèves de classe
+ String moyenneMax = null
+ // nombre de notes
+ Integer nbNotes = null
+ // appréciation
+ String appreciation = null
+
+ // liste des notes
+ List<NoteImpressionInfo> noteImpressions = []
+
+ /**
+ * Retourne une liste formatée de notes.
+ * Utilise seulement pour le Releve de Notes
+ * @return String
+ */
+ String getListeNotes() {
+ String result = "";
+ noteImpressions.each { NoteImpressionInfo noteImpression ->
+ String noteFormatee = noteImpression.note
+ String noteMaxFormatee = noteImpression.noteMax
+ result = result +
+ noteImpression.libelle +
+ " <b>(" +
+ noteFormatee + '/' + noteMaxFormatee +
+ ")</b> "
+ }
+ return result
+ }
+
+}
// notes textuelles (annotations) qui se trouvent dans le document
AllNoteTextuelleImpression allNoteTextuelleImpression = new AllNoteTextuelleImpression()
- // TOREFACT : Il faut soit utiliser moyenneEleve et moyenneClasse hérités de SousMatiereImpressionInfo soit ne pas faire de l'héritage
- String moyenneGeneraleEleve = null // Moyenne générale d'élève (sur toutes les matières)
- String moyenneGeneraleClasse = null // Moyenne générale de classe (sur toutes les matières)
+ // nom de la période précédente (T1 ou S1)
+ String nomPeriodePrecedente1 = ""
+ // nom de la période précédente (T2 ou S2)
+ String nomPeriodePrecedente2 = ""
+ // nom de la période précédente (T3)
+ String nomPeriodePrecedente3 = ""
/**
* Retourne sous forme de texte la liste des notes textuelles
Long idTemplateJasper
// code i18n du template par défaut
String codeTemplateDefaut
+ // objet de données complémentaires
+ def complement
+ // taille de la police
+ Integer size
String toString() {
"""
* @return une map pour export JSON
*/
def toMap() {
- [
- 'x': x,
- 'y': y,
- 'width': width,
- 'height': height,
- 'libelle': libelle,
- 'id': champ,
- 'action': typeZone?.getCode(),
- 'template': template,
- 'idTemplateJasper': idTemplateJasper,
- 'frame': true
+ Map resultat = [
+ 'x': x,
+ 'y': y,
+ 'width': width,
+ 'height': height,
+ 'libelle': libelle,
+ 'id': champ,
+ 'action': typeZone?.getCode(),
+ 'template': template,
+ 'idTemplateJasper': idTemplateJasper,
+ 'frame': true
]
+
+ if (size != null) {
+ resultat['size'] = size
+ }
+
+ if (complement) {
+ resultat['complement'] = complement.toMap()
+ }
+
+ return resultat
+
}
}
-package org.lilie.services.eliot.scolarite.parametrages.modelededocument
+package org.lilie.services.eliot.impression.image
/**
* différents types d'image utilisé dans l'editeur de courrier
-package org.lilie.services.eliot.scolarite.parametrages.modelededocument
+package org.lilie.services.eliot.impression.image
import org.lilie.services.eliot.scolarite.etablissement.PreferenceEtablissementService
import org.lilie.services.eliot.scolarite.Etablissement
import javax.imageio.ImageIO
import java.awt.image.BufferedImage
+import org.lilie.services.eliot.impression.TemplateDocument
/**
* Ce service a pour but de gérer les images pour les modèles
* @author othe
*/
-class ImageService {
+class ImpressionImageService {
PreferenceEtablissementService preferenceEtablissementService
* @param etablissement
* @param image
*/
- public void enregistre(ImageType imageType, Etablissement etablissement, byte[] image) {
+ public void enregistre(ImageType imageType, Etablissement etablissement, byte[] image, TemplateDocument templateDocument) {
checkImageCorrecte(image)
break
case ImageType.CACHET:
+ // TOIMP : tenir compte du paramètre templateDocument
preferenceEtablissementService.setCachet(
etablissement,
image
* @param etablissement
* @return
*/
- public byte[] load(ImageType imageType, Etablissement etablissement) {
+ public byte[] load(ImageType imageType, Etablissement etablissement, TemplateDocument templateDocument) {
switch (imageType) {
case ImageType.LOGO:
return preferenceEtablissementService.getLogo(etablissement)
case ImageType.CACHET:
+ // TOIMP : tenir compte du paramètre templateDocument
return preferenceEtablissementService.getCachet(etablissement)
}
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.TemplateDocument
/**
import org.lilie.services.eliot.applications.absences.BilanAbsenceInfo
import org.lilie.services.eliot.applications.absences.PriseEnCompteMotif
import org.lilie.services.eliot.parametrages.motifs.MotifService
+import org.lilie.services.eliot.applications.absences.PunitionService
+import org.lilie.services.eliot.applications.absences.DisciplineCriteresRecherche
+import org.lilie.services.eliot.applications.absences.StatPunitions
+import org.lilie.services.eliot.applications.absences.StatSanctions
+import org.lilie.services.eliot.applications.absences.SanctionService
/**
* Cette classe a pour but de rechercher les données associées aux demandes d'impression
PeriodeService periodeService
ImpressionRegroupementAbsencesService impressionRegroupementAbsencesService
MotifService motifService
+ PunitionService punitionService
+ SanctionService sanctionService
private final static String CODE_MESSAGE_DEMI_PENSION = "Demi-pension"//message(code: 'absences.menu.publipostage.selection.heure.demi-pension')
private final static String CODE_MESSAGE_INTERNAT = "Internat" //message(code: 'absences.menu.publipostage.selection.heure.internat')
* @param criteres représente l'ensemble des critères d'absences
* @return
*/
- public List<EleveImpressionInfo> findAllInfoForAbsences(SecuriteSession securiteSession,
- Etablissement etablissement,
- BasicCriteresRecherche criteres,
- SelectionAdresseResponsableEnum selectionAdresseResponsableEnum,
- Boolean ajouteDetailsAbsences = true
+ public List<EleveImpressionInfo> findAllInfoForAbsences(
+ SecuriteSession securiteSession,
+ Etablissement etablissement,
+ BasicCriteresRecherche criteres,
+ SelectionAdresseResponsableEnum selectionAdresseResponsableEnum,
+ Boolean ajouteDetailsAbsences = true
) {
log.info "findAllInfoForAbsences"
List<Personne> eleves = localPersonneService.findAllPersonneBySetAutorite(
(Set) Autorite.getAll(criteres.eleveIds)
)
-
log.info "Liste des élèves récupérée."
List<EleveImpressionInfo> eleveImpressionInfos =
selectionAdresseResponsableEnum
)
log.info "informations générales récupérées"
- eleveImpressionInfos = findAllInfoAbsenceEleve(securiteSession,
+
+ eleveImpressionInfos = findAllInfoAbsenceEleve(
+ securiteSession,
etablissement,
criteres,
eleveImpressionInfos
)
-
log.info "findAllInfoForAbsences terminé"
+ eleveImpressionInfos = findAllInfoPunitionEleve(
+ securiteSession,
+ etablissement,
+ criteres,
+ eleveImpressionInfos
+ )
+ log.info "findAllInfoPunitionEleve terminé"
+
+ eleveImpressionInfos = findAllInfoSanctionEleve(
+ securiteSession,
+ etablissement,
+ criteres,
+ eleveImpressionInfos
+ )
+ log.info "findAllInfoSanctionEleve terminé"
+
remplisDatesAbsences(eleveImpressionInfos)
log.info("remplisDatesAbsences terminé")
return eleveImpressionInfos
}
+ /**
+ * Calcule les stats sur les sanctions des élèves
+ * @param securiteSession
+ * @param etablissement
+ * @param criteres
+ * @param eleveImpressionInfos
+ * @return la List<EleveImpressionInfo> modifiée
+ */
+ List<EleveImpressionInfo> findAllInfoSanctionEleve(
+ SecuriteSession securiteSession,
+ Etablissement etablissement,
+ BasicCriteresRecherche criteres,
+ List<EleveImpressionInfo> eleveImpressionInfos) {
+ verifieDroitAccesAbsences(securiteSession, etablissement)
+
+ DisciplineCriteresRecherche criteresSanctions =
+ getDisciplieCriteresRechercheForCriteres(criteres)
+ List<StatSanctions> statSanctions = sanctionService.
+ countSanctionsParEleveForCriteres(criteresSanctions)
+ statSanctions.each {
+ StatSanctions stat ->
+ EleveImpressionInfo info = eleveImpressionInfos.find {
+ EleveImpressionInfo eleveImpressionInfo ->
+ eleveImpressionInfo.personne.id == stat.eleve.id
+ }
+ if(info){
+ info.eleve_NbSanctions = stat.nbSanctions.toString()
+ }
+ }
+ return eleveImpressionInfos
+ }
+
+ /**
+ * Calcule les stats sur les punitions des élèves
+ * @param securiteSession
+ * @param etablissement
+ * @param criteres
+ * @param eleveImpressionInfos
+ * @return la List<EleveImpressionInfo> modifiée
+ */
+ List<EleveImpressionInfo> findAllInfoPunitionEleve(
+ SecuriteSession securiteSession,
+ Etablissement etablissement,
+ BasicCriteresRecherche criteres,
+ List<EleveImpressionInfo> eleveImpressionInfos) {
+
+ verifieDroitAccesAbsences(securiteSession, etablissement)
+ DisciplineCriteresRecherche criteresPunitions =
+ getDisciplieCriteresRechercheForCriteres(criteres)
+ List<StatPunitions> statPunitions = punitionService.
+ countPunitionsParEleveForCriteres(criteresPunitions)
+
+ statPunitions.each {
+ StatPunitions stat ->
+ EleveImpressionInfo info = eleveImpressionInfos.find {
+ EleveImpressionInfo eleveImpressionInfo ->
+ eleveImpressionInfo.personne.id == stat.eleve.id
+ }
+ if(info){
+ info.eleve_NbPunitions = stat.nbPunitions.toString()
+ }
+ }
+ return eleveImpressionInfos
+ }
+
+ private DisciplineCriteresRecherche getDisciplieCriteresRechercheForCriteres(
+ BasicCriteresRecherche criteres) {
+
+ List<Personne> personneEleves = localPersonneService.
+ findAllPersonneForAllAutoriteIds(criteres.eleveIds)
+
+ DisciplineCriteresRecherche criteresPunitions = new DisciplineCriteresRecherche(
+ elevePersonneIds: personneEleves*.id,
+ dateDebut: criteres.dateDebut.getTime(),
+ dateFin: criteres.dateFin.getTime()
+ )
+ return criteresPunitions
+ }
+
/**
* Rempli datesAbsence dans eleveImpressionInfos en utilisant l'info sur les
* absences deja presant dans eleveImpressionInfos
}
List<StatAbsences> eleveStats =
- bilanService.getByEleveStatsExcusesNonExcusesFromData(
+ bilanService.getStatsAbsencesByEleveFromData(
resultAllTypesChoisis,
etablissement
)
- eleveStats.each { StatAbsences state ->
+ eleveStats.each { StatAbsences stat ->
EleveImpressionInfo impressionInfo =
(EleveImpressionInfo) eleveImpressionInfos.find {
- it.personne == state.eleve
+ it.personne == stat.eleve
}
- impressionInfo.eleve_NbAbsExc = state.nbAbsencesExcusees
- impressionInfo.eleve_NbAbsNonExc = state.nbAbsencesNonExcusees
- impressionInfo.eleve_NbAbsence = state.nbAbsencesTotal
+ impressionInfo.eleve_NbAbsExc = stat.nbAbsencesExcusees
+ impressionInfo.eleve_NbAbsNonExc = stat.nbAbsencesNonExcusees
+ impressionInfo.eleve_NbAbsence = stat.nbAbsencesTotal
+ impressionInfo.eleve_NbAbsJusRec = stat.nbAbsencesJustifieesRecevables
+ impressionInfo.eleve_NbAbsJusNonRec = stat.nbAbsencesJustifieesNonRecevables
+ impressionInfo.eleve_NbAbsDemiPens = stat.nbAbsencesDemiPension
+ impressionInfo.eleve_NbAbsInternat = stat.nbAbsencesInternat
+ impressionInfo.eleve_NbDepAnti = stat.nbDepartsAnticipes
+ impressionInfo.eleve_NbPunitions = stat.nbPunitions
+ impressionInfo.eleve_NbSanctions = stat.nbSanctions
+
}
return eleveImpressionInfos
}
- public List<EleveImpressionInfo> lectureDonneesEleve(PublipostageAbsencesParams parametresSelectionPublipostage,
- ImpressionRequetageSelection requetageSelection,
- SecuriteSession securiteSession,
- Etablissement etablissement
+ public List<EleveImpressionInfo> lectureDonneesEleve(
+ PublipostageAbsencesParams parametresSelectionPublipostage,
+ ImpressionRequetageSelection requetageSelection,
+ SecuriteSession securiteSession,
+ Etablissement etablissement
) {
List<EleveImpressionInfo> eleveImpressionInfos = []
PublipostageCriteresRecherche criteres
criteres.nbLimit = parametresSelectionPublipostage.limitAbsence
- List<EleveImpressionInfo> eleveImpressionInfosRetard = []
- eleveImpressionInfosRetard = findAllInfoForRetards(
+ List<EleveImpressionInfo> eleveImpressionInfosRetard = findAllInfoForRetards(
securiteSession,
etablissement,
criteres,
eleveImpressionInfosRetard
)
}
+
return eleveImpressionInfos
}
-package org.lilie.services.eliot.impression
+package org.lilie.services.eliot.impression.template
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.scolarite.Etablissement
import grails.validation.ValidationException
import org.lilie.services.eliot.impression.contenu.ImpressionModeleContenuService
import org.lilie.services.eliot.impression.contenu.ModeleContenu
+import org.lilie.services.eliot.impression.template.fonte.PoliceEnum
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.TemplateTypeFonctionnalite
+import org.lilie.services.eliot.impression.TemplateChampMemo
+import org.lilie.services.eliot.impression.TemplateEliot
+import org.lilie.services.eliot.impression.ImpressionServiceException
+import org.lilie.services.eliot.impression.ImpressionServiceNomUniqueException
+import org.lilie.services.eliot.impression.TemplateDocumentSousTemplateEliot
+import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.impression.PublipostageSuivi
class ImpressionTemplateDocumentService {
* @return
* @throws ImpressionServiceException
*/
- TemplateDocument modifieTemplateDocument(TemplateDocument templateDocument,
- String nom,
- String descriptif = null)
+ public TemplateDocument modifieTemplateDocument(TemplateDocument templateDocument,
+ String nom,
+ String police,
+ String descriptif = null)
throws ImpressionServiceException {
try {
- templateDocument.nom = nom
+
+ if (PoliceEnum.ARIAL.nom == police) {
+ templateDocument.police = null
+ } else {
+ templateDocument.police = police
+ }
+
if (descriptif) {
templateDocument.descriptif = descriptif
}
+ templateDocument.nom = nom
+
if (templateDocument.validate()) {
templateDocument.save(flush: true, failOnError: true)
} else {
it.delete(flush: true)
}
+ BulletinOptions bulletinOptions = BulletinOptions.findByTemplateDocument(templateDocument)
+ if (bulletinOptions) {
+ bulletinOptions.delete(flush: true)
+ }
+
templateDocument.delete(flush: true)
sessionFactory.currentSession.clear()
--- /dev/null
+package org.lilie.services.eliot.impression.template
+
+import net.sf.jasperreports.engine.JasperReport
+import net.sf.jasperreports.engine.util.JRLoader
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.TemplateJasper
+import org.lilie.services.eliot.impression.template.bulletin.ImpressionBulletinTemplateService
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import org.lilie.services.eliot.impression.template.fonte.ImpressionPoliceService
+import org.lilie.services.eliot.impression.constantes.TemplateDocumentEnum
+
+/**
+ * Ce service permet de fournir les modèles jasper correspondant au modèle eliot. En fait on a maintenant
+ * des modèles stockés en base susceptible d'être modifié en fonction de paramètre provenant de différentes
+ * origines (fonte et taille, options d'impression)
+ * @author othe
+ */
+class ImpressionTemplateFactoryService {
+
+ ImpressionPoliceService impressionPoliceService
+ ImpressionBulletinTemplateService impressionBulletinTemplateService
+
+ /**
+ * Lecture des données binaires compilés
+ * @param currentTemplateJasper
+ * @return
+ */
+ public JasperReport binaryTemplateJasperFactory(TemplateDocument templateDocument,
+ TemplateJasper currentTemplateJasper,
+ Object options
+ ) {
+
+ if (templateDocument.systeme) {
+ if (templateDocument.code != TemplateDocumentEnum.BULLETIN_NOTES_1.toString()) {
+ return chargeModeleJasperParDefaut(currentTemplateJasper)
+ }
+ }
+
+ JasperReport jasperReport = modifieModeleJasper(
+ templateDocument,
+ currentTemplateJasper,
+ options
+ )
+
+ return jasperReport
+ }
+
+ /**
+ * Lecture du modele jasper pré-compilé en base
+ * @param currentTemplateJasper
+ * @return
+ */
+ private JasperReport chargeModeleJasperParDefaut(TemplateJasper currentTemplateJasper) {
+ ByteArrayInputStream modeleBinaire = new ByteArrayInputStream(
+ currentTemplateJasper.jasper
+ )
+ return (JasperReport) JRLoader.loadObject(modeleBinaire)
+ }
+
+ /**
+ * Modification du modele jasper fourni pour les taille de fonte et les fontes
+ * @param templateDocument
+ * @param xml
+ * @return
+ */
+ private JasperReport modifieModeleJasper(TemplateDocument templateDocument,
+ TemplateJasper currentTemplateJasper,
+ Object options) {
+
+ // on récupère le modèle en base
+ JasperReport jasperReport = chargeModeleJasperParDefaut(currentTemplateJasper)
+
+ // Dans le cas du bulletin on applique les options d'impression
+ if (impressionBulletinTemplateService.isModeleBulletin(templateDocument)
+ &&
+ (currentTemplateJasper.param)) {
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = (BulletinOptionsPersonnalise) options
+
+ impressionBulletinTemplateService.modifierTemplate(
+ jasperReport,
+ templateDocument,
+ currentTemplateJasper,
+ bulletinOptionsPersonnalise
+ )
+
+ }
+
+ // pour tous les modèles on appliques les options de mise en page des documents
+ return impressionPoliceService.modifierTemplate(
+ jasperReport,
+ templateDocument,
+ currentTemplateJasper
+ )
+
+ }
+
+
+}
--- /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.impression.template
+
+import net.sf.jasperreports.engine.base.JRBaseElement
+import net.sf.jasperreports.engine.JRBand
+import net.sf.jasperreports.engine.base.JRBaseTextField
+import net.sf.jasperreports.engine.JRExpression
+import net.sf.jasperreports.engine.JRElement
+
+/**
+ * Contient des fonctions de base pour manipuler des modèles jasper
+ * @author othe
+ */
+class ImpressionTemplateOutilsService {
+
+ /**
+ * Supprime une liste d'éléments dans la bande jasper
+ * @param aSupprimer
+ * @param jrBand
+ */
+ public void supprimeListeElement(List<JRBaseElement> aSupprimer, JRBand jrBand) {
+
+ if (aSupprimer) {
+ aSupprimer.each {
+ jrBand.children.remove(it)
+ }
+ }
+
+ }
+
+ /**
+ * Retourne le nom du champ ou du parametre sur lequel pointe la zone de texte
+ * @param baseTextField
+ * @return
+ */
+ public String getNomChamp(JRBaseTextField baseTextField) {
+
+ JRExpression expression = baseTextField.getExpression()
+
+ String texte = expression.text
+
+ String resultat = ""
+
+ if (texte.indexOf("P") == 1) {
+ resultat = texte.substring(3)
+ resultat = resultat.substring(0, resultat.length() - 1)
+ }
+
+ if (texte.indexOf("F") == 1) {
+ resultat = texte.substring(3)
+ resultat = resultat.substring(0, resultat.length() - 1)
+ }
+
+ return resultat
+ }
+
+ /**
+ * recherche un élément par sa clé jasper (key) dans le bandeau jasper
+ * Cet élément doit exister dans le modèle
+ * @param jrBand
+ * @param key
+ * @return
+ */
+ public JRElement getElementByKey(JRBand jrBand, String key) {
+
+ JRElement element = jrBand.getElementByKey(key)
+
+ if (!element) {
+ throw new IllegalStateException("L'élément de titre $key n'est pas présent dans le modèle.")
+ }
+
+ return element
+ }
+
+
+
+}
-package org.lilie.services.eliot.impression
+package org.lilie.services.eliot.impression.template
import java.lang.reflect.Field
import org.lilie.services.eliot.impression.utils.ChampPublipostage
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.applications.ModuleEliot
import org.lilie.services.eliot.impression.donnees.eleve.brevet.BrevetImpression
+import org.lilie.services.eliot.impression.TemplateTypeDonnees
+import org.lilie.services.eliot.impression.ImpressionServiceException
/**
*
--- /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.impression.template.bulletin
+
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.TemplateJasper
+import net.sf.jasperreports.engine.JasperReport
+import net.sf.jasperreports.engine.base.JRBaseElement
+import net.sf.jasperreports.engine.base.JRBaseTextField
+import net.sf.jasperreports.engine.JRSection
+import net.sf.jasperreports.engine.JRBand
+import net.sf.jasperreports.engine.base.JRBaseComponentElement
+import net.sf.jasperreports.engine.component.Component
+import net.sf.jasperreports.components.table.StandardTable
+import net.sf.jasperreports.components.table.StandardColumn
+import net.sf.jasperreports.engine.JRElement
+import org.lilie.services.eliot.impression.template.ImpressionTemplateOutilsService
+import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
+import org.lilie.services.eliot.impression.template.bulletin.colonne.AllDescriptionColonne
+import org.lilie.services.eliot.impression.template.bulletin.colonne.ColonneEnum
+import org.lilie.services.eliot.impression.template.bulletin.colonne.ColonneGroupeEnum
+import org.lilie.services.eliot.impression.template.bulletin.colonne.DescriptionColonne
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+import org.lilie.services.eliot.impression.template.bulletin.colonne.ColonneMatiere
+import net.sf.jasperreports.engine.base.JRBaseRectangle
+
+/**
+ * Service de modification des modèles de bulletin de notes
+ * @author othe
+ */
+class ImpressionBulletinTemplateService {
+
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
+ ImpressionTemplateOutilsService impressionTemplateOutilsService
+
+ private static final String TABLEAU_BULLETIN = "tableau"
+ private static final String LIGNE_MATIERE = "ligneMatiere"
+ private static final String DETAILS_LIGNE_MATIERE = "ligneSousMatiere"
+ // pour jasper la valeur "key" d'un élément est un id
+ private static final String KEY_ZONE_COLONNE = "colonnes"
+ private static final String KEY_APPRECIATION = "appreciation"
+ private static final String KEY_CADRE_MATIERE = "cadreMatiere"
+ private static final String KEY_TITRE_MATIERE = "titreMatiere"
+ private static final String KEY_TITRE_ENSEIGNANT = "titreEnseignant"
+
+
+ /**
+ * Indique si le modele est de type bulletin de note
+ * @param templateDocument
+ * @return
+ */
+ public Boolean isModeleBulletin(TemplateDocument templateDocument) {
+
+ if (!templateDocument) {
+ throw new IllegalArgumentException("Le modèle de document est obligatoire.")
+ }
+
+ String code = templateDocument?.templateEliot?.code
+
+ return (code == TemplateEliotEnum.BUL_NOTES_LETTRE.toString()) ||
+ (code == TemplateEliotEnum.BUL_NOTES_A4.toString()) ||
+ (code == TemplateEliotEnum.BUL_NOTES_SANS_ADRESSE.toString())
+ }
+
+ /**
+ * Modification d'un modèle jasper
+ * @param jasperReport
+ * @param templateDocument
+ * @param templateJasper
+ * @return
+ */
+ public JasperReport modifierTemplate(JasperReport jasperReport,
+ TemplateDocument templateDocument,
+ TemplateJasper templateJasper,
+ BulletinOptionsPersonnalise options
+ ) {
+
+ // s'il n'y a pas d'options on en récupère par défaut
+ if (!options) {
+ options = new BulletinOptionsPersonnalise()
+ }
+
+ // on détermine les caractéristiques du tableau en fonction des options
+ AllDescriptionColonne allDescriptionColonne =
+ impressionBulletinOptionsService.getListeColonneImprimable(options)
+
+ modifieModele(
+ jasperReport.detailSection,
+ jasperReport.columnHeader,
+ allDescriptionColonne,
+ templateJasper.param
+ )
+
+ return jasperReport
+ }
+
+ /**
+ * Modification du modele de tableau de bulletin de notes
+ * @param jrSection : section du modèle jasper (contenant les bandes du corps de modèle)
+ * @param enteteColonneJasper : bande de l'entete de modèle (si cet entête existe dans le modèle)
+ * @param allDescriptionColonne : liste des colonnes à imprimer
+ * @param codeModele : code modèle jasper
+ */
+ private void modifieModele(JRSection jrSection,
+ JRBand enteteColonneJasper,
+ AllDescriptionColonne allDescriptionColonne,
+ String codeModele
+ ) {
+
+
+ switch (codeModele) {
+
+ case TABLEAU_BULLETIN:
+
+ jrSection.bands.each {
+ JRBand jrBand ->
+
+ modifierBulletin(
+ jrBand,
+ allDescriptionColonne
+ )
+ }
+
+ modifierLigneTitre(
+ enteteColonneJasper,
+ allDescriptionColonne
+ )
+
+ break
+
+ case LIGNE_MATIERE:
+
+ jrSection.bands.each {
+ JRBand jrBand ->
+
+ modifierLigneMatiere(
+ jrBand,
+ allDescriptionColonne
+ )
+ }
+
+ break
+
+ case DETAILS_LIGNE_MATIERE:
+
+ jrSection.bands.each {
+ JRBand jrBand ->
+
+ modifierDetailLigneMatiere(
+ jrBand,
+ allDescriptionColonne
+ )
+ }
+
+ break
+ }
+
+ }
+
+/**
+ * Modification du modèle contenant les détails des zones de ligne matière
+ * @param jrBand
+ * @param allDescriptionColonne
+ */
+ private void modifierDetailLigneMatiere(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne) {
+
+ modifierAppreciation(
+ jrBand,
+ allDescriptionColonne.positionAppreciation
+ )
+
+ modifierEtSupprimerColonnes(
+ jrBand,
+ allDescriptionColonne
+ )
+ }
+
+/**
+ * Modification du modèle bulletin (tableau)
+ * @param jrBand
+ * @param allDescriptionColonne
+ */
+ private void modifierBulletin(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne) {
+
+ modifierAppreciation(
+ jrBand,
+ allDescriptionColonne.positionAppreciation
+ )
+
+ // gestion des pieds de colonne
+ modifierEtSupprimerColonnes(
+ jrBand,
+ allDescriptionColonne
+ )
+ }
+
+/**
+ * repositionne ou supprime les colonnes en fonction du paramétrage bulletin
+ * @param jrBand : bande jasper ou se trouve les champs à déplacer ou supprimer
+ * @param allDescriptionColonne : nouvelles positions des colonnes
+ * @param bulletinParametrage
+ */
+ private void modifierEtSupprimerColonnes(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne
+ ) {
+
+ List<JRBaseElement> aSupprimer = modifierChampsLigneMatiere(
+ jrBand,
+ allDescriptionColonne
+ )
+
+ impressionTemplateOutilsService.supprimeListeElement(
+ aSupprimer,
+ jrBand
+ )
+ }
+
+/**
+ * Modifie les champs à modifier et etabli la liste des champs à supprimer
+ * @param jrBand
+ * @param allDescriptionColonne
+ * @return la liste des champ à supprimer
+ */
+ private List<JRBaseElement> modifierChampsLigneMatiere(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne
+ ) {
+
+ List<JRBaseElement> aSupprimer = []
+
+ jrBand.children.each {JRBaseElement jrBaseElement ->
+
+ switch (jrBaseElement.getClass()) {
+
+ case JRBaseTextField:
+
+ JRBaseTextField jrBaseTextField = (JRBaseTextField) jrBaseElement
+
+
+ String nomChamp = impressionTemplateOutilsService.getNomChamp(jrBaseTextField)
+
+
+ if (nomChamp) {
+
+ if (impressionBulletinOptionsService.aSupprimer(
+ allDescriptionColonne.bulletinParametrage,
+ nomChamp)
+ ) {
+
+ aSupprimer << jrBaseElement
+
+ } else {
+
+ repositionneColonne(
+ allDescriptionColonne,
+ nomChamp,
+ jrBaseTextField)
+
+ }
+ }
+
+
+ break
+
+ case JRBaseComponentElement:
+
+ JRBaseComponentElement baseComponentElement = (JRBaseComponentElement) jrBaseElement
+ Component comp = baseComponentElement.component
+
+ if (comp instanceof StandardTable) {
+
+ modifierTableauJasper(
+ comp,
+ allDescriptionColonne.bulletinParametrage
+ )
+
+ }
+ break
+
+ case JRBaseRectangle:
+
+ JRBaseRectangle rectangle = (JRBaseRectangle) jrBaseElement
+ if (rectangle.key == KEY_CADRE_MATIERE) {
+ rectangle.width = AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT
+ }
+ break
+
+ default:
+
+ log.info jrBaseElement
+
+ }
+ }
+ return aSupprimer
+ }
+
+/**
+ * Permet de modifier le modele de ligne de matière dans le tableau
+ * @param jrBand
+ * @param positionAppreciation
+ */
+ private void modifierLigneMatiere(JRBand jrBand, AllDescriptionColonne allDescriptionColonne) {
+
+ modifierAppreciation(
+ jrBand,
+ allDescriptionColonne.positionAppreciation
+ )
+
+ modifierLargeurBlocDesColonnes(
+ jrBand,
+ allDescriptionColonne.positionAppreciation
+ )
+ }
+
+/**
+ * Modification de la largeur du bloc des colonnes (sans la colonne appréciation)
+ * @param jrBand
+ * @param positionAppreciation
+ */
+ private void modifierLargeurBlocDesColonnes(JRBand jrBand, Integer largeur) {
+
+ JRElement elementColonnes = impressionTemplateOutilsService.getElementByKey(jrBand, KEY_ZONE_COLONNE)
+
+ if (elementColonnes) {
+ elementColonnes.width = largeur
+ }
+ }
+
+/**
+ * Modifie la position et la largeur de l'appréciation
+ * @param jrBand
+ * @param positionAppreciation
+ */
+ private void modifierAppreciation(JRBand jrBand, Integer positionAppreciation) {
+
+ JRElement elementApp = jrBand.getElementByKey(KEY_APPRECIATION)
+
+ if (elementApp) {
+
+ elementApp.x = positionAppreciation
+ elementApp.width =
+ AllDescriptionColonne.LARGEUR_LIGNE_PT - positionAppreciation
+ }
+
+ }
+
+/**
+ * modifie le sous-tableau qui contient les informations des sous-matières
+ * @param comp
+ */
+ private void modifierTableauJasper(StandardTable comp,
+ BulletinOptionsPersonnalise bulletinParametrage) {
+
+ StandardTable table = (StandardTable) comp
+
+ List<StandardColumn> aSupprimer = []
+
+ boolean premiereColonne = true
+
+ table.columns.each {StandardColumn colonne ->
+
+ if (colonneASupprimer(colonne, bulletinParametrage)) {
+ aSupprimer << colonne
+ } else {
+ if (premiereColonne) {
+
+ premiereColonne = false
+
+ changeLargeurColonne(colonne, AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT)
+
+ } else {
+
+ changeLargeurColonne(colonne, AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT)
+
+ }
+
+ }
+
+ }
+
+ aSupprimer.each {StandardColumn colonne ->
+ table.removeColumn(colonne)
+ }
+ }
+
+ private void changeLargeurColonne(StandardColumn colonne, Integer nouvelleLargeur) {
+
+ colonne.width = nouvelleLargeur
+
+ colonne.detailCell.children.each {
+ JRElement element ->
+ element.width = nouvelleLargeur
+ }
+
+ }
+
+/**
+ * Indique si une colonne d'un tableau doit être supprimé
+ * @param colonne
+ * @param bulletinParametrage
+ * @return
+ */
+ private Boolean colonneASupprimer(StandardColumn colonne, BulletinOptionsPersonnalise bulletinParametrage) {
+
+ Boolean resultat = false
+
+ List elements = colonne.getDetailCell().children
+
+ elements.each {JRBaseElement jrBaseElement ->
+
+ switch (jrBaseElement.getClass()) {
+
+ case JRBaseTextField:
+
+ JRBaseTextField jrBaseTextField = (JRBaseTextField) jrBaseElement
+
+ String nomChamp = impressionTemplateOutilsService.getNomChamp(jrBaseTextField)
+ if (nomChamp) {
+ if (impressionBulletinOptionsService.aSupprimer(
+ bulletinParametrage,
+ nomChamp)
+ ) {
+ resultat = true
+ }
+ }
+
+ break
+
+ }
+ }
+ return resultat
+
+ }
+
+/**
+ * Permet de modifier la ligne de titre en fonction des paramètres utilisateurs
+ * @param jrBand : bande jasper qui contient l'entête du tableau de bulletin de notes
+ * @param allDescriptionColonne
+ */
+ private void modifierLigneTitre(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne
+ ) {
+
+ List<JRBaseElement> aSupprimer = []
+
+ JRElement elementMatiere=jrBand.getElementByKey(KEY_TITRE_MATIERE)
+ elementMatiere.width=AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT
+
+ JRElement elementEnseignant=jrBand.getElementByKey(KEY_TITRE_ENSEIGNANT)
+ elementEnseignant.width=AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT
+
+
+ modifierAppreciation(
+ jrBand,
+ allDescriptionColonne.positionAppreciation
+ )
+
+ ColonneEnum.each { ColonneEnum colonneEnum ->
+
+ String nomChamp = colonneEnum.champ
+
+ aSupprimer = traiteLigneDeTitreDeGroupe(
+ jrBand,
+ allDescriptionColonne,
+ nomChamp,
+ aSupprimer
+ )
+
+ aSupprimer = traiteLigneTitreColonne(
+ jrBand,
+ allDescriptionColonne,
+ nomChamp,
+ aSupprimer
+ )
+
+ }
+
+ impressionTemplateOutilsService.supprimeListeElement(
+ aSupprimer,
+ jrBand
+ )
+
+ }
+
+ private List<JRBaseElement> traiteLigneTitreColonne(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne,
+ String nomChamp,
+ List<JRBaseElement> aSupprimer) {
+
+
+ JRElement jrElement = jrBand.getElementByKey(nomChamp)
+
+ if (jrElement) {
+
+ if (impressionBulletinOptionsService.aSupprimer(
+ allDescriptionColonne.bulletinParametrage,
+ nomChamp)
+ ) {
+
+ aSupprimer << jrElement
+
+ } else {
+
+ repositionneColonne(
+ allDescriptionColonne,
+ nomChamp,
+ jrElement
+ )
+
+ }
+ }
+ return aSupprimer
+ }
+
+ private List<JRBaseElement> traiteLigneDeTitreDeGroupe(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne,
+ String nomChamp,
+ List<JRBaseElement> aSupprimer) {
+
+ JRElement elementJasperPourTitreDeGroupe = getElementJasperPourTitreGroupe(
+ jrBand,
+ allDescriptionColonne,
+ nomChamp
+ )
+
+ if (elementJasperPourTitreDeGroupe) {
+
+ ColonneGroupeEnum colonneGroupeEnum = ColonneGroupeEnum.getColonneParChamp(nomChamp)
+
+ if (impressionBulletinOptionsService.groupeASupprimer(
+ allDescriptionColonne.bulletinParametrage,
+ colonneGroupeEnum
+ )
+ ) {
+ aSupprimer << elementJasperPourTitreDeGroupe
+ } else {
+ repositionneTitre(
+ allDescriptionColonne,
+ nomChamp,
+ elementJasperPourTitreDeGroupe
+ )
+
+ }
+
+ }
+ return aSupprimer
+ }
+
+ /**
+ * Recherche l'élément jasper contenant la zone de titre associée à un champ
+ * @param jrBand
+ * @param nomChamp
+ * @return
+ */
+ private JRElement getElementJasperTitre(JRBand jrBand, String nomChamp) {
+
+ JRElement elementJasperPourTitreDeGroupe = null
+ // on recherche la 'key' de la ligne de titre groupe éventuellement associée à la colonne
+ String groupeTitreKey = ColonneGroupeEnum.getTitreKeyParChamp(nomChamp)
+ if (groupeTitreKey) {
+
+ elementJasperPourTitreDeGroupe = impressionTemplateOutilsService.getElementByKey(
+ jrBand,
+ groupeTitreKey
+ )
+
+ }
+ return elementJasperPourTitreDeGroupe
+ }
+
+/**
+ * Dans un bandeau jasper, corrige les largeurs du titre de groupe
+ * @param jrBand
+ * @param allDescriptionColonne
+ * @param nomChamp
+ * @param elementJasperPourTitreDeGroupe
+ * @return
+ */
+ private JRElement getElementJasperPourTitreGroupe(JRBand jrBand,
+ AllDescriptionColonne allDescriptionColonne,
+ String nomChamp
+ ) {
+
+ JRElement resultat = getElementJasperTitre(jrBand, nomChamp)
+
+ if (resultat) {
+
+ ColonneGroupeEnum colonneGroupeEnum = ColonneGroupeEnum.getColonneParChamp(nomChamp)
+
+ // on recherche la 'key' de la ligne de titre groupe éventuellement associée à la colonne
+
+ if (colonneGroupeEnum) {
+
+ DescriptionColonne descriptionColonne = allDescriptionColonne.getPositionTitreParChamp(nomChamp)
+
+ if (descriptionColonne?.colonneAligneeSurTitre) {
+
+ Integer largeurGroupeEnNombreDeColonnes = allDescriptionColonne.largeurTitreGroupeColonne(colonneGroupeEnum)
+ if (largeurGroupeEnNombreDeColonnes != 0) {
+ resultat.width =
+ AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT * largeurGroupeEnNombreDeColonnes
+ }
+
+ }
+ }
+ }
+ return resultat
+ }
+
+/**
+ * Repositionne le composant jasper décrivant une colonne
+ * @param allDescriptionColonne : liste des informations de toutes les colonnes
+ * @param nomChamp : nom du champ associé
+ * @param jrElement : élément à repositionner (à l'horizontale)
+ */
+ private void repositionneColonne(AllDescriptionColonne allDescriptionColonne,
+ String nomChamp,
+ JRElement jrElement) {
+
+ DescriptionColonne descriptionColonne = allDescriptionColonne.getColonneParChamp(nomChamp)
+ if (descriptionColonne) {
+ jrElement.x = descriptionColonne.positionHorizontale
+
+ if (ColonneMatiere.isColonneMatiere(nomChamp)) {
+ jrElement.width = AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT
+ } else {
+ jrElement.width = AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT
+ }
+
+ }
+
+ }
+
+/**
+ * Repositionne le titre par rapport à la position de son groupe
+ * @param allDescriptionColonne
+ * @param nomChamp
+ * @param jrElement
+ */
+ private void repositionneTitre(AllDescriptionColonne allDescriptionColonne,
+ String nomChamp,
+ JRElement jrElement) {
+
+ DescriptionColonne descriptionColonne = allDescriptionColonne.getPositionTitreParChamp(nomChamp)
+ if (descriptionColonne) {
+ jrElement.x = descriptionColonne.positionHorizontale
+
+ ColonneGroupeEnum colonneGroupeEnum = ColonneGroupeEnum.getColonneParChamp(nomChamp)
+ Integer largeurGroupeEnNombreDeColonnes = allDescriptionColonne.largeurTitreGroupeColonne(colonneGroupeEnum)
+ jrElement.width = largeurGroupeEnNombreDeColonnes * AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT
+ }
+
+ }
+
+}
--- /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.impression.template.bulletin.colonne
+
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+
+/**
+ * Liste des colonnes à imprimer.
+ * @author othe
+ */
+class AllDescriptionColonne {
+
+ // toutes les valeurs sont en point de pica (PT)
+ public static final Integer LARGEUR_LIGNE_PT = 555
+ public static final Integer LARGEUR_COLONNE_MATIERE_PT = 89
+ public static final Integer LARGEUR_COLONNE_DEFAUT_PT = 29
+
+ // positions des colonnes à imprimer
+ List<DescriptionColonne> colonneAImprimer = []
+
+ // position de la colonne appréciation
+ Integer positionAppreciation = 0
+
+ // paramétrage du modèle
+ BulletinOptionsPersonnalise bulletinParametrage
+
+ /**
+ * Permet de rechercher la description d'une colonne par rapport au nom de champ associé
+ * @param champ
+ * @return
+ */
+ public DescriptionColonne getColonneParChamp(String champ) {
+
+ DescriptionColonne resultat = colonneAImprimer.find { DescriptionColonne descriptionColonne ->
+ descriptionColonne.champ == champ
+ }
+
+ return resultat
+
+ }
+
+ /**
+ * Permet de rechercher la colonne qui correspond à la position du titre de son groupe
+ * @param champ
+ * @return
+ */
+ public DescriptionColonne getPositionTitreParChamp(String champ) {
+
+ DescriptionColonne resultat = colonneAImprimer.find { DescriptionColonne descriptionColonne ->
+ (descriptionColonne.champ == champ) && descriptionColonne.colonneAligneeSurTitre
+ }
+
+ return resultat
+
+ }
+
+/**
+ * Retourne en nombre de colonne la largeur d'un titre de groupe de colonne.
+ * @param colonneGroupeEnum
+ * @return largeur en nombre de colonne. si la valeur=0 c'est que le groupe n'est pas à imprimer.
+ */
+ public Integer largeurTitreGroupeColonne(ColonneGroupeEnum colonneGroupeEnum) {
+
+ Integer resultat = colonneGroupeEnum.largeurParDefaut
+ if (resultat>0){
+ return resultat
+ }
+
+ String nomColonne= colonneGroupeEnum.col1
+ resultat = incrementeSiOnImprime(nomColonne, resultat)
+
+ nomColonne= colonneGroupeEnum.col2
+ resultat = incrementeSiOnImprime(nomColonne, resultat)
+
+ nomColonne= colonneGroupeEnum.col3
+ resultat = incrementeSiOnImprime(nomColonne, resultat)
+
+ return resultat
+ }
+
+ /**
+ * incremente la valeur si la colonne du groupe est à imprimer
+ * @param nomColonne
+ * @param resultat
+ * @return
+ */
+ private int incrementeSiOnImprime(String nomColonne, int resultat) {
+ if (bulletinParametrage.properties.containsKey(nomColonne)) {
+ if (bulletinParametrage."${nomColonne}") {
+ resultat++
+ }
+ }
+ resultat
+ }
+
+}
--- /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.impression.template.bulletin.colonne
+
+/**
+ * Liste des colonnes du modèles jasper
+ * @author othe
+ */
+public enum ColonneEnum {
+ MOYENNE_PREC1("moyennePrec1"),
+ MOYENNE_PREC2("moyennePrec2"),
+ MOYENNE_PREC3("moyennePrec3"),
+ MOYENNE_ELEVE("moyenneEleve"),
+ MOYENNE_CLASSE("moyenneClasse"),
+ COEFF("coeff"),
+ RANGS("rangs"),
+ MOYENNE_MIN("moyenneMin"),
+ MOYENNE_MAX("moyenneMax"),
+ NB_NOTES("nbNotes")
+
+ ColonneEnum() {
+ }
+
+ private String champ
+
+
+ ColonneEnum(String champ) {
+ this.champ = champ
+
+ }
+
+ public String getChamp() {
+ champ
+ }
+
+
+}
\ No newline at end of file
--- /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.impression.template.bulletin.colonne
+
+/**
+ * Description des groupes de colonnes du bulletin. Cette énumération concerne uniquement
+ * les colonnes entre la colonne élèves et la colonne appréciations
+ * @author othe
+ */
+public enum ColonneGroupeEnum {
+
+ MOYENNE_PREC(ColonneEnum.MOYENNE_PREC1, ColonneEnum.MOYENNE_PREC2, ColonneEnum.MOYENNE_PREC3, "titreMoyennePrec", 0),
+ MOYENNES(ColonneEnum.MOYENNE_ELEVE, ColonneEnum.MOYENNE_CLASSE, null, "titreMoyennes", 2),
+ COEFF(ColonneEnum.COEFF, null, null, "", 1),
+ RANGS(ColonneEnum.RANGS, null, null, "", 1),
+ MOYENNE_MIN_MAX(ColonneEnum.MOYENNE_MIN, ColonneEnum.MOYENNE_MAX, null, "titreMoyenneMin", 2),
+ NB_NOTES(ColonneEnum.NB_NOTES, null, null, "", 1)
+
+ ColonneGroupeEnum() {
+ }
+
+ private ColonneEnum col1
+ private ColonneEnum col2
+ private ColonneEnum col3
+ private String titreKey
+ private Integer largeur = 0
+
+ ColonneGroupeEnum(ColonneEnum col1, col2, col3, String titreKey, Integer largeur) {
+ this.col1 = col1
+ this.col2 = col2
+ this.col3 = col3
+ this.titreKey = titreKey
+ this.largeur = largeur
+ }
+
+ public String getCol1() {
+ col1?.champ
+ }
+
+ public String getCol2() {
+ col2?.champ
+ }
+
+ public String getCol3() {
+ col3?.champ
+ }
+
+ public getLargeurParDefaut() {
+ largeur
+ }
+
+ /**
+ * Retourne la valeur 'key' de la zone de texte contenant le titre du groupe.
+ * L'absence de titre (chaine "") indique simplement que le groupe n'a pas de
+ * zone de titre associé.
+ * @return
+ */
+ public String getTitreKey() {
+ titreKey
+ }
+
+ /**
+ * Retourne la colonne en fonction du nom de champ associé
+ * @param champ
+ * @return
+ */
+ static public ColonneGroupeEnum getColonneParChamp(String champ) {
+
+ ColonneGroupeEnum resultat = null
+
+ ColonneGroupeEnum.each { ColonneGroupeEnum colonneEnum ->
+
+ if ((colonneEnum.getCol1() == champ) || (colonneEnum.getCol2() == champ) || (colonneEnum.getCol3() == champ)) {
+ resultat = colonneEnum
+ }
+
+ }
+
+ return resultat
+
+ }
+
+ /**
+ * Retourne la colonne en fonction du nom de champ associé
+ * @param champ
+ * @return
+ */
+ static public String getTitreKeyParChamp(String champ) {
+ ColonneGroupeEnum colonneGroupeEnum = getColonneParChamp(champ)
+ return colonneGroupeEnum.titreKey
+ }
+
+
+}
\ No newline at end of file
--- /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.impression.template.bulletin.colonne
+
+/**
+ * Champs associés à la colonne matière
+ * @author othe
+ */
+public enum ColonneMatiere {
+
+ MATIERE("libelle"),
+ ENSIEGNANT("prof")
+
+ ColonneMatiere() {
+ }
+
+ private String champ
+
+
+ ColonneMatiere(String champ) {
+ this.champ = champ
+
+ }
+
+ public String getChamp() {
+ champ
+ }
+
+ /**
+ * Est ce que le champ passé en parametre correspond à un champ de la colonne matière
+ * @param champ
+ * @return
+ */
+ static public Boolean isColonneMatiere(String champ) {
+ Boolean resultat = false
+ ColonneMatiere.each {
+ ColonneMatiere colonneMatiere ->
+ if (colonneMatiere.champ == champ) {
+ resultat = true
+ }
+ }
+ return resultat
+
+ }
+
+
+}
\ No newline at end of file
--- /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.impression.template.bulletin.colonne
+
+/**
+ * Description d'une colonne
+ * @author othe
+ */
+class DescriptionColonne {
+
+ // nom du champ associé
+ String champ = ""
+
+ // position horizontale de la colonne
+ Integer positionHorizontale = 0
+
+ // indicateur position titre (indique que le colonne est alignée sur le titre de sont groupe)
+ Boolean colonneAligneeSurTitre = false
+
+}
--- /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.impression.template.bulletin.option
+
+import org.lilie.services.eliot.impression.BulletinOptions
+
+/**
+ * DTO donnant la liste des options d'impression correspondant à la demande de la personne courante
+ * @author othe
+ */
+class BulletinOptionsPersonnalise {
+ // imprime la moyenne générale
+ Boolean moyenneGenerale = true
+ // imprime le coeff
+ Boolean coefficient = true
+ // imprime la moyenne précédente de T1 ou S1
+ Boolean moyennePrec1 = false
+ // imprime la moyenne précédente de T2 ou S2
+ Boolean moyennePrec2 = false
+ // imprime la moyenne précédente de T3
+ Boolean moyennePrec3 = false
+ // imprime les moyenne mix/max
+ Boolean moyenneMinMax = true
+ // imprime le nombre de notes
+ Boolean nombreNotes = false
+ // imprime le rangs
+ Boolean rangs = false
+
+ public Boolean getMoyennePrec(){
+ moyennePrec1 ||
+ moyennePrec2 ||
+ moyennePrec3
+ }
+
+ BulletinOptionsPersonnalise() {
+ }
+
+ BulletinOptionsPersonnalise(BulletinOptions bulletinOptions) {
+ moyenneGenerale = bulletinOptions.moyenneGenerale
+ coefficient = bulletinOptions.coefficient
+ moyennePrec1 = bulletinOptions.moyennePrecedente
+ moyennePrec2 = bulletinOptions.moyennePrecedente
+ moyennePrec3 = bulletinOptions.moyennePrecedente
+ moyenneMinMax = bulletinOptions.moyenneMinMax
+ nombreNotes = bulletinOptions.nombreNotes
+ rangs = bulletinOptions.rangs
+ }
+
+
+ def toMap() {
+ [
+ 'moyenneGenerale': moyenneGenerale,
+ 'coefficient': coefficient,
+ 'moyennePrecedente': moyennePrec1,
+ 'moyenneMinMax': moyenneMinMax,
+ 'nombreNotes': nombreNotes,
+ 'rangs': rangs
+
+ ]
+ }
+
+
+}
--- /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.impression.template.bulletin.option
+
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.scolarite.IntervalleEnum
+import org.lilie.services.eliot.impression.template.bulletin.colonne.AllDescriptionColonne
+import org.lilie.services.eliot.impression.template.bulletin.colonne.ColonneGroupeEnum
+import org.lilie.services.eliot.impression.template.bulletin.colonne.DescriptionColonne
+
+/**
+ * Permet de calculer des données de positionnement et d'affichage à partir du DTO de paramétrage
+ * @author othe
+ */
+class ImpressionBulletinOptionsService {
+
+ /**
+ * Retourne le paramétrage d'un bulletin
+ * @param templateDocument
+ * @param typePeriode
+ * @return
+ */
+ public BulletinOptionsPersonnalise getParametreOptions(TemplateDocument templateDocument, TypePeriode typePeriode) {
+
+ BulletinOptionsPersonnalise resultat
+
+ BulletinOptions bulletinOptions = BulletinOptions.findByTemplateDocument(templateDocument)
+ if (bulletinOptions) {
+ resultat = new BulletinOptionsPersonnalise(bulletinOptions)
+ } else {
+ resultat = new BulletinOptionsPersonnalise()
+ }
+
+ switch (typePeriode.intervalle) {
+
+ case IntervalleEnum.S1:
+ case IntervalleEnum.T1:
+ resultat.moyennePrec1 = false
+ resultat.moyennePrec2 = false
+ resultat.moyennePrec3 = false
+ break
+
+ case IntervalleEnum.S2:
+ case IntervalleEnum.T2:
+ resultat.moyennePrec2 = false
+ resultat.moyennePrec3 = false
+ break
+
+ case IntervalleEnum.T3:
+ resultat.moyennePrec3 = false
+ break
+
+ case IntervalleEnum.ANNEE:
+
+ break
+
+ }
+
+ return resultat
+
+ }
+
+ /**
+ * Retourne la liste des colonnes imprimables
+ * @param bulletinParametrage
+ * @return
+ */
+ public AllDescriptionColonne getListeColonneImprimable(BulletinOptionsPersonnalise bulletinParametrage) {
+
+ AllDescriptionColonne resultat = new AllDescriptionColonne(bulletinParametrage: bulletinParametrage)
+
+ Integer position = AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT
+
+ ColonneGroupeEnum.each {
+ ColonneGroupeEnum colonneGroupeEnum ->
+
+ if (aImprimer(
+ bulletinParametrage,
+ colonneGroupeEnum,
+ 0)
+ ) {
+
+ resultat.colonneAImprimer << new DescriptionColonne(
+ positionHorizontale: position,
+ champ: colonneGroupeEnum.col1,
+ colonneAligneeSurTitre: true
+ )
+
+ if (colonneGroupeEnum.col2) {
+
+ if (aImprimer(
+ bulletinParametrage,
+ colonneGroupeEnum,
+ 1)
+ ) {
+
+ position = position + AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT
+
+ resultat.colonneAImprimer << new DescriptionColonne(
+ positionHorizontale: position,
+ champ: colonneGroupeEnum.col2
+ )
+ }
+
+ }
+
+ if (colonneGroupeEnum.col3) {
+
+ if (aImprimer(
+ bulletinParametrage,
+ colonneGroupeEnum,
+ 2)
+ ) {
+
+ position = position + AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT
+
+ resultat.colonneAImprimer << new DescriptionColonne(
+ positionHorizontale: position,
+ champ: colonneGroupeEnum.col3
+ )
+ }
+
+ }
+
+ position = position + AllDescriptionColonne.LARGEUR_COLONNE_DEFAUT_PT
+
+ }
+ }
+
+ resultat.positionAppreciation = position
+
+ return resultat
+ }
+
+ /**
+ * Détermine à partir du nom de champ jasper, si celui-ci est imprimé
+ * @param nom
+ * @return
+ */
+ public Boolean aSupprimer(BulletinOptionsPersonnalise bulletinParametrage, String nom) {
+
+ ColonneGroupeEnum colonneGroupeEnum = ColonneGroupeEnum.getColonneParChamp(nom)
+
+ if (colonneGroupeEnum) {
+ Integer numCol = numCol(nom)
+ return groupeASupprimer(bulletinParametrage, colonneGroupeEnum, numCol)
+
+ }
+ return false
+ }
+
+
+ private static final Integer TOUS_LE_GROUPE=-1
+
+ public Boolean groupeASupprimer(BulletinOptionsPersonnalise bulletinParametrage,
+ ColonneGroupeEnum colonneEnum,
+ Integer numCol = TOUS_LE_GROUPE) {
+
+ if (!bulletinParametrage) {
+ throw new IllegalArgumentException("L'objet de paramétrage du bulletin est obligatoire.")
+ }
+
+ switch (colonneEnum) {
+
+ case ColonneGroupeEnum.MOYENNE_PREC:
+
+ switch (numCol) {
+ //
+ case TOUS_LE_GROUPE:
+ return !bulletinParametrage.getMoyennePrec()
+
+ case 0:
+ return !bulletinParametrage.moyennePrec1
+
+ case 1:
+ return !bulletinParametrage.moyennePrec2
+
+ default:
+ return !bulletinParametrage.moyennePrec3
+ }
+
+ return false
+
+ case ColonneGroupeEnum.MOYENNES:
+ return false
+
+ case ColonneGroupeEnum.COEFF:
+ return !bulletinParametrage.coefficient
+
+ case ColonneGroupeEnum.RANGS:
+ return !bulletinParametrage.rangs
+
+ case ColonneGroupeEnum.MOYENNE_MIN_MAX:
+ return !bulletinParametrage.moyenneMinMax
+
+ case ColonneGroupeEnum.NB_NOTES:
+ return !bulletinParametrage.nombreNotes
+
+
+ default:
+ return false
+ }
+
+
+ }
+
+ /**
+ * Détermine à partir du nom de champ jasper, si celui-ci est à imprimer
+ * @param bulletinParametrage
+ * @param colonneEnum groupe de colonne
+ * @param numCol numéro de colonne dans le groupe (0 est la première)
+ * @return
+ */
+ public Boolean aImprimer(BulletinOptionsPersonnalise bulletinParametrage,
+ ColonneGroupeEnum colonneEnum,
+ Integer numCol = 0) {
+
+ if (!bulletinParametrage) {
+ throw new IllegalArgumentException("L'objet de paramétrage du bulletin est obligatoire.")
+ }
+
+ switch (colonneEnum) {
+
+ case ColonneGroupeEnum.MOYENNE_PREC:
+
+ switch (numCol) {
+ case 0:
+ return bulletinParametrage.moyennePrec1
+
+ case 1:
+ return bulletinParametrage.moyennePrec2
+
+ default:
+ return bulletinParametrage.moyennePrec3
+ }
+
+ case ColonneGroupeEnum.MOYENNES:
+ return true
+
+ case ColonneGroupeEnum.COEFF:
+ return bulletinParametrage.coefficient
+
+ case ColonneGroupeEnum.RANGS:
+ return bulletinParametrage.rangs
+
+ case ColonneGroupeEnum.MOYENNE_MIN_MAX:
+ return bulletinParametrage.moyenneMinMax
+
+ case ColonneGroupeEnum.NB_NOTES:
+ return bulletinParametrage.nombreNotes
+
+
+ default:
+ return true
+ }
+
+ }
+
+ /**
+ * Retourne le numéro de colonne d'une colonne dans un groupe (exemple dans le groupe Moyenne, on a la colonne Eleve
+ * et la colonne classe)
+ * @param nomChamp
+ * @return
+ */
+ private Integer numCol(String nomChamp) {
+ String dernier = nomChamp.substring(nomChamp.size() - 1, nomChamp.size())
+ try {
+ Integer resultat = Integer.parseInt(dernier) - 1
+ return resultat
+ } catch (NumberFormatException e) {
+ return 0
+ }
+ }
+
+
+}
--- /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.impression.template.fonte
+
+import org.lilie.services.eliot.impression.TemplateChampMemo
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.TemplateJasper
+import net.sf.jasperreports.engine.JRElement
+import net.sf.jasperreports.engine.base.JRBaseTextField
+import net.sf.jasperreports.engine.base.JRBaseStaticText
+import net.sf.jasperreports.engine.JRBand
+import net.sf.jasperreports.engine.JasperReport
+import net.sf.jasperreports.engine.JRSection
+import net.sf.jasperreports.engine.base.JRBaseComponentElement
+import net.sf.jasperreports.components.table.StandardTable
+import net.sf.jasperreports.components.table.StandardColumn
+import org.lilie.services.eliot.impression.template.ImpressionTemplateOutilsService
+
+/**
+ * Gestion des fontes disponibles
+ * @author othe
+ */
+class ImpressionPoliceService {
+
+ ImpressionTemplateOutilsService impressionTemplateOutilsService
+
+ public JasperReport modifierTemplate(JasperReport jasperReport,
+ TemplateDocument templateDocument,
+ TemplateJasper templateJasper
+
+ ) {
+
+ log.info("Changement fonte")
+ modifierPolice(jasperReport, templateDocument)
+ log.info("Changement taille police")
+ modifierTaille(jasperReport, templateDocument)
+
+ return jasperReport
+
+ }
+
+ private void modifierPolice(JasperReport jasperReport, TemplateDocument templateDocument) {
+
+ JRSection section = jasperReport.detailSection
+
+ // change la police sur le modele
+ if (templateDocument.police) {
+ section.bands.each { JRBand jrBand1 ->
+ setFontName(
+ jrBand1,
+ templateDocument.police
+ )
+ }
+
+ setFontName(
+ jasperReport.getColumnHeader(),
+ templateDocument.police
+ )
+
+ setFontName(
+ jasperReport.getColumnFooter(),
+ templateDocument.police
+ )
+
+ }
+
+ }
+
+
+ private void modifierTaille(JasperReport jasperReport, TemplateDocument templateDocument) {
+ List<TemplateChampMemo> allTaillePolice = findAllTaillePoliceMemo(templateDocument)
+
+ if (allTaillePolice) {
+
+ JRSection section = jasperReport.detailSection
+
+ section.bands.each { JRBand jrBand1 ->
+ setFontSize(
+ jrBand1,
+ allTaillePolice
+ )
+ }
+
+ setFontSize(
+ jasperReport.getColumnHeader(),
+ allTaillePolice
+ )
+
+ }
+
+ }
+
+ public void setFontSize(JRBand jrBand, List<TemplateChampMemo> allChampMemo) {
+
+ if (jrBand) {
+ jrBand.children.each {
+
+ JRElement element ->
+
+ modifieTaillePoliceZoneMemo(
+ element,
+ allChampMemo
+ )
+
+ }
+ }
+
+ }
+
+ /**
+ * Recherche la taille de police pour un champ memo
+ * @param allTaillePolice
+ * @param memoName
+ * @return la taille de police ou null si on ne la change pas
+ */
+ private Integer rechercheTaillePoliceMemo(List<TemplateChampMemo> allTaillePolice, String memoName) {
+
+ TemplateChampMemo memoTaillePolice = allTaillePolice.find {
+ it.champ == memoName
+ }
+
+ return memoTaillePolice?.size
+ }
+
+ /**
+ * affecte une fonte à l'item
+ * @param element
+ * @param fontName
+ */
+ public void setElementFontName(JRElement element, String fontName) {
+
+ if (fontName) {
+
+ switch (element.getClass()) {
+ case JRBaseTextField:
+
+ JRBaseTextField baseTextField = (JRBaseTextField) element
+ baseTextField.fontName = fontName
+
+ break
+
+ case JRBaseStaticText:
+
+ JRBaseStaticText baseTextField = (JRBaseStaticText) element
+ baseTextField.fontName = fontName
+
+ break
+
+ case JRBaseComponentElement:
+
+ JRBaseComponentElement componentElement = (JRBaseComponentElement) element
+
+ if (componentElement.component instanceof StandardTable) {
+ StandardTable standardTable = (StandardTable) componentElement.component
+
+ standardTable.columns.each { StandardColumn column ->
+
+ column.detailCell.children.each {JRElement elementTable ->
+
+ setElementFontName(
+ elementTable,
+ fontName
+ )
+
+ }
+ }
+ }
+
+ break
+
+ }
+ }
+
+ }
+
+ /**
+ * changement de taille de la police
+ * @param element
+ * @param size
+ */
+ private void setFontSize(JRElement element, Integer size) {
+
+ if (element instanceof JRBaseTextField) {
+ JRBaseTextField baseTextField = (JRBaseTextField) element
+ baseTextField.fontSize = size
+ }
+
+ if (element instanceof JRBaseStaticText) {
+ JRBaseStaticText baseTextField = (JRBaseStaticText) element
+ baseTextField.fontSize = size
+ }
+
+ }
+
+ /**
+ * Modifie les fontes sur une bande
+ * @param jrBand
+ * @param fontName
+ */
+ public void setFontName(JRBand jrBand, String fontName) {
+ if (jrBand) {
+ jrBand.children.each {
+
+ JRElement element ->
+ setElementFontName(
+ element,
+ fontName
+ )
+ }
+ }
+
+ }
+
+ /**
+ * Retrouve la liste des champMemo qui ont une taille de police particulière pour un template document donné
+ * @param templateDocument
+ * @return
+ */
+ private List<TemplateChampMemo> findAllTaillePoliceMemo(TemplateDocument templateDocument) {
+
+ List<TemplateChampMemo> resultat = []
+
+ TemplateChampMemo.findAllByTemplateDocument(templateDocument).each {
+ TemplateChampMemo champMemo ->
+ if (champMemo.size) {
+ resultat << champMemo
+ }
+ }
+ return resultat
+ }
+
+ /**
+ * Modification de la taille des polices dans les champs memo
+ * @param element
+ * @param allTaillePolice
+ */
+ private void modifieTaillePoliceZoneMemo(JRElement element, List<TemplateChampMemo> allTaillePolice) {
+
+ if (element instanceof JRBaseTextField) {
+
+ JRBaseTextField jrBaseTextField = (JRBaseTextField) element
+
+ String memoName = impressionTemplateOutilsService.getNomChamp(jrBaseTextField)
+
+ if (memoName) {
+
+ Integer nouvelleTaillePolice = rechercheTaillePoliceMemo(
+ allTaillePolice,
+ memoName
+ )
+
+ if (nouvelleTaillePolice) {
+
+ setFontSize(
+ element,
+ nouvelleTaillePolice
+ )
+
+ }
+ }
+
+ }
+ }
+
+ /**
+ * lecture de la liste des fontes disponibles
+ * @return
+ */
+ public List<String> getAllFontes() {
+ List<String> resultat = ["Aucune"]
+ return resultat
+ }
+
+ /**
+ * Liste des tailles de police disponibles
+ * @return
+ */
+ public List<Integer> getAllTaillePolice() {
+ List<Integer> resultat = []
+ resultat << 6
+ resultat << 8
+ resultat << 10
+ resultat << 12
+ resultat << 14
+ resultat << 18
+ resultat << 24
+ resultat << 36
+ return resultat
+ }
+
+}
--- /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.impression.template.fonte
+
+/**
+ * Liste des fontes utilisables
+ * @author othe
+ */
+public enum PoliceEnum {
+
+ ARIAL('Arial')
+
+ String nom
+
+ PoliceEnum(String police) {
+ this.nom = police
+ }
+
+ /**
+ * Vérification de la validité du nom de police
+ * @param nom
+ */
+ static public Boolean verifie(String nom) {
+
+ Boolean resultat = false
+
+ PoliceEnum.each {PoliceEnum policeEnum ->
+ if (policeEnum.nom == nom) {
+ resultat = true
+ }
+ }
+
+ return resultat
+ }
+
+}
\ No newline at end of file
BigDecimal valeurNumerique = null\r
NoteTextuelle valeurTextuelle = null\r
MoyenneType type = MoyenneType.NUMERIQUE // numerique par defaut\r
+ Integer nbNotes\r
\r
\r
Moyenne(BigDecimal valeurNumerique) {\r
toList().sort { it.ordre }
}
+ Periode findPeriodeByOrdre(StructureEnseignement classe, Integer ordre) {
+ if (!classe.isClasse()) {
+ throw new IllegalArgumentException("Strcture d'enseignement [{$classe.id}"+
+ " {$classe.code}] n'est pas une classe")
+ }
+ return classe.periodes.find {it.isPeriodeXmestre() && it.ordre == ordre}
+ }
+
}
+/*
+ * 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.scolarite.structureenseignement
import org.lilie.services.eliot.scolarite.StructureEnseignement
--- /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.impression
+
+import org.lilie.services.eliot.impression.constantes.TemplateTypeDonneeEnum
+import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.MatiereImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.NoteImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.SousMatiereImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.absences.AbsencesImpression
+import org.lilie.services.eliot.impression.donnees.eleve.absences.RetardImpression
+import org.lilie.services.eliot.impression.donnees.eleve.brevet.BrevetImpression
+import org.lilie.services.eliot.impression.donnees.eleve.brevet.BrevetLigneImpression
+import org.lilie.services.eliot.impression.donnees.eleve.notetextuelle.NoteTextuelleImpression
+import org.lilie.services.eliot.scolarite.Etablissement
+
+import java.text.SimpleDateFormat
+
+/**
+ * Retourne des objets pré-paramétrés pour l'aperçu
+ * @author othe
+ */
+class Donnees {
+
+ private static final String LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
+ private static final String ASSEZ_BIEN = "assez bien."
+ private static final String ORAL = "oral"
+ private static final String ECRIT = "écrit"
+
+ static public List<EleveImpressionInfo> data(Etablissement etablissement,
+ TemplateDocument templatedocument) {
+
+ Class<? extends EleveImpressionInfo> clazzEleve = getClassDonnees(templatedocument)
+ List<EleveImpressionInfo> donnee = []
+ donnee << eleve(etablissement, clazzEleve)
+ return donnee
+ }
+
+ /**
+ * Permet de récupérer la classe de l'objet de donnée associé au templateDocument
+ * @param templatedocument
+ * @return
+ */
+ private static def getClassDonnees(TemplateDocument templatedocument) {
+ Class clazzEleve
+ if (templatedocument.templateEliot.typeDonnees.code.toString() == TemplateTypeDonneeEnum.ELEVE_BREVET.toString()) {
+ clazzEleve = BrevetImpression
+ }
+ else {
+ clazzEleve = EleveImpressionInfo
+ }
+ return clazzEleve
+ }
+
+ static public EleveImpressionInfo eleve(Etablissement etablissement, Class clazzEleve) {
+
+ EleveImpressionInfo eleveImpression = initialiserEleveImpressionInfo(
+ etablissement,
+ clazzEleve
+ )
+
+ eleveImpression.annee_scol_deb = "2011"
+ eleveImpression.annee_scol_fin = "2012"
+
+ eleveImpression.etablissement_academie = etablissement.academie
+
+ eleveImpression.etablissement_nature = etablissement.typeEtablissement
+
+ eleveImpression.setPeriodeDebut(new Date())
+ eleveImpression.setPeriodeFin(new Date())
+
+ prepareNotesTextuelles(eleveImpression)
+
+ prepareNotesFrancais(eleveImpression)
+ prepareNotesAllemand(eleveImpression)
+ prepareNotesMath(eleveImpression)
+ prepareNotesHist(eleveImpression)
+ prepareNotesPhilo(eleveImpression)
+
+ SimpleDateFormat sdf = new SimpleDateFormat(
+ "dd MMMM yyyy",
+ Locale.FRANCE
+ )
+
+ eleveImpression.dateDuJour = sdf.format(new Date())
+
+ if (clazzEleve == BrevetImpression) {
+ addBrevetNotes(eleveImpression)
+ }
+
+ return eleveImpression
+ }
+
+ /**
+ * Notes de Francais
+ * @param eleveImpression
+ */
+ static void prepareNotesFrancais(EleveImpressionInfo eleveImpression) {
+ MatiereImpressionInfo francais = creerMatiereImpressionInfoFrancais()
+ eleveImpression.donneesTableau.lignesTableau << francais
+
+ eleveImpression.donneesTableau.nomPeriodePrecedente1 = "TRIM1"
+ eleveImpression.donneesTableau.nomPeriodePrecedente2 = "TRIM2"
+ eleveImpression.donneesTableau.nomPeriodePrecedente3 = "TRIM3"
+
+ SousMatiereImpressionInfo ecrit = creerSousMatiereImpressionInfoEcrit()
+ francais.sousMatieres << ecrit
+ SousMatiereImpressionInfo oral = creerSousMatiereImpressionInfoOral()
+ francais.sousMatieres << oral
+
+ francais.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°4', note: 12.50, noteMax: 20)
+ francais.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°5', note: 15.50, noteMax: 20)
+ francais.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°6', note: 8.50, noteMax: 20)
+ ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°11', note: 6.50, noteMax: 10)
+ ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°12', note: 12.50, noteMax: 20)
+ }
+
+ /**
+ * Notes de Philo
+ * @param eleveImpression
+ */
+ static void prepareNotesPhilo(EleveImpressionInfo eleveImpression) {
+ MatiereImpressionInfo philo = creerMatiereImpressionInfoPhilo()
+ eleveImpression.donneesTableau.lignesTableau << philo
+ }
+
+ /**
+ * Notes de Math
+ * @param eleveImpression
+ */
+ static void prepareNotesMath(EleveImpressionInfo eleveImpression) {
+ MatiereImpressionInfo math = creerMatiereImpressionInfoMath()
+ eleveImpression.donneesTableau.lignesTableau << math
+
+ math.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°7', note: 6.50, noteMax: 20)
+ math.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°8', note: 12.50, noteMax: 20)
+ math.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°9', note: 15.50, noteMax: 20)
+ math.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°10', note: 8.50, noteMax: 20)
+ }
+
+ /**
+ * Notes d'allemand
+ * @param eleveImpression
+ */
+ static void prepareNotesAllemand(EleveImpressionInfo eleveImpression) {
+ MatiereImpressionInfo allemand = creerMatiereImpressionInfoAllemand()
+ eleveImpression.donneesTableau.lignesTableau << allemand
+
+ SousMatiereImpressionInfo ecrit = creerSousMatiereImpressionInfoEcrit()
+ allemand.sousMatieres << ecrit
+
+ SousMatiereImpressionInfo oral = creerSousMatiereImpressionInfoOral()
+ allemand.sousMatieres << oral
+
+ SousMatiereImpressionInfo commentaire = creerSousMatiereImpressionInfoHistoire()
+ allemand.sousMatieres << commentaire
+
+ allemand.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°7', note: 6.50, noteMax: 20)
+ allemand.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°8', note: 12.50, noteMax: 20)
+ allemand.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°9', note: 15.50, noteMax: 20)
+ allemand.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°10', note: 8.50, noteMax: 20)
+ }
+
+ /**
+ * Notes de Hist
+ * @param eleveImpression
+ */
+ static void prepareNotesHist(EleveImpressionInfo eleveImpression) {
+ MatiereImpressionInfo hist = creerMatiereImpressionInfoHistoire()
+ eleveImpression.donneesTableau.lignesTableau << hist
+
+ hist.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°1', note: 15.50, noteMax: 20)
+ hist.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°2', note: 8.50, noteMax: 20)
+ hist.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°3', note: 6.50, noteMax: 20)
+ }
+
+ /**
+ * Donnes des notes textuelles
+ * @param eleveImpressionInfo
+ */
+ static void prepareNotesTextuelles(EleveImpressionInfo eleveImpression) {
+
+ eleveImpression.donneesTableau.allNoteTextuelleImpression.annotationsUtilisees << new NoteTextuelleImpression(
+ code: 'ABS',
+ libelle: 'Absent')
+ eleveImpression.donneesTableau.allNoteTextuelleImpression.annotationsUtilisees << new NoteTextuelleImpression(
+ code: 'DISP',
+ libelle: 'Dispensé')
+ eleveImpression.donneesTableau.allNoteTextuelleImpression.annotationsUtilisees << new NoteTextuelleImpression(
+ code: 'NN',
+ libelle: 'Non noté')
+ eleveImpression.donneesTableau.allNoteTextuelleImpression.annotationsUtilisees << new NoteTextuelleImpression(
+ code: 'NR',
+ libelle: 'Non rendu')
+ }
+
+ private static addBrevetNotes(EleveImpressionInfo eleveImpressionInfo) {
+
+ BrevetImpression brevetImpressionInfo = (BrevetImpression) eleveImpressionInfo
+
+ brevetImpressionInfo.eleve_serie_brevet = "COLLEGE, options de série LATIN"
+
+ brevetImpressionInfo.avis_chef_etablissement = "Bon"
+
+ brevetImpressionInfo.totalDesPoints = "149.5/220"
+
+ brevetImpressionInfo.tableauBrevet << new BrevetLigneImpression(
+ epreuves: "Français",
+ classe: "12.50",
+ eleve: "12.70",
+ appreciation: "Bien",
+ noteGlobale: "13.0/20"
+ )
+
+ brevetImpressionInfo.tableauBrevet << new BrevetLigneImpression(
+ epreuves: "Mathématiques",
+ classe: "15.50",
+ eleve: "13.90",
+ appreciation: "Bons résultats",
+ noteGlobale: "14.0/20"
+ )
+
+ brevetImpressionInfo.tableauBrevet << new BrevetLigneImpression(
+ epreuves: "1ere langue vivante : Anglais LV1",
+ classe: "15.70",
+ eleve: "12.80",
+ appreciation: "",
+ noteGlobale: "13.0/20"
+ )
+
+ brevetImpressionInfo.tableauOptions << new BrevetLigneImpression(
+ epreuves: "Option facultative : LATIN",
+ classe: "15.70",
+ eleve: "12.80",
+ appreciation: "",
+ noteGlobale: "5.0"
+ )
+
+ brevetImpressionInfo.tableauOptions << new BrevetLigneImpression(
+ epreuves: "Niveau A2 de langue régionale",
+ classe: "",
+ eleve: "AB",
+ appreciation: "",
+ noteGlobale: ""
+ )
+
+ brevetImpressionInfo.tableauIndicatif << new BrevetLigneImpression(
+ epreuves: "Histoire-Géographie",
+ classe: "13.60",
+ eleve: "11.10",
+ appreciation: "",
+ noteGlobale: ""
+ )
+
+ brevetImpressionInfo.tableauIndicatif << new BrevetLigneImpression(
+ epreuves: "Education civique",
+ classe: "13.60",
+ eleve: "11.10",
+ appreciation: "",
+ noteGlobale: ""
+ )
+
+ brevetImpressionInfo.totalDesPoints = "149.5/220"
+
+ }
+
+ private static MatiereImpressionInfo creerMatiereImpressionInfoHistoire() {
+ return addNbElevesNotes(new MatiereImpressionInfo(
+ prof: "Mme D'HARCOURT",
+ libelle: "HISTOIRE GEO",
+ moyenneEleve: 7.5,
+ moyenneClasse: 16.75,
+ rangs: "10/30",
+ moyenneMin: 11.2,
+ moyenneMax: 20.05,
+ appreciation: "Eleve très moyen. En amélioration.",
+ coeff: "COEFF_"
+ )
+ )
+ }
+
+ private static MatiereImpressionInfo creerMatiereImpressionInfoPhilo() {
+ return addNbElevesNotes(new MatiereImpressionInfo(
+ prof: "Arovet L.I",
+ libelle: "PHILOSOPHIE",
+ moyenneEleve: 7.5,
+ moyenneClasse: 16.75,
+ rangs: "10/30",
+ moyenneMin: 11.2,
+ moyenneMax: 20.05,
+ appreciation: LOREM_IPSUM,
+ coeff: 1
+ ))
+ }
+
+ private static MatiereImpressionInfo creerMatiereImpressionInfoMath() {
+ return addNbElevesNotes(new MatiereImpressionInfo(
+ prof: "M. KRIEG",
+ libelle: "MATHEMATIQUES",
+ moyenneEleve: 10.3,
+ moyenneClasse: 11.7,
+ rangs: "10/30",
+ appreciation: "",
+ moyenneMin: 11.2,
+ moyenneMax: 16.3,
+ coeff: 2
+ )
+ )
+ }
+
+ private static MatiereImpressionInfo creerMatiereImpressionInfoAllemand() {
+ return addNbElevesNotes(new MatiereImpressionInfo(
+ prof: "M. DUPOND, M. DURANT, P. MARTIN, F. RAYON, G. DOURY",
+ libelle: "ALLEMAND",
+ moyenneEleve: 10.3,
+ moyenneClasse: 11.7,
+ rangs: "12/30",
+ moyenneMin: 11.2,
+ moyenneMax: 16.3,
+ appreciation: LOREM_IPSUM
+ ))
+ }
+
+
+ private static SousMatiereImpressionInfo addNbElevesNotes(SousMatiereImpressionInfo impressionInfo) {
+ impressionInfo.nbNotes = 5
+ impressionInfo.moyennePrec1 = "10.5"
+ impressionInfo.moyennePrec2 = "11.5"
+ impressionInfo.moyennePrec3 = "9.5"
+ return impressionInfo
+ }
+
+ private static SousMatiereImpressionInfo creerSousMatiereImpressionInfoOral() {
+ return addNbElevesNotes(new SousMatiereImpressionInfo(
+ libelle: ORAL,
+ moyenneEleve: 10.3,
+ moyenneClasse: 11.7,
+ rangs: "10/30",
+ moyenneMin: 11.2,
+ moyenneMax: 16.3,
+ nbNotes: 1,
+ appreciation: "",
+ coeff: 1
+ ))
+ }
+
+ private static SousMatiereImpressionInfo creerSousMatiereImpressionInfoEcrit() {
+ return new SousMatiereImpressionInfo(
+ libelle: ECRIT,
+ moyenneEleve: 10.3,
+ moyenneClasse: 11.7,
+ rangs: "10/30",
+ moyenneMin: 11.2,
+ moyenneMax: 16.3,
+ nbNotes: 2,
+ coeff: 1
+ )
+ }
+
+ private static SousMatiereImpressionInfo creerSousMatiereImpressionInfoHistoire() {
+ return new SousMatiereImpressionInfo(
+ libelle: "histoire",
+ moyenneEleve: 11.3,
+ moyenneClasse: 12.7,
+ rangs: "10/30",
+ moyenneMin: 13.2,
+ moyenneMax: 16.3,
+ nbNotes: 2,
+ coeff: 1
+ )
+ }
+
+ private static MatiereImpressionInfo creerMatiereImpressionInfoFrancais() {
+ return new MatiereImpressionInfo(
+ prof: "Alcofribas Nasier",
+ libelle: "Français",
+ moyenneEleve: 15.3,
+ moyenneClasse: 11.7,
+ rangs: "10/30",
+ moyenneMin: 11.2,
+ moyenneMax: 16.3,
+ appreciation: ASSEZ_BIEN,
+ coeff: 1
+ )
+ }
+
+ private static EleveImpressionInfo initialiserEleveImpressionInfo(
+ Etablissement etablissement,
+ Class clazzEleve) {
+ EleveImpressionInfo eleveImpression = (EleveImpressionInfo) clazzEleve.newInstance()
+ eleveImpression.etablissement = etablissement.nomAffichage
+ eleveImpression.classe_ProfPrincipal = "M. Langlois"
+ eleveImpression.classe_PeriodeNom = "trimestre 1"
+ eleveImpression.eleve_Classe = '2NDE5'
+ eleveImpression.eleve_DateNaissance = '25/05/1995'
+ eleveImpression.eleve_Nom = "PIGNON"
+ eleveImpression.eleve_Prenom = "François"
+ eleveImpression.eleve_NbAbsence = 2
+ eleveImpression.eleve_Sexe = "M"
+
+ eleveImpression.parent1_Nom = "PIGNON"
+ eleveImpression.parent1_Prenom = "Victor"
+ eleveImpression.parent1_Adresse = "rue du pré fleuri"
+ eleveImpression.parent1_CodePostal = "03000"
+ eleveImpression.parent1_Ville = "MOULINS"
+
+ eleveImpression.parent2_Nom = "PIGNON"
+ eleveImpression.parent2_Prenom = "Agnès"
+ eleveImpression.parent2_Adresse = "rue du pré fleuri"
+ eleveImpression.parent2_CodePostal = "03000"
+ eleveImpression.parent2_Ville = "MOULINS"
+ eleveImpression.eleve_ClasseLibelleLong = eleveImpression.eleve_Classe
+
+ eleveImpression.donneesTableau.avis1 = "bon travail"
+ eleveImpression.donneesTableau.avis2 = "Peut passer en classe supérieure."
+
+ eleveImpression.donneesTableau.libelleAvis1 = "Avis général"
+ eleveImpression.donneesTableau.libelleAvis2 = "Orientation"
+
+ eleveImpression.donneesTableau.appreciationGenrale = "Travailleur mais un peu trop bavard."
+
+ eleveImpression.textTitre = ""
+
+ eleveImpression.donneesTableau.moyenneMin = 5.0
+ eleveImpression.donneesTableau.moyenneMax = 15.0
+ eleveImpression.donneesTableau.moyenneEleve = "MOYGEN"
+ eleveImpression.donneesTableau.moyenneClasse = 10.0
+
+ eleveImpression.absences << new AbsencesImpression(
+ date: new Date(2011 - 1900, 2, 10),
+ heureDebut: "08H00",
+ heureFin: "12H00",
+ motif: "Maladie"
+ )
+
+ eleveImpression.absences << new AbsencesImpression(
+ date: new Date(2011 - 1900, 3, 16),
+ heureDebut: "08H00",
+ heureFin: "18H00",
+ motif: "Maladie"
+ )
+
+ eleveImpression.retards << new RetardImpression(
+ date: new Date(2011 - 1900, 1, 16),
+ heureDebut: "08H00",
+ heureFin: "08H20",
+ motif: "Retard SNCF"
+ )
+ return eleveImpression
+ }
+}
--- /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.impression
+
+import org.lilie.services.eliot.impression.template.bulletin.ImpressionBulletinTemplateService
+
+import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import net.sf.jasperreports.engine.JasperPrint
+import org.lilie.services.eliot.test.PopulationTestEtablissement
+import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+import net.sf.jasperreports.engine.base.JRBasePrintPage
+import net.sf.jasperreports.engine.fill.JRTemplatePrintText
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.scolarite.IntervalleEnum
+import org.lilie.services.eliot.impression.template.bulletin.colonne.AllDescriptionColonne
+
+class ImpressionBulletinTemplateServiceTests extends GroovyTestCase {
+
+ ImpressionBulletinTemplateService impressionBulletinTemplateService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
+ ImpressionTemplateDocumentService impressionTemplateDocumentService
+ ImpressionMoteurService impressionMoteurService
+ LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
+
+ Etablissement etablissement
+ TemplateDocument templateDocument
+
+ protected void setUp() {
+
+ super.setUp()
+
+ templateDocument = chargeTemplateBulletin()
+
+ etablissement = localInitDonneesCommunesTestService.getEtablissement(
+ PopulationTestEtablissement.ETABLISSEMENT_1
+ )
+
+ }
+
+ private TemplateDocument chargeTemplateBulletin() {
+
+ List<TemplateDocument> allTemplateDoc = impressionTemplateDocumentService.
+ findTemplateDocumentForTypeFonctionnalite(
+ null,
+ TemplateTypeFonctionnaliteEnum.BULLETIN_NOTES
+ )
+
+ return allTemplateDoc[0]
+
+ }
+
+ void testDetectionModeleBulletin() {
+
+ assertTrue "on a un modele de bulletin",
+ impressionBulletinTemplateService.isModeleBulletin(templateDocument)
+
+ }
+
+
+ private List<String> listeZoneDeTextesMoyPrec(TypePeriode typePeriode, boolean prec) {
+
+ BulletinOptions bulletinOptions = new BulletinOptions(
+ templateDocument: templateDocument,
+ moyenneGenerale: true,
+ coefficient: true,
+ moyennePrecedente: prec,
+ moyenneMinMax: true,
+ nombreNotes: true,
+ rangs: false
+ )
+
+ bulletinOptions.save(flush: true)
+
+ return listeZoneDeTextes(typePeriode)
+
+ }
+
+
+ private List<String> listeZoneDeTextesCoeff(TypePeriode typePeriode, boolean coeff) {
+
+ BulletinOptions bulletinOptions = new BulletinOptions(
+ templateDocument: templateDocument,
+ moyenneGenerale: true,
+ coefficient: coeff,
+ moyennePrecedente: true,
+ moyenneMinMax: true,
+ nombreNotes: true,
+ rangs: false
+ )
+
+ bulletinOptions.save(flush: true)
+
+ return listeZoneDeTextes(typePeriode)
+
+ }
+
+ private List<String> listeZoneDeTextesMoyGen(TypePeriode typePeriode, boolean moygen) {
+
+ BulletinOptions bulletinOptions = new BulletinOptions(
+ templateDocument: templateDocument,
+ moyenneGenerale: moygen,
+ coefficient: true,
+ moyennePrecedente: true,
+ moyenneMinMax: true,
+ nombreNotes: true,
+ rangs: false
+ )
+
+ bulletinOptions.save(flush: true)
+
+ return listeZoneDeTextes(typePeriode)
+
+ }
+
+ private Map listeTaillesZoneDeTextes(TypePeriode typePeriode) {
+
+ Map resultat = [:]
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ typePeriode
+ )
+
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: Donnees.data(
+ etablissement,
+ templateDocument),
+ options: bulletinOptionsPersonnalise
+ )
+
+ JasperPrint jasperPrint = impressionMoteurService.construitJasperPrint(
+ donneesOptions,
+ etablissement,
+ templateDocument
+ )
+
+ jasperPrint.getPages().each {JRBasePrintPage jrBasePrintPage ->
+
+ jrBasePrintPage.getElements().each {
+
+ switch (it.getClass()) {
+ case JRTemplatePrintText:
+ JRTemplatePrintText jrTemplatePrintText = (JRTemplatePrintText) it
+ resultat[jrTemplatePrintText.text] =
+ new InfoPosition(width: jrTemplatePrintText.width, left: jrTemplatePrintText.x)
+ break
+
+ }
+ }
+
+ }
+
+ return resultat
+ }
+
+ /**
+ * Récupère la liste des textes
+ * @param typePeriode
+ * @return
+ */
+ private List<String> listeZoneDeTextes(TypePeriode typePeriode) {
+
+ List<String> resultat = []
+
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ typePeriode
+ )
+
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: Donnees.data(
+ etablissement,
+ templateDocument),
+ options: bulletinOptionsPersonnalise
+ )
+
+ JasperPrint jasperPrint = impressionMoteurService.construitJasperPrint(
+ donneesOptions,
+ etablissement,
+ templateDocument
+ )
+
+ jasperPrint.getPages().each {JRBasePrintPage jrBasePrintPage ->
+
+ jrBasePrintPage.getElements().each {
+
+ switch (it.getClass()) {
+ case JRTemplatePrintText:
+ JRTemplatePrintText jrTemplatePrintText = (JRTemplatePrintText) it
+ resultat << jrTemplatePrintText.text
+ break
+
+ }
+ }
+
+ }
+
+ return resultat
+ }
+
+ void testImpressionBulletinT1() {
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T1)
+
+ List<String> allChaines = listeZoneDeTextesMoyPrec(typePeriode, true)
+ assertEquals "La colonne trimestre 1 ne devrait pas être imprimée", allChaines.indexOf("TRIM1"), -1
+ assertEquals "La colonne trimestre 2 ne devrait pas être imprimée", allChaines.indexOf("TRIM2"), -1
+ assertEquals "La colonne trimestre 3 ne devrait pas être imprimée", allChaines.indexOf("TRIM3"), -1
+ }
+
+ void testImpressionBulletinT2() {
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T2)
+
+ List<String> allChaines = listeZoneDeTextesMoyPrec(typePeriode, true)
+
+ assertTrue "La colonne trimestre 1 devrait être imprimée", allChaines.indexOf("TRIM1") != -1
+ assertEquals "La colonne trimestre 2 ne devrait pas être imprimée", allChaines.indexOf("TRIM2"), -1
+ assertEquals "La colonne trimestre 3 ne devrait pas être imprimée", allChaines.indexOf("TRIM3"), -1
+ }
+
+ void testImpressionBulletinT3() {
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T3)
+
+ List<String> allChaines = listeZoneDeTextesMoyPrec(typePeriode, true)
+
+ assertTrue "La colonne trimestre 1 devrait être imprimée", allChaines.indexOf("TRIM1") != -1
+ assertTrue "La colonne trimestre 2 devrait être imprimée", allChaines.indexOf("TRIM2") != -1
+ assertEquals "La colonne trimestre 3 ne devrait pas être imprimée", allChaines.indexOf("TRIM3"), -1
+ }
+
+ void testImpressionBulletinAnnee() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.ANNEE)
+
+ List<String> allChaines = listeZoneDeTextesMoyPrec(typePeriode, true)
+
+ assertTrue "La colonne trimestre 1 devrait être imprimée", allChaines.indexOf("TRIM1") != -1
+ assertTrue "La colonne trimestre 2 devrait être imprimée", allChaines.indexOf("TRIM2") != -1
+ assertTrue "La colonne trimestre 2 devrait être imprimée", allChaines.indexOf("TRIM3") != -1
+ }
+
+ void testImpressionBulletinAnneeSansMoyPrec() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.ANNEE)
+
+ List<String> allChaines = listeZoneDeTextesMoyPrec(typePeriode, false)
+
+ assertEquals "La colonne trimestre 1 ne devrait pas être imprimée", allChaines.indexOf("TRIM1"), -1
+ assertEquals "La colonne trimestre 2 ne devrait pas être imprimée", allChaines.indexOf("TRIM2"), -1
+ assertEquals "La colonne trimestre 3 ne devrait pas être imprimée", allChaines.indexOf("TRIM3"), -1
+ }
+
+ void testImpressionBulletinAnneeSansCoeff() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T1)
+ List<String> allChaines = listeZoneDeTextesCoeff(typePeriode, false)
+ assertEquals "La colonne coefficent ne devrait pas être imprimée", allChaines.indexOf("COEFF_"), -1
+
+ }
+
+ void testImpressionBulletinAnneeAvecCoeff() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T1)
+ List<String> allChaines = listeZoneDeTextesCoeff(typePeriode, true)
+ assertTrue "La colonne coefficent devrait être imprimée", allChaines.indexOf("COEFF_") != -1
+
+ }
+
+ void testImpressionBulletinAnneeSansMoyenneGenerale() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T1)
+ List<String> allChaines = listeZoneDeTextesMoyGen(typePeriode, false)
+ assertEquals "La ligne moyenne générale ne devrait pas être imprimée", allChaines.indexOf("MOYGEN"), -1
+
+ }
+
+ void testImpressionBulletinAnneeAvecMoyenneGenerale() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T1)
+ List<String> allChaines = listeZoneDeTextesMoyGen(typePeriode, true)
+ assertTrue "La ligne moyenne générale devrait être imprimée", allChaines.indexOf("MOYGEN") != -1
+
+ }
+
+ void testImpressionBulletinVerificationDeLaTaille() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T1)
+ Map donneesPositionEtTaille=listeTaillesZoneDeTextes(typePeriode)
+
+ assertEquals "La colonne matière/enseignants n'est pas de la bonne taille",
+ donneesPositionEtTaille['PHILOSOPHIE'].width,
+ AllDescriptionColonne.LARGEUR_COLONNE_MATIERE_PT
+
+ assertEquals "La colonne appréciation n'a pas la bonne taille",
+ donneesPositionEtTaille['Appréciations'].width,
+ 329
+
+
+ donneesPositionEtTaille.each{ k,v->
+ println k+" : "+v
+ }
+
+ }
+
+
+}
--- /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.impression
+
+import net.sf.jasperreports.engine.JasperPrint
+import net.sf.jasperreports.engine.base.JRBasePrintPage
+import net.sf.jasperreports.engine.fill.JRTemplatePrintText
+import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.bulletin.ImpressionBulletinTemplateService
+import org.lilie.services.eliot.impression.template.bulletin.colonne.AllDescriptionColonne
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.scolarite.IntervalleEnum
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
+import org.lilie.services.eliot.test.PopulationTestEtablissement
+import net.sf.jasperreports.engine.fill.JRTemplatePrintFrame
+import net.sf.jasperreports.engine.fill.JRTemplatePrintRectangle
+import net.sf.jasperreports.engine.JRPrintElement
+import net.sf.jasperreports.engine.export.JRXmlExporter
+import net.sf.jasperreports.engine.JRExporterParameter
+
+class ImpressionDumpServiceTests extends GroovyTestCase {
+
+ ImpressionBulletinTemplateService impressionBulletinTemplateService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
+ ImpressionTemplateDocumentService impressionTemplateDocumentService
+ ImpressionMoteurService impressionMoteurService
+ LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
+
+ Etablissement etablissement
+ TemplateDocument templateDocument
+
+ protected void setUp() {
+
+ super.setUp()
+
+ templateDocument = chargeTemplateBulletin()
+
+ etablissement = localInitDonneesCommunesTestService.getEtablissement(
+ PopulationTestEtablissement.ETABLISSEMENT_1
+ )
+
+ }
+
+ private TemplateDocument chargeTemplateBulletin() {
+
+ List<TemplateDocument> allTemplateDoc = impressionTemplateDocumentService.
+ findTemplateDocumentForTypeFonctionnalite(
+ null,
+ TemplateTypeFonctionnaliteEnum.BULLETIN_NOTES
+ )
+
+ return allTemplateDoc[0]
+
+ }
+
+ private List<String> listeZoneDeTextesMoyPrec(TypePeriode typePeriode, boolean prec) {
+
+ BulletinOptions bulletinOptions = new BulletinOptions(
+ templateDocument: templateDocument,
+ moyenneGenerale: true,
+ coefficient: true,
+ moyennePrecedente: prec,
+ moyenneMinMax: true,
+ nombreNotes: true,
+ rangs: false
+ )
+
+ bulletinOptions.save(flush: true)
+
+ return listeZoneDeTextes(typePeriode)
+
+ }
+
+
+ private List<String> listeZoneDeTextesCoeff(TypePeriode typePeriode, boolean coeff) {
+
+ BulletinOptions bulletinOptions = new BulletinOptions(
+ templateDocument: templateDocument,
+ moyenneGenerale: true,
+ coefficient: coeff,
+ moyennePrecedente: true,
+ moyenneMinMax: true,
+ nombreNotes: true,
+ rangs: false
+ )
+
+ bulletinOptions.save(flush: true)
+
+ return listeZoneDeTextes(typePeriode)
+
+ }
+
+ private Map listeTaillesZoneDeTextes(TypePeriode typePeriode) {
+
+ Map resultat = [:]
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ typePeriode
+ )
+
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: Donnees.data(
+ etablissement,
+ templateDocument),
+ options: bulletinOptionsPersonnalise
+ )
+
+ JasperPrint jasperPrint = impressionMoteurService.construitJasperPrint(
+ donneesOptions,
+ etablissement,
+ templateDocument
+ )
+
+ jasperPrint.getPages().each {JRBasePrintPage jrBasePrintPage ->
+
+ jrBasePrintPage.getElements().each {
+
+ switch (it.getClass()) {
+ case JRTemplatePrintText:
+ JRTemplatePrintText jrTemplatePrintText = (JRTemplatePrintText) it
+ resultat[jrTemplatePrintText.text] =
+ new InfoPosition(width: jrTemplatePrintText.width, left: jrTemplatePrintText.x)
+ break
+
+ }
+ }
+
+ }
+
+ return resultat
+ }
+
+
+ private String trunc(String trunc) {
+ if (trunc.size() > 40) {
+ return trunc.substring(1, 40) + '...'
+ }
+ else {
+ return trunc
+ }
+ }
+
+ private String libelle(def item) {
+ "hauteur=" + item.height + " left=" + item.x + " top=" + item.y
+ }
+
+
+ private String dumpFrame(JRTemplatePrintFrame frame, String marge){
+ String resultat=""
+
+ frame.elements.each {JRPrintElement item ->
+ switch (item.getClass()) {
+ case JRTemplatePrintFrame:
+ JRTemplatePrintFrame fr = (JRTemplatePrintFrame) item
+
+ resultat = resultat + dumpFrame(fr, marge+' ')
+
+ break
+
+ default:
+ resultat = resultat + marge + item
+ }
+ }
+ return resultat
+ }
+
+ private void dump(TypePeriode typePeriode) {
+
+ println "******** DUMP **********"
+
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ typePeriode
+ )
+
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: Donnees.data(
+ etablissement,
+ templateDocument),
+ options: bulletinOptionsPersonnalise
+ )
+
+ JasperPrint jasperPrint = impressionMoteurService.construitJasperPrint(
+ donneesOptions,
+ etablissement,
+ templateDocument
+ )
+
+ FileOutputStream fo=new FileOutputStream('/home/olivier/Bureau/dump.xml')
+
+ JRXmlExporter jrXmlExporter=new JRXmlExporter()
+
+ jrXmlExporter.setParameter(
+ JRExporterParameter.OUTPUT_STREAM,
+ fo
+ )
+
+ jrXmlExporter.setParameter(
+ JRExporterParameter.JASPER_PRINT,
+ jasperPrint
+ )
+ jrXmlExporter.exportReport()
+
+ JRTemplatePrintText
+
+
+//
+// jasperPrint.getPages().each {JRBasePrintPage jrBasePrintPage ->
+//
+// jrBasePrintPage.getElements().each {
+//
+// println "=> " + libelle(it)
+//
+// switch (it.getClass()) {
+// case JRTemplatePrintText:
+// JRTemplatePrintText jrTemplatePrintText = (JRTemplatePrintText) it
+// println trunc(jrTemplatePrintText.text) + " key=" + jrTemplatePrintText.key
+//
+// break
+// case JRTemplatePrintRectangle:
+//// JRTemplatePrintRectangle rectangle=(JRTemplatePrintRectangle)it
+// println "Rectangle"
+// break
+//
+// case JRTemplatePrintFrame:
+// JRTemplatePrintFrame frame = (JRTemplatePrintFrame) it
+// String children = "Frame : "+dumpFrame(frame, " ")
+// println children
+//
+// break
+//
+// default:
+// println it
+//
+// }
+// println "=>"
+// println ""
+// }
+//
+// }
+
+ println "******** DUMP **********"
+ }
+
+
+
+ void testImpressionBulletinAnnee() {
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.ANNEE)
+
+
+ dump(typePeriode)
+
+ }
+
+
+}
'delete from TemplateDocumentSousTemplateEliot'
)
TemplateChampMemo.executeUpdate('delete from TemplateChampMemo')
+ BulletinOptions.executeUpdate('delete from BulletinOptions')
TemplateDocument.executeUpdate('delete from TemplateDocument')
TemplateEliot.executeUpdate('delete from TemplateEliot')
TemplateJasper.executeUpdate('delete from TemplateJasper')
import net.sf.jasperreports.engine.JasperFillManager
import net.sf.jasperreports.engine.JasperPrint
-
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.utils.ChampMemosResolver
-
import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
-import org.lilie.services.eliot.impression.constantes.ConfigImpression
-import org.lilie.services.eliot.impression.constantes.TemplateDocumentEnum
-import org.lilie.services.eliot.impression.constantes.TypeMedia
import org.lilie.services.eliot.notes.EtablissementNotes
import org.lilie.services.eliot.scolarite.EtablissementSts
class ImpressionMoteurServiceTests extends GroovyTestCase {
private static final String JRXML_FILE_NAME = "A4_Notes.jrxml"
- private static final String JRXML_TABLEAU_FILE_NAME = "tableau.jrxml"
- private static final String PDF_FILE_NAME = "/tmp/A4_Notes.pdf"
- private static final String JRXML_SOUS_RAPPORT_FILE_NAME = "LignesMatieres.jrxml"
- private static final String JRXML_SOUS_SOUS_RAPPORT_FILE_NAME = "LignesSousMatieres.jrxml"
private static final String PARAM_A4_NOTES = "A4_Notes"
- private static final String CHAMP_INFO_ELEVE = "textInfoEleve"
ImpressionMoteurService impressionMoteurService
ImpressionImportService impressionImportService
'delete from TemplateDocumentSousTemplateEliot'
)
TemplateChampMemo.executeUpdate('delete from TemplateChampMemo')
+ BulletinOptions.executeUpdate('delete from BulletinOptions')
TemplateDocument.executeUpdate('delete from TemplateDocument')
TemplateEliot.executeUpdate('delete from TemplateEliot')
TemplateJasper.executeUpdate('delete from TemplateJasper')
import org.lilie.services.eliot.annuaire.Niveau
import grails.test.GrailsUnitTestCase
import org.lilie.services.eliot.scolarite.anneescolaire.AnneeScolaireService
-import org.lilie.services.eliot.securite.impl.CompteUtilisateurEtat
+
import org.lilie.services.eliot.notes.EtablissementNotes
import org.lilie.services.eliot.scolarite.EtablissementSts
import org.lilie.services.eliot.scolarite.StructureEnseignementSts
import org.lilie.services.eliot.notes.StructureEnseignementNotes
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
class ImpressionSuiviServiceTests extends GrailsUnitTestCase {
package org.lilie.services.eliot.impression
import org.lilie.services.eliot.impression.utils.ChampPublipostage
+import org.lilie.services.eliot.impression.template.ImpressionTemplateTypeDonneesService
class ImpressionTemplateTypeDonneesServiceTests extends GroovyTestCase {
--- /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.impression
+
+class InfoPosition {
+ Long width
+ Long left
+
+ public String toString(){
+ "With=$width Left=$left"
+ }
+
+}
+++ /dev/null
-package org.lilie.services.eliot.impression
-
-import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
-import org.lilie.services.eliot.impression.donnees.eleve.MatiereImpressionInfo
-import org.lilie.services.eliot.impression.donnees.eleve.SousMatiereImpressionInfo
-import org.lilie.services.eliot.impression.donnees.eleve.NoteImpressionInfo
-
-/**
- * Jeu de données
- * @author fsil, othe
- */
-class JeuDonnees {
-
- public EleveImpressionInfo mockEleveImpressionInfo1() {
- EleveImpressionInfo eleveImpression = new EleveImpressionInfo()
- eleveImpression.classe_PeriodeDebut = "01/09/2011"
- eleveImpression.classe_ProfPrincipal = "M. Langlois"
- eleveImpression.classe_PeriodeFin = "20/12/2011"
- eleveImpression.classe_PeriodeNom = "trimestre 1"
- eleveImpression.eleve_Classe = '2NDE5'
- eleveImpression.eleve_DateNaissance = '25/05/1995'
- eleveImpression.eleve_Nom = "PIGNON"
- eleveImpression.eleve_Prenom = "François"
- eleveImpression.eleve_NbAbsence = "1"
- eleveImpression.eleve_Sexe = "M"
-
- eleveImpression.parent1_Nom = "PIGNON"
- eleveImpression.parent1_Prenom = "Victor"
- eleveImpression.parent1_Adresse = "rue du pré fleuri"
- eleveImpression.parent1_CodePostal = "03000"
- eleveImpression.parent1_Ville = "MOULINS"
-
- eleveImpression.parent2_Nom = "PIGNON"
- eleveImpression.parent2_Prenom = "Agnès"
- eleveImpression.parent2_Adresse = "rue du pré fleuri"
- eleveImpression.parent2_CodePostal = "03000"
- eleveImpression.parent2_Ville = "MOULINS"
-
- MatiereImpressionInfo francais = new MatiereImpressionInfo(
- prof: "Mme VIAU",
- libelle: "Sciences de la vie et de la terre",
-
- moyenneEleve: 15.2,
- moyenneClasse: 14.3,
-
- rang: "10/30",
-
- moyenneMin: 11.2,
-
- moyenneMax: 16.3
- )
-
- eleveImpression.donneesTableau.lignesTableau << francais
-
-
- SousMatiereImpressionInfo ecrit = new SousMatiereImpressionInfo(
- libelle: "écrit",
- moyenneEleve: 15.2,
- moyenneClasse: 14.3,
-
- rang: "10/30",
-
- moyenneMin: 11.2,
-
- moyenneMax: 16.3,
- nbNotes: 2
-
- )
-
-
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°1', note: 15.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°2', note: 8.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°3', note: 6.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°4', note: 12.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°5', note: 15.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°6', note: 8.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°7', note: 6.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°8', note: 12.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°9', note: 15.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°10', note: 8.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°11', note: 6.50)
- ecrit.noteImpressions << new NoteImpressionInfo(libelle: 'Devoir n°12', note: 12.50)
-
-
- francais.sousMatieres << ecrit
-
- SousMatiereImpressionInfo oral = new SousMatiereImpressionInfo(
- libelle: "oral",
-
- moyenneEleve: 15.2,
- moyenneClasse: 11.3,
-
- rang: "10/30",
-
- moyenneMin: 11.2,
-
- moyenneMax: 16.3,
- nbNotes: 1,
-
- appreciation: "assez bien"
-
- )
-
- francais.sousMatieres << oral
-
- MatiereImpressionInfo math = new MatiereImpressionInfo(
- prof: "M. KRIEG",
- libelle: "MATHEMATIQUES",
-
- moyenneEleve: 15.2,
- moyenneClasse: 14.3,
-
- rang: "10/30",
-
- moyenneMin: 11.2,
-
- moyenneMax: 16.3
- )
-
- eleveImpression.donneesTableau.lignesTableau << math
-
- MatiereImpressionInfo hist = new MatiereImpressionInfo(
- prof: "Mme D'HARCOURT",
- libelle: "HISTOIRE GEO",
-
- moyenneEleve: 11.2,
- moyenneClasse: 10.3,
-
- rang: "10/30",
-
- moyenneMin: 11.2,
-
- moyenneMax: 20.05,
- appreciation: "aaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa bbbbbbbbbbbbb bbbbbbbbbbbbb bbbbbbbbbbbb aaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaa aaaaaaaaaaaaaaaa bbbbbbbbbbbbb bbbbbbbbbbbbb bbbbbbbbbbbb."
- )
-
- eleveImpression.donneesTableau.lignesTableau << hist
-
- MatiereImpressionInfo bio = new MatiereImpressionInfo(
- prof: "Mme BITTON",
- libelle: "SC VIE ET TERRE",
-
- moyenneEleve: 11.2,
- moyenneClasse: 10.3,
-
- rang: "15/30",
-
- moyenneMin: 11.2,
-
- moyenneMax: 16.3
- )
-
- 30.times {
- eleveImpression.donneesTableau.lignesTableau << bio
- }
-
-
- return eleveImpression
- }
-}
package org.lilie.services.eliot.impression
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
class TemplateDocumentServiceTests extends GroovyTestCase {
libelle: "HISTOIRE GEO",
moyenneEleve: 7.5,
moyenneClasse: 16.75,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 20.05,
appreciation: "Eleve très moyen. En amélioration."
libelle: "MATHEMATIQUES",
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3
)
libelle: "oral",
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
nbNotes: 1,
libelle: "écrit",
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
nbNotes: 2
libelle: "Français",
moyenneEleve: 15.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
appreciation: "assez bien"
--- /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>.
+ -->
+
+<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="othe">
+ <comment>
+ Ajout de la table des options d'impression du bulletin
+ </comment>
+
+ <createTable tableName="bulletin_options" schemaName="impression">
+ <column name="id" type="bigint">
+ <constraints primaryKey="true"/>
+ </column>
+ <column name="template_document_id" type="bigint">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="moyenne_generale" type="boolean">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="coefficient" type="boolean">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="moyenne_precedente" type="boolean">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="moyenne_min_max" type="boolean">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="nombre_notes" type="boolean">
+ <constraints nullable="false"/>
+ </column>
+
+ <column name="rangs" type="boolean">
+ <constraints nullable="false"/>
+ </column>
+
+ </createTable>
+
+ <createSequence sequenceName="bulletin_options_id_seq"
+ schemaName="impression"/>
+
+ <addForeignKeyConstraint
+ baseTableSchemaName="impression"
+ baseTableName="bulletin_options"
+ baseColumnNames="template_document_id"
+ constraintName="fk_bulletin_options_template_document_id"
+ referencedTableName="template_document"
+ referencedColumnNames="id"
+ referencedTableSchemaName="impression"/>
+
+ </changeSet>
+
+
+</databaseChangeLog>
\ No newline at end of file
--- /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="othe">
+
+ <comment>
+ Gestion des polices et taille
+ </comment>
+
+ <addColumn schemaName="impression" tableName="template_document">
+ <column name="police" type="varchar(40)">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+ <addColumn schemaName="impression" tableName="template_champ_memo">
+ <column name="size" type="integer">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+ </changeSet>
+</databaseChangeLog>
\ No newline at end of file
--- /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="agia">
+
+ <comment>
+ Création des champs 'rang' et 'nb_eleves' dans 'entnotes.resultat_eleve_service_periode'
+ </comment>
+
+ <addColumn schemaName="entnotes" tableName="resultat_eleve_service_periode">
+ <column name="rang" type="numeric">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+ <addColumn schemaName="entnotes" tableName="resultat_eleve_service_periode">
+ <column name="nb_eleves" type="numeric">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+
+ </changeSet>
+
+
+ <changeSet id="2" author="agia">
+
+ <comment>
+ Correction du type des champs 'rang' et 'nb_eleves' dans 'entnotes.resultat_eleve_service_periode'
+ </comment>
+
+ <dropColumn schemaName="entnotes" tableName="resultat_eleve_service_periode"
+ columnName="rang"/>
+ <dropColumn schemaName="entnotes" tableName="resultat_eleve_service_periode"
+ columnName="nb_eleves"/>
+
+ <addColumn schemaName="entnotes" tableName="resultat_eleve_service_periode">
+ <column name="rang" type="int">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+ <addColumn schemaName="entnotes" tableName="resultat_eleve_service_periode">
+ <column name="nb_eleves" type="int">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+ </changeSet>
+
+</databaseChangeLog>
\ No newline at end of file
--- /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="agia">
+
+ <comment>
+ Création du champ 'nb_notes' dans 'entnotes.resultat_eleve_service_periode'
+ </comment>
+
+ <addColumn schemaName="entnotes" tableName="resultat_eleve_service_periode">
+ <column name="nb_notes" type="int">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+ <comment>
+ Création du champ 'nb_notes' dans 'entnotes.resultat_eleve_sous_service_periode'
+ </comment>
+
+ <addColumn schemaName="entnotes" tableName="resultat_eleve_sous_service_periode">
+ <column name="nb_notes" type="int">
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+
+ </changeSet>
+</databaseChangeLog>
\ No newline at end of file
<include file="changelogs/scolarite/2013-03-27-0026775.xml"/>
<include file="changelogs/scolarite/2013-03-27-0026455.xml"/>
<include file="changelogs/securite/2013-03-29-0025761.xml"/>
+ <include file="changelogs/scolarite/2013-03-28-0026796.xml"/>
+ <include file="changelogs/scolarite/2013-03-29-0026833.xml"/>
+ <include file="changelogs/scolarite/2013-04-09-0026833.xml"/>
+ <include file="changelogs/scolarite/2013-04-10-0026796.xml"/>
+ <include file="changelogs/scolarite/2013-04-11-0026796.xml"/>
</databaseChangeLog>
import org.lilie.services.eliot.absences.consultation.AbstractConsultationController
import org.lilie.services.eliot.absences.consultation.PublipostageAbsencesService
import org.lilie.services.eliot.applications.absences.BasicCriteresRecherche
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.absences.fonctionnalites.AbsencesFonctionnalite
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
package org.lilie.services.eliot.absences.publipostage.suivipareleve
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
-import org.lilie.services.eliot.impression.ImpressionEditionService
import org.lilie.services.eliot.impression.ImpressionSuiviEleveService
import org.lilie.services.eliot.scolarite.StructureEnseignement
import grails.converters.JSON
import org.lilie.services.eliot.absences.page.Page
import org.lilie.services.eliot.scolarite.Calendrier
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.impression.PublipostageSuivi
import org.lilie.services.eliot.impression.TemplateDocument
LocalStructureEnseignementService localStructureEnseignementService
CalendrierService calendrierService
ImpressionTemplateDocumentService impressionTemplateDocumentService
- ImpressionEditionService impressionEditionService
ImpressionSuiviEleveService impressionSuiviEleveService
/**
CalendrierService calendrierService
LocalStructureEnseignementService localStructureEnseignementService
- PunitionService punitionService
+ AbsencesPunitionService absencesPunitionService
AbsencesPreparationExportCSVService absencesPreparationExportCSVService
EnumMarshallerService enumMarshallerService
int limit = Integer.parseInt(params.limit ?: '0') ?: nbLigneParPage
int start = Integer.parseInt(params.start ?: '0')
Map sortInfo = (Map) JSON.parse(params.sortInfo)
- Map resultats = punitionService.findPunitions(
+ Map resultats = absencesPunitionService.findPunitions(
securiteSession,
securiteSession.personne,
etablissementCourant(),
if (punition) {
try {
- punitionService.supprimePunition(getSecuriteSession(), punition)
+ absencesPunitionService.supprimePunition(getSecuriteSession(), punition)
resultats = [
success: true,
if (punitionParams.id) {
punition = Punition.get(punitionParams.id)
- punitionService.modifiePunition(
+ absencesPunitionService.modifiePunition(
getSecuriteSession(),
punition,
punitionParams
msg = message(code: 'absences.saisie.punitions.modification.succes')
} else {
- punition = punitionService.creePunition(
+ punition = absencesPunitionService.creePunition(
getSecuriteSession(),
punitionParams
)
class SaisieSanctionController extends AbstractAbsencesController {
CalendrierService calendrierService
- SanctionService sanctionService
+ AbsencesSanctionService absencesSanctionService
ConsultationService consultationService
PlageHoraireService plageHoraireService
AbsencesPreparationExportCSVService absencesPreparationExportCSVService
Personne enseignent = securiteSession.personne
- Map resultats = sanctionService.findAllSanctionParPersonne(
+ Map resultats = absencesSanctionService.findAllSanctionParPersonne(
securiteSession,
etablissementCourant(),
enseignent,
if (sanction) {
try {
- sanctionService.supprimeSanction(getSecuriteSession(), sanction)
+ absencesSanctionService.supprimeSanction(getSecuriteSession(), sanction)
resultats = [
success: true,
Map resultats = [:]
if (sanction) {
try {
- sanctionService.modifieSanction(
+ absencesSanctionService.modifieSanction(
getSecuriteSession(),
sanction,
sanctionParams
Map resultats = [:]
Sanction sanction = null
try {
- sanction = sanctionService.creeSanction(
+ sanction = absencesSanctionService.creeSanction(
getSecuriteSession(),
sanctionParams
)
import java.text.SimpleDateFormat
import org.lilie.services.eliot.impression.constantes.TypeMedia
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.demon.DemandeTraitementService
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.demon.ChampHistoriqueDemandeTraitement
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
import org.lilie.services.eliot.absences.Sanction
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBord
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordLigne
-import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionService
+import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
import org.lilie.services.eliot.absences.Punition
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
import org.lilie.services.eliot.absences.saisie.discipline.incident.ListeIncidentsInfo
static transactional = true
- SanctionService sanctionService
- PunitionService punitionService
+ AbsencesSanctionService absencesSanctionService
+ AbsencesPunitionService absencesPunitionService
IncidentService incidentService
EleveRecupService eleveRecupService
AffichageIncidentService affichageIncidentService
) {
DonneesPourExportCSV donneesPourExportCSV = new DonneesPourExportCSV()
- Map resultats = sanctionService.findAllSanctionParPersonne(
+ Map resultats = absencesSanctionService.findAllSanctionParPersonne(
securiteSession,
etablissement,
personne
DonneesPourExportCSV donneesPourExportCSV = new DonneesPourExportCSV()
- Map resultats = punitionService.findPunitions(
+ Map resultats = absencesPunitionService.findPunitions(
securiteSession,
personne,
etablissement
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.absences.publipostage.selection.PublipostageCommand
import org.lilie.services.eliot.impression.requetage.ImpressionRequetageAbsencesService
import org.lilie.services.eliot.annuaire.SecuriteSession
publipostageCommand.modeleId
)
- List<EleveImpressionInfo> donneesEleve =
+ List<EleveImpressionInfo> donneesEleve =(List<EleveImpressionInfo>)
impressionRequetageAbsencesService.
lectureDonneesEleve(
publipostageCommand,
* @param demande : paramètres de la demandes
* @return : la liste des données des élèves correspondant à la demande
*/
- List<EleveImpressionInfo> lectureDonneesEleve(
+ Object lectureDonneesEleve(
SecuriteSession securiteSession,
Etablissement etablissement,
TemplateDocument template,
import org.lilie.services.eliot.annuaire.FonctionEnum
import org.lilie.services.eliot.scolarite.personne.eleve.EleveRecupService
import org.lilie.services.eliot.GormUtils
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
-import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionService
+
import org.lilie.services.eliot.absences.saisie.discipline.sanction.exceptions.SanctionException
import org.lilie.services.eliot.absences.saisie.discipline.punition.exceptions.PunitionException
import org.lilie.services.eliot.absences.Sanction
+import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
/**
* Service de gestion des incidents
ProtagonisteIncidentService protagonisteIncidentService
PartenaireAPrevenirIncidentService partenaireAPrevenirIncidentService
EleveRecupService eleveRecupService
- SanctionService sanctionService
- PunitionService punitionService
+ AbsencesSanctionService absencesSanctionService
+ AbsencesPunitionService absencesPunitionService
/**
* Crée un nouvel incident
IncidentException, SanctionException, PunitionException {
// supprime punitions + sanctions
- sanctionService.internalSupprimeSanctions(incident)
- punitionService.internalSupprimePunitions(incident)
+ absencesSanctionService.internalSupprimeSanctions(incident)
+ absencesPunitionService.internalSupprimePunitions(incident)
Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
throw new SuppressionIncidentContrainteException(incident, e)
import org.lilie.services.eliot.GormUtils
import org.lilie.services.eliot.absences.Incident
+import org.lilie.services.eliot.applications.absences.PunitionService
+
/**
* @author bahj
* @author jbui
*/
-class PunitionService {
+class AbsencesPunitionService extends PunitionService {
DroitsService droitsService
EleveRecupService eleveRecupService
description: punitionParams.description,
incident: punitionParams.incident,
etablissement: punitionParams.etablissement,
- preferencesEtablissementAbsences: punitionParams.preferences
+ preferencesEtablissementAbsences: punitionParams.preferences
)
internalSave(result)
return result
if (personneIsEnseignant) {
eleves = eleveRecupService.
findAllEleveByEnseignantAndEtablissement(securiteSession,
- personne,
- etablissement)
+ personne,
+ etablissement)
}
// fait la requête seulement si on n'est pas un prof sans élèves
if (personneIsEnseignant) {
eleves = eleveRecupService.
findAllEleveByEnseignantAndEtablissement(securiteSession,
- personne,
- etablissement)
+ personne,
+ etablissement)
}
// fait la requête seulement si on n'est pas un prof sans élèves
return result
}
- /**
+ /**
* Permet de savoir si une personne est prof ou documentaliste, (si la personne
* a une autre fonction, celle-ci sera plus forte)
* @param securiteSession
// personne est seulement prof/docu
// si elle a une autre fonctionne qui est plus forte, elle gagne
Boolean personneIsEnseignant =
- securiteSession.hasFonctionIn([
- FonctionEnum.ENSEIGNANT,
- FonctionEnum.DOCUMENTALISTE
- ], etablissement.id) &&
- !securiteSession.hasFonctionIn([
- FonctionEnum.DIRECTION,
- FonctionEnum.EDUCATION,
- FonctionEnum.ADMIN_LOCAL,
- FonctionEnum.CHEF_TRAVAUX,
- FonctionEnum.CORRESPONDANT_DEPLOIEMENT
- ], etablissement.id)
+ securiteSession.hasFonctionIn([
+ FonctionEnum.ENSEIGNANT,
+ FonctionEnum.DOCUMENTALISTE
+ ], etablissement.id) &&
+ !securiteSession.hasFonctionIn([
+ FonctionEnum.DIRECTION,
+ FonctionEnum.EDUCATION,
+ FonctionEnum.ADMIN_LOCAL,
+ FonctionEnum.CHEF_TRAVAUX,
+ FonctionEnum.CORRESPONDANT_DEPLOIEMENT
+ ], etablissement.id)
return personneIsEnseignant
}
"""
return hqlFromPunition
}
+
}
import org.lilie.services.eliot.scolarite.personne.eleve.EleveRecupService
import org.lilie.services.eliot.annuaire.FonctionEnum
import org.lilie.services.eliot.absences.Incident
+import org.lilie.services.eliot.applications.absences.SanctionService
/**
* Classe de gestion des sanctions
* @author bahj
*/
-class SanctionService {
+class AbsencesSanctionService extends SanctionService {
static transactional = true
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.QualiteProtagonisteService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.PartenaireAPrevenirService
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
+
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
-import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionService
+
import org.lilie.services.eliot.absences.saisie.appel.AppelTemporaire
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import java.text.DateFormat
import java.text.SimpleDateFormat
+import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
/**
* Donnees pour les tests d'integration specifiques a Absence
QualiteProtagonisteService qualiteProtagonisteService
PartenaireAPrevenirService partenaireAPrevenirService
IncidentService incidentService
- SanctionService sanctionService
+ AbsencesSanctionService absencesSanctionService
TypeSanctionService typeSanctionService
TypePunitionService typePunitionService
- PunitionService punitionService
+ AbsencesPunitionService absencesPunitionService
InitDonneesCommunesTestPreferencesAbsencesService initDonneesCommunesTestPreferencesAbsencesService
public static final CLASS_CODE_1 = 'CLASSE'
import org.lilie.services.eliot.absences.TypePunition
import org.lilie.services.eliot.absences.Punition
import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionParams
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
+
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
-import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionService
+
import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
class InitDonneesCommunesTestDisciplineService extends InitDonneesCommunesTestAbsenceService {
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
PartenaireAPrevenirService partenaireAPrevenirService
- SanctionService sanctionService
+ AbsencesSanctionService absencesSanctionService
TypeSanctionService typeSanctionService
TypePunitionService typePunitionService
- PunitionService punitionService
+ AbsencesPunitionService absencesPunitionService
InitDonneesCommunesTestPreferencesAbsencesService initDonneesCommunesTestPreferencesAbsencesService
private static final PREFIXE_TYPE_INCIDENT_TEST = 'test--type incident'
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return sanctionService.creeSanction(
+ return absencesSanctionService.creeSanction(
securiteSessionDirecteur,
params
)
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return sanctionService.creeSanction(
+ return absencesSanctionService.creeSanction(
securiteSessionDirecteur,
params
)
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return sanctionService.creeSanction(
+ return absencesSanctionService.creeSanction(
securiteSessionDirecteur,
params
)
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return sanctionService.creeSanction(
+ return absencesSanctionService.creeSanction(
securiteSessionDirecteur,
params
)
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return punitionService.creePunition(securiteSession, params)
+ return absencesPunitionService.creePunition(securiteSession, params)
}
/**
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return punitionService.creePunition(securiteSession, params)
+ return absencesPunitionService.creePunition(securiteSession, params)
}
/**
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return punitionService.creePunition(securiteSession, params)
+ return absencesPunitionService.creePunition(securiteSession, params)
}
/**
preferences: preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
)
- return punitionService.creePunition(securiteSession, params)
+ return absencesPunitionService.creePunition(securiteSession, params)
}
}
import grails.test.GrailsUnitTestCase
import org.lilie.services.eliot.absences.saisie.absencejournee.AbsenceJourneeService
import org.lilie.services.eliot.test.PopulationTestActeur
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
+
import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionParams
import org.lilie.services.eliot.test.PopulationTestEtablissement
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.test.InitDonneesCommunesTestPreferencesAbsencesService
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
class AbsenceJourneeServiceIntegrationTests extends GrailsUnitTestCase {
AbsenceJourneeService absenceJourneeService
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
- SanctionService sanctionService
+ AbsencesSanctionService absencesSanctionService
TypeSanctionService typeSanctionService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
GroupeMotifService groupeMotifService
getEtablissement(
PopulationTestEtablissement.ETABLISSEMENT_1
)
- Sanction sanction = sanctionService.creeSanction(
+ Sanction sanction = absencesSanctionService.creeSanction(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeIncidentService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.LieuIncidentService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.QualiteProtagonisteService
-import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionService
+import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.absences.saisie.discipline.punition.exceptions.PunitionDescriptionLongueException
import org.lilie.services.eliot.scolarite.Calendrier
import org.lilie.services.eliot.absences.saisie.discipline.punition.exceptions.PunitionException
-class PunitionServiceTests extends GrailsUnitTestCase {
+class AbsencesPunitionServiceTests extends GrailsUnitTestCase {
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
CalendrierService calendrierService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
TypeIncidentService typeIncidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
- PunitionService punitionService
+ AbsencesPunitionService absencesPunitionService
Etablissement etablissement
PreferencesEtablissementAbsences pref
Boolean exceptionLevee = false
try {
- punitionService.creePunition(
+ absencesPunitionService.creePunition(
securiteSessionEleve,
punitionParams
)
exceptionLevee = false
try {
- punitionService.creePunition(
+ absencesPunitionService.creePunition(
securiteSessionEnseignant,
punitionParams
)
exceptionLevee = false
try {
- punitionService.creePunition(
+ absencesPunitionService.creePunition(
securiteSessionDirecteur2,
punitionParams
)
exceptionLevee
)
- Punition punition3 = punitionService.creePunition(
+ Punition punition3 = absencesPunitionService.creePunition(
securiteSessionDirecteur,
punitionParams
)
"""
exceptionLevee = false
try {
- punitionService.creePunition(
+ absencesPunitionService.creePunition(
securiteSessionDirecteur,
punitionParams
)
punitionParams.date = null
exceptionLevee = false
try {
- punitionService.creePunition(
+ absencesPunitionService.creePunition(
securiteSessionDirecteur,
punitionParams
)
etablissement: etablissement,
preferences: pref
)
- Punition punition = punitionService.creePunition(
+ Punition punition = absencesPunitionService.creePunition(
securiteSessionDirecteur,
punitionParams
)
exceptionLevee = false
try {
- punitionService.modifiePunition(
+ absencesPunitionService.modifiePunition(
securiteSessionEnseignant,
punition,
punitionParams
exceptionLevee = false
try {
- punitionService.modifiePunition(
+ absencesPunitionService.modifiePunition(
securiteSessionDirecteur2,
punition,
punitionParams
exceptionLevee = false
try {
- punitionService.modifiePunition(
+ absencesPunitionService.modifiePunition(
securiteSessionEleve,
punition,
punitionParams
}
assertTrue("Un élève de peut pas modifier de punition.", exceptionLevee)
- Punition punitionModifiee = punitionService.modifiePunition(
+ Punition punitionModifiee = absencesPunitionService.modifiePunition(
securiteSessionDirecteur,
punition,
punitionParams
preferences: pref
)
- Punition punitionASupprimer = punitionService.creePunition(
+ Punition punitionASupprimer = absencesPunitionService.creePunition(
securiteSessionDirecteur,
punitionParams
)
exceptionLevee = false
try{
- punitionService.supprimePunition(securiteSessionEleve, punitionASupprimer)
+ absencesPunitionService.supprimePunition(securiteSessionEleve, punitionASupprimer)
} catch(AutorisationException e){
exceptionLevee = true
}
exceptionLevee = false
try{
- punitionService.supprimePunition(securiteSessionDirecteur2, punitionASupprimer)
+ absencesPunitionService.supprimePunition(securiteSessionDirecteur2, punitionASupprimer)
} catch(AutorisationException e){
exceptionLevee = true
}
exceptionLevee = false
try{
- punitionService.supprimePunition(
+ absencesPunitionService.supprimePunition(
securiteSessionEnseignant,
punitionASupprimer
)
)
Long idPunitionSupprimee = punitionASupprimer.id
- punitionService.supprimePunition(
+ absencesPunitionService.supprimePunition(
securiteSessionDirecteur,
punitionASupprimer
)
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionParams
import org.lilie.services.eliot.securite.AutorisationException
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
+
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentParams
import org.lilie.services.eliot.absences.saisie.discipline.incident.ProtagonisteIncidentParams
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
import org.lilie.services.eliot.absences.saisie.discipline.sanction.exceptions.SanctionDescriptionLongueException
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
-class SanctionServiceTests extends GroovyTestCase {
+class AbsencesSanctionServiceTests extends GroovyTestCase {
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
TypeSanctionService typeSanctionService
- SanctionService sanctionService
+ AbsencesSanctionService absencesSanctionService
IncidentService incidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
Boolean exceptionLevee = false
try {
- sanctionService.creeSanction(
+ absencesSanctionService.creeSanction(
securiteSessionEleve,
sanctionParams
)
exceptionLevee = false
try {
- sanctionService.creeSanction(
+ absencesSanctionService.creeSanction(
securiteSessionEnseignant,
sanctionParams
)
exceptionLevee = false
try {
- sanctionService.creeSanction(
+ absencesSanctionService.creeSanction(
securiteSessionDirecteur,
sanctionParams
)
)
sanctionParams.description = descriptionCourte
- Sanction sanction = sanctionService.creeSanction(
+ Sanction sanction = absencesSanctionService.creeSanction(
securiteSessionDirecteur,
sanctionParams
)
preferences: preferences
)
- Sanction sanction = sanctionService.creeSanction(
+ Sanction sanction = absencesSanctionService.creeSanction(
securiteSessionDirecteur,
sanctionParams
)
Boolean exceptionLevee = false
try {
- sanctionService.modifieSanction(
+ absencesSanctionService.modifieSanction(
securiteSessionEnseignant,
sanction,
sanctionParams
exceptionLevee
)
- sanctionService.modifieSanction(
+ absencesSanctionService.modifieSanction(
securiteSessionDirecteur,
sanction,
sanctionParams
preferences: preferences
)
- Sanction sanction = sanctionService.creeSanction(
+ Sanction sanction = absencesSanctionService.creeSanction(
securiteSessionDirecteur,
sanctionParams
)
Boolean exceptionLevee = false
try {
- sanctionService.supprimeSanction(securiteSessionEnseignant, sanction)
+ absencesSanctionService.supprimeSanction(securiteSessionEnseignant, sanction)
} catch (AutorisationException e) {
exceptionLevee = true
}
exceptionLevee = false
try {
- sanctionService.supprimeSanction(securiteSessionEleve, sanction)
+ absencesSanctionService.supprimeSanction(securiteSessionEleve, sanction)
} catch (AutorisationException e) {
exceptionLevee = true
}
exceptionLevee
)
- sanctionService.supprimeSanction(securiteSessionDirecteur, sanction)
+ absencesSanctionService.supprimeSanction(securiteSessionDirecteur, sanction)
assertNull("La sanction n'a pas été supprimée", Sanction.get(sanction.id))
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.test.InitDonneesCommunesTestDisciplineService
import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionParams
-import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionService
-import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionService
+
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionParams
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
import org.lilie.services.eliot.parametrages.motifs.GroupeMotifService
+import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
+import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
class IncidentServiceIntegrationTests extends GrailsUnitTestCase {
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
PartenaireAPrevenirService partenaireAPrevenirService
- SanctionService sanctionService
- PunitionService punitionService
+ AbsencesSanctionService absencesSanctionService
+ AbsencesPunitionService absencesPunitionService
TypeSanctionService typeSanctionService
TypePunitionService typePunitionService
GroupeMotifService groupeMotifService
preferences: incident.preferencesEtablissementAbsences
)
- return sanctionService.creeSanction(
+ return absencesSanctionService.creeSanction(
sessionDirecteur,
sanctionParams
)
getPreferencesEtablissementForEtablissement(etablissement)
)
- return punitionService.creePunition(
+ return absencesPunitionService.creePunition(
sessionDirecteur,
punitionParams
)
import org.lilie.services.eliot.impression.TemplateDocument
import java.text.SimpleDateFormat
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.publipostage.PublipostageParametresService
impressionRequetageBrevetService=ref("impressionRequetageBrevetService")
publipostageParametresService=ref("publipostageParametresService")
impressionRequetageService=ref('impressionRequetageService')
+ impressionBulletinOptionsService=ref("impressionBulletinOptionsService")
}
}
\ No newline at end of file
import org.lilie.services.eliot.scolarite.PeriodeService
import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
import org.lilie.services.eliot.notes.impression.ImpressionRequetageBulletinReleveService
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
/**
* La classe représente le controlleur de "Bulletin" dans menu "Consultation"
ImpressionRequetageBulletinReleveService impressionRequetageBulletinReleveService
ImpressionMoteurService impressionMoteurService
PeriodeService periodeService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
/**
* @author ywan
eleveImpressionInfo.classe_PeriodeNom = libelleTypePeriode
}
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: eleveImpressionInfos,
+ options: impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ periode.typePeriode
+ )
+ )
+
ByteArrayOutputStream documentPDF = impressionMoteurService.creePdf(
etablissementCourant(),
templateDocument,
- eleveImpressionInfos
+ donneesOptions
)
sendPdfFile(
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.scolarite.Etablissement
+
import org.lilie.services.eliot.impression.ImpressionMoteurService
import org.lilie.services.eliot.impression.ImpressionSuiviEleveService
import org.lilie.services.eliot.notes.resultat.CalcMoyennesInfo
import java.text.SimpleDateFormat
import org.lilie.services.eliot.demon.DemandeTraitementService
import org.codehaus.groovy.grails.commons.ConfigurationHolder
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.notes.page.Page
import org.lilie.services.eliot.scolarite.NaturePeriodeEnum
import org.lilie.services.eliot.notes.publipostage.PublipostageNotesService
import org.lilie.services.eliot.notes.impression.ImpressionRequetageBrevetService
import org.lilie.services.eliot.notes.impression.ImpressionRequetageBulletinReleveService
import org.lilie.services.eliot.notes.brevet.BrevetInscriptionEleve
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
class PublipostageController extends AbstractNotesController {
PublipostageParametresService publipostageParametresService
ImpressionRequetageService impressionRequetageService
BrevetClasseService brevetClasseService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.FRANCE)
final static Integer SEUIL_IMPRESSION = ConfigurationHolder.config.eliot.impression.seuil
// Périodes de notation
// Notations sont commun pour toutes les établissements
List<TypePeriode> listePeriodeNotation =
- notesTypePeriodeService.findAllByNature(
- securiteSession,
- NaturePeriodeEnum.NOTATION)
+ notesTypePeriodeService.findAllByNature(
+ securiteSession,
+ NaturePeriodeEnum.NOTATION)
listePeriodeNotation = publipostageNotesService.trieTypePeriodes(
listePeriodeNotation
)
// Périodes d'examen
List<TypePeriode> listePeriodeExamen =
- notesTypePeriodeService.findAllByEtablissementAndNature(
- securiteSession,
- etablissementCourant(),
- NaturePeriodeEnum.EXAMEN
- )
+ notesTypePeriodeService.findAllByEtablissementAndNature(
+ securiteSession,
+ etablissementCourant(),
+ NaturePeriodeEnum.EXAMEN
+ )
listePeriodeExamen = publipostageNotesService.trieTypePeriodes(
listePeriodeExamen
}
List<Personne> eleves =
- localStructureEnseignementService.findAllPersonnesElevesForAllStructures(
- (Set) classes
- )
+ localStructureEnseignementService.findAllPersonnesElevesForAllStructures(
+ (Set) classes
+ )
SelectionAdresseResponsableEnum adresseResponsableEnum = mapParams.adresseId ?
- SelectionAdresseResponsableEnum.valueOf(
- SelectionAdresseResponsableEnum.class,
- mapParams.adresseId
- ) : null
+ SelectionAdresseResponsableEnum.valueOf(
+ SelectionAdresseResponsableEnum.class,
+ mapParams.adresseId
+ ) : null
List<EleveImpressionInfo> allInfoGeneralesEleve =
- impressionRequetageService.findAllInfoGeneralesEleve(
- securiteSession,
- eleves,
- etablissementCourant(),
- adresseResponsableEnum
- )
+ impressionRequetageService.findAllInfoGeneralesEleve(
+ securiteSession,
+ eleves,
+ etablissementCourant(),
+ adresseResponsableEnum
+ )
eleveInfos =
allInfoGeneralesEleve.collect { EleveImpressionInfo eleveImpressionInfo ->
responsableNum: (adresseResponsableEnum == SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1) ?
1 : 2,
responsable:
- (eleveImpressionInfo.parent_Nom ? eleveImpressionInfo.parent_Nom : '') +
- ' ' +
- (eleveImpressionInfo.parent_Prenom ? eleveImpressionInfo.parent_Prenom : ''),
+ (eleveImpressionInfo.parent_Nom ? eleveImpressionInfo.parent_Nom : '') +
+ ' ' +
+ (eleveImpressionInfo.parent_Prenom ? eleveImpressionInfo.parent_Prenom : ''),
adresse: eleveImpressionInfo.parent_Adresse ? eleveImpressionInfo.parent_Adresse : '',
cpVille:
- (eleveImpressionInfo.parent_CodePostal ? eleveImpressionInfo.parent_CodePostal : '') +
- ' ' +
- (eleveImpressionInfo.parent_Ville ? eleveImpressionInfo.parent_Ville : '')
+ (eleveImpressionInfo.parent_CodePostal ? eleveImpressionInfo.parent_CodePostal : '') +
+ ' ' +
+ (eleveImpressionInfo.parent_Ville ? eleveImpressionInfo.parent_Ville : '')
]
return resultat
TemplateDocument template =
- impressionTemplateDocumentService.findTemplateDocument(
- Long.parseLong(params.modeleId)
- )
+ impressionTemplateDocumentService.findTemplateDocument(
+ Long.parseLong(params.modeleId)
+ )
TypePeriode typePeriode = publipostageParametresService.getTypePeriode(params)
List<EleveImpressionInfo> eleveImpressionInfos = null
- switch(template.templateEliot.typeFonctionnalite.code) {
+ switch (template.templateEliot.typeFonctionnalite.code) {
case TemplateTypeFonctionnaliteEnum.BULLETIN_NOTES.name():
case TemplateTypeFonctionnaliteEnum.RELEVE_NOTES.name():
eleveImpressionInfos = impressionRequetageBulletinReleveService.findAllInfoForNotes(
)
break
default:
- log.error("Template de type inconnu: "+
+ log.error("Template de type inconnu: " +
template.templateEliot.typeFonctionnalite.code)
break
}
libelleTypePeriode
)
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
+ impressionBulletinOptionsService.getParametreOptions(
+ template,
+ typePeriode
+ )
+
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: eleveImpressionInfos,
+ options: bulletinOptionsPersonnalise
+ )
+
ByteArrayOutputStream documentPDF = impressionMoteurService.creePdf(
etablissementCourant(),
template,
- eleveImpressionInfos
+ donneesOptions
)
impressionSuiviEleveService.traceImpressionCourrier(
classes.each { StructureEnseignement structureEnseignement ->
CalcMoyennesInfo calcMoyennesInfo =
- moyenneService.internalVerifieMoyennesAjour(structureEnseignement)
+ moyenneService.internalVerifieMoyennesAjour(structureEnseignement)
if (!calcMoyennesInfo.moyennesAjour) {
moyennesInfo.put(
structureEnseignement.code,
*/
private String construitNomDeTraitement(PublipostageCommand command) {
List<Personne> listEleves =
- command.elevesSelectionnes.collect {Personne.get(it)}
+ command.elevesSelectionnes.collect {Personne.get(it)}
List<StructureEnseignement> listClasses =
- localStructureEnseignementService.findAllClassesForAllEleves(listEleves).unique{it.id}
+ localStructureEnseignementService.findAllClassesForAllEleves(listEleves).unique {it.id}
String modeleLibelle = TemplateDocument.get(command.modeleId).nom
findAllClasseInscritesAuBrevet(etablissementCourant()).
sort {a, b -> cc.compare(a.code, b.code)}
- return classeDeBrevets.collect{[id: it.id, code: it.code]}
+ return classeDeBrevets.collect {[id: it.id, code: it.code]}
}
private List getModeleBulletinReleves() {
ActionEnum.CONSULTATION,
NotesFonction.DIRECTION_ASSIMILE
)
-
- List<StructureEnseignement> classes =
- params.classes.split(',').collect{StructureEnseignement.get(it)}
+
+ List<StructureEnseignement> classes =
+ params.classes.split(',').collect {StructureEnseignement.get(it)}
classes.remove(null)
List<BrevetInscriptionEleve> inscriptionEleves =
- brevetClasseService.findAllBrevetInscriptionEleveParClasses(
- securiteSession,
- classes)
+ brevetClasseService.findAllBrevetInscriptionEleveParClasses(
+ securiteSession,
+ classes)
inscriptionEleves.sort {it.eleve.nomAffichage()}
}
/**
- * Gestion du breadCrumbs
- * @return
- */
+ * Gestion du breadCrumbs
+ * @return
+ */
protected List getBreadCrumbsInfo() {
List breadCrumbsInfo = super.getBreadCrumbsInfo()
breadCrumbsInfo << new BreadCrumbsItemInfo(
import org.lilie.services.eliot.notes.NotesDroitService
import org.lilie.services.eliot.notes.page.Page
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
-import org.lilie.services.eliot.impression.ImpressionEditionService
import org.lilie.services.eliot.impression.ImpressionSuiviEleveService
import org.lilie.services.eliot.scolarite.StructureEnseignement
import java.text.SimpleDateFormat
import org.lilie.services.eliot.scolarite.Calendrier
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.PublipostageSuivi
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.notes.NotesFonction
NotesDroitService notesDroitService
LocalStructureEnseignementService localStructureEnseignementService
CalendrierService calendrierService
- PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
- ImpressionEditionService impressionEditionService
ImpressionSuiviEleveService impressionSuiviEleveService
ImpressionTemplateDocumentService impressionTemplateDocumentService
import org.lilie.services.eliot.demon.DemandeTraitementStatut
import java.text.SimpleDateFormat
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.demon.DemandeTraitementService
import org.lilie.services.eliot.demon.ChampHistoriqueDemandeTraitement
import org.lilie.services.eliot.scolarite.Periode
import org.lilie.services.eliot.securite.impl.DefaultSecuriteSessionFactory
import org.lilie.services.eliot.applications.absences.PriseEnCompteMotif
+import org.lilie.services.eliot.impression.BulletinOptions
/**
* Service de requetage de notes pour le publipostage - bulletins et releves
typePeriode,
periode,
impressionRequetageSelection.infoBulletinNotes,
- impressionRequetageSelection.infoReleveNotes)
+ impressionRequetageSelection.infoReleveNotes,
+ template)
if (impressionRequetageSelection.infoRetards) {
eleveImpressionInfos =
package org.lilie.services.eliot.notes.impression
-import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
-import org.lilie.services.eliot.impression.donnees.eleve.TableauImpressionInfo
-import org.lilie.services.eliot.scolarite.PeriodeService
import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
-import org.lilie.services.eliot.scolarite.TypePeriode
-import org.lilie.services.eliot.scolarite.Personne
-import org.lilie.services.eliot.scolarite.StructureEnseignement
-import org.lilie.services.eliot.scolarite.Periode
-import org.lilie.services.eliot.notes.resultat.bulletin.BulletinService
+
+import org.lilie.services.eliot.impression.donnees.eleve.notetextuelle.AllNoteTextuelleImpression
+import org.lilie.services.eliot.impression.donnees.eleve.notetextuelle.NoteTextuelleImpression
+import org.lilie.services.eliot.notes.Note
+import org.lilie.services.eliot.notes.NoteTextuelle
+import org.lilie.services.eliot.notes.TypeAvis
import org.lilie.services.eliot.notes.resultat.bulletin.Bulletin
-import org.lilie.services.eliot.scolarite.Service
-import org.lilie.services.eliot.impression.donnees.eleve.MatiereImpressionInfo
-import org.lilie.services.eliot.scolarite.RelPeriodeService
+import org.lilie.services.eliot.notes.resultat.bulletin.BulletinService
import org.lilie.services.eliot.notes.resultat.bulletin.BulletinServiceResultat
import org.lilie.services.eliot.notes.resultat.bulletin.BulletinSousServiceResultat
-import org.lilie.services.eliot.impression.donnees.eleve.SousMatiereImpressionInfo
-import org.lilie.services.eliot.scolarite.SousService
-import org.lilie.services.eliot.impression.donnees.eleve.NoteImpressionInfo
-import org.lilie.services.eliot.notes.notes.Releve
-import org.lilie.services.eliot.notes.notes.ReleveService
-import org.lilie.services.eliot.notes.notes.ReleveServiceNote
-import org.lilie.services.eliot.notes.Note
-import org.lilie.services.eliot.notes.notes.ReleveModaliteMatiereNote
import org.lilie.services.eliot.scolarite.personne.eleve.EleveAnnuaireService
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.utils.NoteFormateur
-import org.lilie.services.eliot.notes.NoteTextuelle
-import org.lilie.services.eliot.notes.TypeAvis
-import org.lilie.services.eliot.notes.notes.EtablissementNotesService
-import org.lilie.services.eliot.impression.donnees.eleve.notetextuelle.NoteTextuelleImpression
-import org.lilie.services.eliot.impression.donnees.eleve.notetextuelle.AllNoteTextuelleImpression
+import org.lilie.services.eliot.notes.notes.*
+import org.lilie.services.eliot.scolarite.PeriodeService
+import org.lilie.services.eliot.scolarite.SousService
+import org.lilie.services.eliot.scolarite.Service
+import org.lilie.services.eliot.scolarite.RelPeriodeService
+import org.lilie.services.eliot.scolarite.Periode
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.impression.*
+import org.lilie.services.eliot.impression.donnees.eleve.NoteImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.TableauImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.MatiereImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.SousMatiereImpressionInfo
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
/**
* Récupération d'informations pour le publipostage des notes
PeriodeService periodeService
BulletinService bulletinService
ReleveService releveService
- EtablissementNotesService etablissementNotesService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
static final NoteFormateur COEFF_NF = new NoteFormateur(new BigDecimal('0.01'), ',', '#.##')
TypePeriode typePeriode,
Periode periode,
Boolean lireBulletin,
- Boolean lireReleve)
+ Boolean lireReleve,
+ TemplateDocument template)
throws IllegalArgumentException {
eleveInfos?.each { EleveImpressionInfo eleveImpressionInfo ->
typePeriode,
periode,
lireBulletin,
- lireReleve)
+ lireReleve,
+ template)
}
return eleveInfos
}
TypePeriode typePeriode,
Periode periode,
Boolean lireBulletin,
- Boolean lireReleve
+ Boolean lireReleve,
+ TemplateDocument templateDocument
) throws IllegalArgumentException {
// remarque : on peut avoir dans certains cas des demande sans info bulletin,
eleveImpressionInfo.setPeriodeFin(periode.dateFin)
if (lireBulletin) {
- // Get bulletin
+ // Récupère le bulletin de la période demandée
Bulletin bulletin = bulletinService.construisBulletin(
securiteSession,
eleve,
periode)
- return bulletinToTableauImpressionInfo(bulletin)
+ // Récupère le bulletin des périodes précédentes
+ Bulletin bulletinPeriodePrecedente1 = null
+ Bulletin bulletinPeriodePrecedente2 = null
+ Bulletin bulletinPeriodePrecedente3 = null
+ Integer ordrePeriode = bulletin.periode.ordre
+ if (ordrePeriode > 1){
+ Periode periodePrecedente1 = periodeService.findPeriodeByOrdre(
+ periode.classe,
+ 1
+ )
+ bulletinPeriodePrecedente1 = bulletinService.construisBulletin(
+ securiteSession,
+ eleve,
+ periodePrecedente1)
+ if (ordrePeriode >= 3){
+ Periode periodePrecedente2 = periodeService.findPeriodeByOrdre(
+ periode.classe,
+ 2
+ )
+ bulletinPeriodePrecedente2 = bulletinService.construisBulletin(
+ securiteSession,
+ eleve,
+ periodePrecedente2)
+ }
+ if (ordrePeriode == 4){
+ Periode periodePrecedente3 = periodeService.findPeriodeByOrdre(
+ periode.classe,
+ 3
+ )
+ bulletinPeriodePrecedente3 = bulletinService.construisBulletin(
+ securiteSession,
+ eleve,
+ periodePrecedente3)
+ }
+ }
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
+ impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ typePeriode
+ )
+
+ return bulletinToTableauImpressionInfo(bulletin,
+ bulletinPeriodePrecedente1,
+ bulletinPeriodePrecedente2,
+ bulletinPeriodePrecedente3,
+ bulletinOptionsPersonnalise)
}
if (lireReleve) {
* @return TableauImpressionInfo avec les données de Relevé
* @author bper
*/
- TableauImpressionInfo bulletinToTableauImpressionInfo(Bulletin bulletin) {
+ TableauImpressionInfo bulletinToTableauImpressionInfo(Bulletin bulletin,
+ Bulletin bulletinPeriodePrecedente1,
+ Bulletin bulletinPeriodePrecedente2,
+ Bulletin bulletinPeriodePrecedente3,
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise
+ ) {
TableauImpressionInfo tab = new TableauImpressionInfo()
getNoteFormateur()
// moyennes generales
- tab.moyenneGeneraleClasse = nf.format(bulletin.syntheseClasse.resultatClassePeriode?.moyenne)
- tab.moyenneGeneraleEleve = nf.format(bulletin.syntheseEleve.resultatElevePeriode?.moyenne)
+ if (bulletinPeriodePrecedente1){
+ tab.nomPeriodePrecedente1 = getNomMoyennePrecedente(bulletinPeriodePrecedente1.periode?.typePeriode?.libelle)
+ tab.moyennePrec1 = nf.format(bulletinPeriodePrecedente1.syntheseEleve?.resultatElevePeriode?.moyenne)
+ }
+ if (bulletinPeriodePrecedente2){
+ tab.nomPeriodePrecedente2 = getNomMoyennePrecedente(bulletinPeriodePrecedente2.periode?.typePeriode?.libelle)
+ tab.moyennePrec2 = nf.format(bulletinPeriodePrecedente2.syntheseEleve?.resultatElevePeriode?.moyenne)
+ }
+ if (bulletinPeriodePrecedente3){
+ tab.nomPeriodePrecedente3 = getNomMoyennePrecedente(bulletinPeriodePrecedente3.periode?.typePeriode?.libelle)
+ tab.moyennePrec3 = nf.format(bulletinPeriodePrecedente3.syntheseEleve?.resultatElevePeriode?.moyenne)
+ }
+ tab.moyenneClasse = nf.format(bulletin.syntheseClasse.resultatClassePeriode?.moyenne)
+ tab.moyenneEleve = nf.format(bulletin.syntheseEleve.resultatElevePeriode?.moyenne)
tab.moyenneMin = nf.format(bulletin.syntheseClasse.resultatClassePeriode?.moyenneMin)
tab.moyenneMax = nf.format(bulletin.syntheseClasse.resultatClassePeriode?.moyenneMax)
tab.appreciationGenrale = bulletin.syntheseEleve.appreciationElevePeriode?.appreciation
- // recupére l'info filtré. services sans notes où appreciations ne sont pas retenus
+ // recupére l'info filtré. services sans notes ou appreciations ne sont pas retenues
List<BulletinServiceResultat> bulletinServiceResultats = bulletin.getServiceResultats(true)
+ List<BulletinServiceResultat> bulletinServiceResultatsPeriodePrecedente1 =
+ bulletinPeriodePrecedente1 ? bulletinPeriodePrecedente1.getServiceResultats(true) : null
+ List<BulletinServiceResultat> bulletinServiceResultatsPeriodePrecedente2 =
+ bulletinPeriodePrecedente2 ? bulletinPeriodePrecedente2.getServiceResultats(true) : null
+ List<BulletinServiceResultat> bulletinServiceResultatsPeriodePrecedente3 =
+ bulletinPeriodePrecedente3 ? bulletinPeriodePrecedente3.getServiceResultats(true) : null
// services
tab.lignesTableau = []
bulletinServiceResultats?.each {BulletinServiceResultat bsr ->
- tab.lignesTableau << construitMatiereImpressionInfo(bsr, nf)
+ tab.lignesTableau << construitMatiereImpressionInfo(bsr,
+ nf,
+ bulletinServiceResultatsPeriodePrecedente1,
+ bulletinServiceResultatsPeriodePrecedente2,
+ bulletinServiceResultatsPeriodePrecedente3)
+ }
+
+ List<NoteTextuelle> noteTextuelleList = []
+ noteTextuelleList.addAll(bulletin.annotationsUtilisees)
+ if (bulletinOptionsPersonnalise?.moyennePrec1){
+ bulletinPeriodePrecedente1.annotationsUtilisees?.each{
+ if (!noteTextuelleList.contains(it)){
+ noteTextuelleList = noteTextuelleList.plus(bulletinPeriodePrecedente1.annotationsUtilisees)
+ }
+ }
+ }
+ if (bulletinOptionsPersonnalise?.moyennePrec2){
+ bulletinPeriodePrecedente2.annotationsUtilisees?.each{
+ if (!noteTextuelleList.contains(it)){
+ noteTextuelleList = noteTextuelleList.plus(bulletinPeriodePrecedente2.annotationsUtilisees)
+ }
+ }
+ }
+ if (bulletinOptionsPersonnalise?.moyennePrec3){
+ bulletinPeriodePrecedente3.annotationsUtilisees?.each{
+ if (!noteTextuelleList.contains(it)){
+ noteTextuelleList = noteTextuelleList.plus(bulletinPeriodePrecedente3.annotationsUtilisees)
+ }
+ }
}
tab.allNoteTextuelleImpression = construisNoteTextuelleInfo(
- bulletin.annotationsUtilisees)
+ noteTextuelleList)
return tab
}
* @author bper
*/
MatiereImpressionInfo construitMatiereImpressionInfo(BulletinServiceResultat bsr,
- NoteFormateur nf) {
+ NoteFormateur nf,
+ List<BulletinServiceResultat> bulletinServiceResultatsPeriodePrecedente1,
+ List<BulletinServiceResultat> bulletinServiceResultatsPeriodePrecedente2,
+ List<BulletinServiceResultat> bulletinServiceResultatsPeriodePrecedente3) {
MatiereImpressionInfo mii = new MatiereImpressionInfo()
Service service = bsr.service
}
mii.coeff = COEFF_NF.format(relPeriodeService?.coeff)
+ Integer rang = bsr.resultatEleveServicePeriode?.rang
+ Integer nbEleves = bsr.resultatEleveServicePeriode?.nbEleves
+ if (rang && nbEleves){
+ mii.rangs = "$rang/$nbEleves"
+ }
+
mii.appreciation = bsr.appreciationEleveEnseignementPeriodes.
collect {it.appreciation}?.join(', ')
// moyennes
+ BulletinServiceResultat bsrPeriodePrecedente1 = null
+ bulletinServiceResultatsPeriodePrecedente1.each{
+ if (it.service == service){
+ bsrPeriodePrecedente1 = it
+ mii.moyennePrec1 = nf.format(it.resultatEleveServicePeriode?.getValeurAffichage())
+ }
+ }
+ BulletinServiceResultat bsrPeriodePrecedente2 = null
+ bulletinServiceResultatsPeriodePrecedente2.each{
+ if (it.service == service){
+ bsrPeriodePrecedente2 = it
+ mii.moyennePrec2 = nf.format(it.resultatEleveServicePeriode?.getValeurAffichage())
+ }
+ }
+ BulletinServiceResultat bsrPeriodePrecedente3 = null
+ bulletinServiceResultatsPeriodePrecedente3.each{
+ if (it.service == service){
+ bsrPeriodePrecedente3 = it
+ mii.moyennePrec3 = nf.format(it.resultatEleveServicePeriode?.getValeurAffichage())
+ }
+ }
mii.moyenneEleve = nf.format(bsr.resultatEleveServicePeriode?.getValeurAffichage())
mii.moyenneClasse = nf.format(bsr.resultatClasseServicePeriode?.moyenne)
mii.moyenneMin = nf.format(bsr.resultatClasseServicePeriode?.moyenneMin)
// sous-services
if (bsr.sousServiceResultats?.size() > 0) {
bsr.sousServiceResultats.each {BulletinSousServiceResultat bssr ->
- mii.sousMatieres << construitSousMatiereImpressionInfo(bssr, nf)
+ mii.sousMatieres << construitSousMatiereImpressionInfo(bssr,
+ nf,
+ bsrPeriodePrecedente1,
+ bsrPeriodePrecedente2,
+ bsrPeriodePrecedente3)
}
+ } else {
+ // Si pas de sous-services, le nb de notes sera affiché pour le service.
+ // Sinon il ne sera pas affiché pour le service mais le sera pour chaque
+ // sous-service
+ mii.nbNotes = bsr.resultatEleveServicePeriode?.nbNotes?: null
}
return mii
* @author bper
*/
SousMatiereImpressionInfo construitSousMatiereImpressionInfo(BulletinSousServiceResultat bssr,
- NoteFormateur nf) {
+ NoteFormateur nf,
+ BulletinServiceResultat bsrPeriodePrecedente1,
+ BulletinServiceResultat bsrPeriodePrecedente2,
+ BulletinServiceResultat bsrPeriodePrecedente3) {
SousMatiereImpressionInfo smii = new SousMatiereImpressionInfo()
smii.libelle = sousService.modaliteMatiere.libelle
smii.coeff = COEFF_NF.format(sousService.coeff)
+ bsrPeriodePrecedente1?.sousServiceResultats?.each{
+ if (it.sousService?.modaliteMatiere?.id == sousService?.modaliteMatiere?.id){
+ smii.moyennePrec1 = nf.format(it.resultatEleveSousServicePeriode?.getValeurAffichage())
+ }
+ }
+ bsrPeriodePrecedente2?.sousServiceResultats?.each{
+ if (it.sousService?.modaliteMatiere?.id == sousService?.modaliteMatiere?.id){
+ smii.moyennePrec2 = nf.format(it.resultatEleveSousServicePeriode?.getValeurAffichage())
+ }
+ }
+ bsrPeriodePrecedente3?.sousServiceResultats?.each{
+ if (it.sousService?.modaliteMatiere?.id == sousService?.modaliteMatiere?.id){
+ smii.moyennePrec3 = nf.format(it.resultatEleveSousServicePeriode?.getValeurAffichage())
+ }
+ }
+
smii.moyenneEleve = nf.format(bssr.resultatEleveSousServicePeriode?.getValeurAffichage())
smii.moyenneClasse = nf.format(bssr.resultatClasseSousServicePeriode?.moyenne)
smii.moyenneMin = nf.format(bssr.resultatClasseSousServicePeriode?.moyenneMin)
smii.moyenneMax = nf.format(bssr.resultatClasseSousServicePeriode?.moyenneMax)
+ smii.nbNotes = bssr.resultatEleveSousServicePeriode?.nbNotes?: null
+
return smii
}
}
return noteInfos
}
+
+ private String getNomMoyennePrecedente(String libelleTypePeriode){
+ switch (libelleTypePeriode){
+ case 'T1':
+ return '1er T.'
+ break
+ case 'T2':
+ return '2ème T.'
+ break
+ case 'T3':
+ return '3ème T.'
+ break
+ case 'S1':
+ return '1er S.'
+ break
+ case 'S2':
+ return '2ème T.'
+ break
+ }
+ }
}
import org.lilie.services.eliot.notes.impression.ImpressionRequetageBulletinReleveService
import org.lilie.services.eliot.notes.impression.ImpressionRequetageBrevetService
import org.lilie.services.eliot.impression.ImpressionRequetageService
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
/**
* Assure l'extraction des données concernant les notes des élèves en fonction
ImpressionRequetageBulletinReleveService impressionRequetageBulletinReleveService
ImpressionRequetageBrevetService impressionRequetageBrevetService
ImpressionRequetageService impressionRequetageService
-
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
LocalPersonneService localPersonneService
PublipostageParametresService publipostageParametresService
}
- List<EleveImpressionInfo> lectureDonneesEleve(
+ Object lectureDonneesEleve(
SecuriteSession securiteSession,
Etablissement etablissement,
TemplateDocument template,
switch (templateTypeFonctionnaliteEnum) {
case TemplateTypeFonctionnaliteEnum.NOTES:
+ case TemplateTypeFonctionnaliteEnum.BULLETIN_NOTES:
+
eleveImpressionInfos =
findAllInfoForBulletinEtReleve(
parametresSelectionPublipostage,
securiteSession,
etablissement,
template)
+
publipostageParametresService.nommePeriode(
eleveImpressionInfos,
parametresSelectionPublipostage.libelleTypePeriode)
- break
+
+
+ TypePeriode typePeriode = TypePeriode.get(parametresSelectionPublipostage.typePeriodeId)
+
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
+ impressionBulletinOptionsService.getParametreOptions(
+ template,
+ typePeriode
+ )
+
+ return new DonneesOptions(
+ data: eleveImpressionInfos,
+ options: bulletinOptionsPersonnalise
+ )
case TemplateTypeFonctionnaliteEnum.BREVET:
- eleveImpressionInfos =
- findAllInfoForBrevet(
- securiteSession,
- parametresSelectionPublipostage,
- etablissement)
+
+ return findAllInfoForBrevet(
+ securiteSession,
+ parametresSelectionPublipostage,
+ etablissement)
break
}
-
- return eleveImpressionInfos
-
}
/**
findAllPersonne(parametresSelectionPublipostage.elevesSelectionnes)
List<EleveImpressionInfo> eleveImpressionInfos =
- impressionRequetageBrevetService.findAllInfoForBrevet(
- securiteSession,
- etablissement,
- eleves
- )
+ impressionRequetageBrevetService.findAllInfoForBrevet(
+ securiteSession,
+ etablissement,
+ eleves
+ )
impressionRequetageService.triEleves(eleveImpressionInfos)
return it.valeurTextuelle
}
}
- return calculeMoyenne(listeValeurs, ignoreAnnotations, precision)
+ return calculeMoyenne(listeValeurs, ignoreAnnotations, null, precision)
}
/**
Boolean ignoreAnnotations = false,
int precision = PRECISION_PAR_DEFAUT) {
Moyenne moyenne = null
+ Integer nbNotes = 0
+
if (listeNoteInfo) {
BigDecimal enHaut = 0 // Partie en haut - numerateur
BigDecimal enBas = 0 // Partie en bas - denominateur
// on ajoute la difference multipliée par le coefficient
enHaut += (diff * coeff)
// count n'est pas incrementé
+ nbNotes++
}
} else {
// on ajoute la valeur multipliée par le coefficient
enHaut += (valeurNumerique * coeff)
+ nbNotes++
enBas += (coeff * noteMax)
}
}
}
}
+ moyenne.nbNotes = nbNotes != 0 ? nbNotes : null
+
return moyenne
}
*/
Moyenne calculeMoyenne(List listeValeurs,
Boolean ignoreAnnotations = false,
+ Integer nbNotes = null,
int precision = PRECISION_PAR_DEFAUT) {
Moyenne moyenne = null
if (listeValeurs) {
if (count > 0) {
// notes numeriques saisies
moyenne = new Moyenne(total.divide(count, precision, RoundingMode.HALF_UP))
+ moyenne.nbNotes = nbNotes
// il ne faut pas depasser Moyenne Maximal
if (moyenne.valeurNumerique > MOYENNE_MAX) {
moyenne.valeurNumerique = MOYENNE_MAX
import org.hibernate.FetchMode
import org.lilie.services.eliot.ArgumentUtils
import org.lilie.services.eliot.notes.scolarite.NotesSousServiceService
+import org.lilie.services.eliot.notes.ResultatEleveServicePeriode
/**
* Service pour marquer que les données source d'une moyenne ont chagé.
session.createQuery("delete DirtyMoyenne d").executeUpdate()
}
}
+
+ /**
+ * Marque les moyennes ELEVE_SERVICE_PERIODE comme dirty
+ * pour les services et périodes pour lesquels les rangs les
+ * nombres de notes n'ont pas été calculés.
+ * @author bper
+ */
+ void marqueDirtyIfNotUptodate(List<ResultatEleveServicePeriode> resultats) {
+
+ List<ResultatEleveServicePeriode> resultatsNotUptodate =
+ resultats.findAll {
+ it.moyenne != null && (
+ it.rang == null || it.nbEleves == null ||
+ (it.nbNotes == null && !it.resultatsEleveSousServicePeriode)
+ )
+ }
+
+ resultatsNotUptodate.each {
+ marqueChangement(new DirtyMoyenneParams(
+ eleve: it.eleve,
+ service: it.service,
+ periode: it.periode,
+ typeMoyenne: TypeMoyenneEnum.ELEVE_SERVICE_PERIODE
+ ))
+ }
+ }
}
import org.lilie.services.eliot.notes.resultat.resultat.eleve.ResultatEleveSousServicePeriodeService
import org.lilie.services.eliot.resultat.Moyenne
import org.lilie.services.eliot.notes.ResultatEnseignementPeriode
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
/**
* Calculs des moyennes
DirtyMoyenneService dirtyMoyenneService
EleveAnnuaireService eleveAnnuaireService
CalculationService calculationService
+ LocalStructureEnseignementService localStructureEnseignementService
def sessionFactory
// Récupère les élèves de la classe
List<Autorite> eleves = eleveAnnuaireService.
findAllEleveByStructureEnseignement(
- securiteSession, classe, null)*.autorite
+ securiteSession, classe, null)*.autorite
// les moyennes à recalculer pour une classe
List<DirtyMoyenne> dirtyMoyennes =
- dirtyMoyenneService.internalFindAllDirtyMoyenne(
- classe,
- eleves,
- dateDebutCalculPrecedent)
+ dirtyMoyenneService.internalFindAllDirtyMoyenne(
+ classe,
+ eleves,
+ dateDebutCalculPrecedent)
DirtyMoyenneSetBag setBag = new DirtyMoyenneSetBag(classe, eleves, dirtyMoyennes)
traiteMoyennesClasseSousService(setBag)
traiteMoyennesEleveEnseignement(setBag)
traiteMoyennesEleveService(setBag)
+ traiteRangsEleveService(securiteSession, setBag)
traiteMoyennesEleve(setBag)
traiteMoyennesStructureEnseignement(setBag) // classe ou groupe
traiteMoyennesClasseService(setBag)
* @author bper
*/
private Moyenne calculeMoyenneEleveEnseignementAnnee(Autorite eleve,
- Enseignement enseignement,
- Periode periode) {
+ Enseignement enseignement,
+ Periode periode) {
if (!periode.isPeriodeAnnee()) {
throw new IllegalAccessException("La période $periode n'est pas une péridoe ANNEE")
// Récupère les moyennes des périodes Xmestres
List moyenneEleveEnseignementXmestres =
- resultatEleveEnseignementPeriodeService.
- internalFindAllForXmestres(eleve, enseignement, periode.classe).
- collect {it.noteTextuelle ?: it.moyenne}
+ resultatEleveEnseignementPeriodeService.
+ internalFindAllForXmestres(eleve, enseignement, periode.classe).
+ collect {it.noteTextuelle ?: it.moyenne}
// Calcule la moyenne arithmétique
return calculationService.calculeMoyenne(moyenneEleveEnseignementXmestres)
* @author bper
*/
private Moyenne calculeMoyenneEleveEnseignementAvecSousServices(Autorite eleve,
- Enseignement enseignement,
- Periode periode) {
+ Enseignement enseignement,
+ Periode periode) {
if (periode.isPeriodeAnnee()) {
throw new IllegalAccessException(
"La méthode ne doit pas être appellée pour la période ANNEE"
// Les notes de l'élève pour le sous-service
List<Note> notes = noteService.
internalFindAllNoteByEleveAndEnseignementAndSousService(
- eleve, enseignement, sousService)
+ eleve, enseignement, sousService)
// Calcule la moyenne pondérée des notes pour le sous-service
moyenneSS = calculationService.calculeMoyenneNotesPonderee(notes)
* @author bper
*/
private Moyenne calculeMoyenneEleveEnseignement(Autorite eleve,
- Enseignement enseignement,
- Periode periode) {
+ Enseignement enseignement,
+ Periode periode) {
if (periode.isPeriodeAnnee()) {
throw new IllegalArgumentException("La periode $periode est une période ANNEE")
}
}
List<ResultatEleveServicePeriode> resultatEleveServicePeriodes =
- resultatEleveServicePeriodeService.
- internalFindAllByEleveAndPeriode(eleve, periode)
+ resultatEleveServicePeriodeService.
+ internalFindAllByEleveAndPeriode(eleve, periode)
List<NoteInfo> noteInfos = resultatEleveServicePeriodes?.collect {
new NoteInfo(
// Dans le cas où le service a des sous-service la moyenne est calculée de la
// même façon pour tout type de période y comprise l'année.
moyenne = calculeMoyenneEleveServiceAvecSousServices(eleve, service, periode)
+ // si le service a des sous-services, nbNotes du service = null
+ moyenne.nbNotes = null
} else {
if (periode.isPeriodeAnnee()) {
moyenne = calculeMoyenneEleveServiceAnnee(eleve, service, periode)
* @author bper
*/
private Moyenne calculeMoyenneEleveServiceAvecSousServices(Autorite eleve,
- Service service,
- Periode periode) {
+ Service service,
+ Periode periode) {
List<SousService> sousServices = service.getSousServices(periode.typePeriode)
// Service avec sous-services - on calcule la moyenne des moyennes
// des sous-services quelle que soit la période (Xmestre, Année, Exemen).
List<ResultatEleveSousServicePeriode> resultatsSS =
- resultatEleveSousServicePeriodeService.
- internalFindAll([eleve], sousServices, [periode])
+ resultatEleveSousServicePeriodeService.
+ internalFindAll([eleve], sousServices, [periode])
resultatsSS?.sort { it.sousService.ordre }
* @author bper
*/
private Moyenne calculeMoyenneEleveServiceAnnee(Autorite eleve,
- Service service,
- Periode periode) {
+ Service service,
+ Periode periode) {
if (!periode.isPeriodeAnnee()) {
throw new IllegalArgumentException("La periode $periode n'est pas une période ANNEE")
}
// Récupère les moyennes de eleves pour les services pour les Xmestres
- List moyennesEleveService = resultatEleveServicePeriodeService.
- internalFindAllForXmestres(eleve, [service], periode.classe).
+ List<ResultatEleveServicePeriode> resultatsEleveServicePeriode =
+ resultatEleveServicePeriodeService.
+ internalFindAllForXmestres(eleve, [service], periode.classe)
+ List moyennesEleveService = resultatsEleveServicePeriode.
collect {it.noteTextuelle ?: it.moyenne}
+ // Calcul le nb de notes total ayant servi à calculer les moyennes
+ Integer nbNotesTotal = 0
+ resultatsEleveServicePeriode.each{ ResultatEleveServicePeriode resultatEleveServicePeriode ->
+ Integer nbNotes = resultatEleveServicePeriode.nbNotes
+ if (nbNotes){
+ nbNotesTotal += nbNotes
+ }
+ }
+
// Calcule la moyenne arithmétique des moyennes des Xmetres
- return calculationService.calculeMoyenne(moyennesEleveService)
+ return calculationService.calculeMoyenne(moyennesEleveService,
+ false,
+ nbNotesTotal)
}
/**
* @author bper
*/
private Moyenne calculeMoyenneEleveService(Autorite eleve,
- Service service,
- Periode periode) {
+ Service service,
+ Periode periode) {
if (periode.isPeriodeAnnee()) {
throw new IllegalArgumentException("La periode $periode est une période ANNEE")
}
}
ResultatEleveServicePeriode resParent =
- resultatEleveServicePeriodeService.internalFindOrCree(eleve, service, periode)
+ resultatEleveServicePeriodeService.internalFindOrCree(eleve, service, periode)
// Enregistre la moyenne (null si le sous-service ou le service n'est pas évaluable)
// de l'élève pour le sous-service
* @author bper
*/
private Moyenne calculeMoyenneEleveSousServiceAnnee(Autorite eleve,
- SousService sousService,
- Periode periode) {
+ SousService sousService,
+ Periode periode) {
// TOCHECK on assigne noteTextuelle a BigDecimal - peut-on avoir des valeurs NT dans Sous-Services du tout ?
// Récupère les moyennes de l'élève pour le sous-service sur les Xmestres
+ List<ResultatEleveSousServicePeriode> resultatsEleveSousServicePeriode =
+ resultatEleveSousServicePeriodeService.
+ internalFindAllForXmestres(eleve, sousService, periode.classe)
List<BigDecimal> moyenneEleveXmestres =
- resultatEleveSousServicePeriodeService.
- internalFindAllForXmestres(eleve, sousService, periode.classe).
- collect {it.noteTextuelle ?: it.moyenne}
+ resultatsEleveSousServicePeriode.
+ collect {it.noteTextuelle ?: it.moyenne}
+
+ // Calcul le nb de notes total ayant servi à calculer les moyennes
+ Integer nbNotesTotal = 0
+ resultatsEleveSousServicePeriode.each{ ResultatEleveSousServicePeriode resultatEleveSousServicePeriode ->
+ Integer nbNotes = resultatEleveSousServicePeriode.nbNotes
+ if (nbNotes){
+ nbNotesTotal += nbNotes
+ }
+ }
// Calcule la moyenne arithmetique des moyennes des Xmestres
- return calculationService.calculeMoyenne(moyenneEleveXmestres)
+ return calculationService.calculeMoyenne(moyenneEleveXmestres, false, nbNotesTotal)
}
/**
* @author bper
*/
private Moyenne calculeMoyenneEleveSousService(Autorite eleve,
- SousService sousService,
- Periode periode) {
+ SousService sousService,
+ Periode periode) {
if (sousService.typePeriode.isAnnee()) {
throw new IllegalArgumentException(
"Le type de période de sous-service ne doit pas être l'ANNEE"
// Moyennes générales des élèves pour la période
List<BigDecimal> moyenneEleves =
- resultatElevePeriodeService.internalFindAll(eleves, [periode], null)*.moyenne
+ resultatElevePeriodeService.internalFindAll(eleves, [periode], null)*.moyenne
BigDecimal moyenneClasse = calculationService.
calculeMoyenne(moyenneEleves, true)?.valeurNumerique
resultatEleveEnseignementPeriodeService.internalFindAll([enseignement], [periode])*.moyenne
BigDecimal moyenneClasse = calculationService.
- calculeMoyenne(moyenneEleves, true)?.valeurNumerique
+ calculeMoyenne(moyenneEleves, true)?.valeurNumerique
BigDecimal moyenneMin = calculationService.calculeMin(moyenneEleves)
BigDecimal moyenneMax = calculationService.calculeMax(moyenneEleves)
// trouve la pèriode
Periode periode =
- classe.periodes.find {it.typePeriode.id == sousService.typePeriode.id}
+ classe.periodes.find {it.typePeriode.id == sousService.typePeriode.id}
if (!periode) {
log.warn(
}
}
+ private void traiteRangsEleveService(SecuriteSession securiteSession,
+ DirtyMoyenneSetBag setBag) {
+
+ setBag.classeServiceDMSet.each { DirtyMoyenne dm ->
+
+ // il faut le forcer à recharger - sinon bug Grails 1.3.7 #7087
+ Service service = notesServiceService.internalRechargeParForce(dm.service)
+ Periode periode = dm.periode
+ List<Autorite> eleves = setBag.eleves
+
+ majRangsEleveService(securiteSession, eleves, service, periode)
+ }
+ }
+
+ private void majRangsEleveService(SecuriteSession securiteSession,
+ List<Autorite> eleves,
+ Service service,
+ Periode periode) {
+
+ List<ResultatEleveServicePeriode> resultats = resultatEleveServicePeriodeService.
+ internalFindAll(eleves, [service], [periode], null)
+
+ List<ResultatEleveServicePeriode> resultatsNotes = []
+
+ if (service.isEvaluable(periode)) {
+ Integer nbElevesNotesPourService = 0
+ List<Integer> moyennesDuServiceDePeriode = []
+
+ resultats.each{ ResultatEleveServicePeriode resultat ->
+ if (resultat.moyenne){
+ nbElevesNotesPourService++
+ moyennesDuServiceDePeriode.add(resultat.moyenne)
+ resultatsNotes.add(resultat)
+ }
+ }
+ List<Integer> moyennesDuServiceDePeriodeOrdonnees =
+ moyennesDuServiceDePeriode.sort().reverse()
+
+ // Calcul du rang pour chaque moyenne du service et de la période donnés
+ Map<Integer, BigDecimal> rangMoyenne = [:]
+ Integer rang = 1
+ Integer ecart = 1
+ for (int i = 0; i < moyennesDuServiceDePeriodeOrdonnees.size(); ++i){
+ // calcul du rang
+ if (i == 0){
+ rangMoyenne.put(rang, moyennesDuServiceDePeriodeOrdonnees.get(i))
+ } else {
+ if (moyennesDuServiceDePeriodeOrdonnees.get(i) == moyennesDuServiceDePeriodeOrdonnees.get(i - 1)){
+ rangMoyenne.put(rang, moyennesDuServiceDePeriodeOrdonnees.get(i))
+ ecart++
+ } else {
+ rang = rang + ecart
+ rangMoyenne.put(rang, moyennesDuServiceDePeriodeOrdonnees.get(i))
+ ecart = 1
+ }
+ }
+ // mise à jour du rang dans le résultat
+ resultats*.rang = null
+ resultatsNotes.each{ ResultatEleveServicePeriode resultatDuServiceDePeriode ->
+ resultatDuServiceDePeriode.rang =
+ rangMoyenne.find{it.value == resultatDuServiceDePeriode.moyenne}?.key
+ }
+
+ }
+
+ // mise à jour du nombre d'élèves notés pour le service pour la période donnés
+ resultatsNotes*.nbEleves = nbElevesNotesPourService
+
+ } else {
+ resultats*.rang = null
+ }
+
+ resultatEleveServicePeriodeService.saveAll(resultats)
+ }
+
/**
* Traitement des moyennes Eleve
* @param setBag
if (sousService.evaluable) {
// Récupère les moyennes des élèves de la classe pour le sous-service
List<BigDecimal> moyenneEleves =
- resultatEleveSousServicePeriodeService.
- internalFindAll(eleves, [sousService], [periode])*.moyenne
+ resultatEleveSousServicePeriodeService.
+ internalFindAll(eleves, [sousService], [periode])*.moyenne
moyenneClasse = calculationService.
calculeMoyenne(moyenneEleves, true)?.valeurNumerique
import org.lilie.services.eliot.notes.TypeAvis
import org.lilie.services.eliot.notes.AvisElevePeriode
import org.lilie.services.eliot.applications.absences.PriseEnCompteMotif
+import org.lilie.services.eliot.notes.resultat.DirtyMoyenneService
/**
* @author bper
LocalStructureEnseignementService localStructureEnseignementService
BilanService bilanService
AvisElevePeriodeService avisElevePeriodeService
+ DirtyMoyenneService dirtyMoyenneService
static transactional = true
}
}
- CalcMoyennesInfo calcInfo = moyenneService.internalVerifieMoyennesAjour(classe)
-
// Récupère les services sur lesquelles élève est noté
List<Service> services = notesServiceService.findAllServiceByClasseAndPeriodes(
securiteSession,
services,
periode)
+ dirtyMoyenneService.marqueDirtyIfNotUptodate(syntheseEleve.resultatEleveServicePeriodes)
+
// Recupere les notes textuelles presentes dans la synthese d'eleve
List<NoteTextuelle> annotationsUtilisees = recupereAnnotations(syntheseEleve)
TreeMap<TypeAvis, AvisElevePeriode> avisEleveParType = (TreeMap) avisElevePeriodeService.
internalFindAllAvisMappedByTypeForEleveEtPeriode(eleve.autorite, periode)
+ CalcMoyennesInfo calcInfo = moyenneService.internalVerifieMoyennesAjour(classe)
+
Bulletin bulletin = new Bulletin(
classe: classe,
eleve: eleve,
import org.lilie.services.eliot.notes.resultat.resultat.AbstractResultatService
import org.lilie.services.eliot.resultat.Moyenne
import org.lilie.services.eliot.resultat.MoyenneType
+import org.lilie.services.eliot.notes.ResultatEleveServicePeriode
+import org.lilie.services.eliot.notes.ResultatEleveSousServicePeriode
/**
* Parent commun des ResultatEleve*Service
if (moyenne==null) {
res.moyenne = null
res.noteTextuelle = null
+ if (res instanceof ResultatEleveServicePeriode ||
+ res instanceof ResultatEleveSousServicePeriode){
+ res.nbNotes = null
+ }
return
}
case MoyenneType.NUMERIQUE:
res.moyenne = moyenne.valeurNumerique
res.noteTextuelle = null
+ if (res instanceof ResultatEleveServicePeriode ||
+ res instanceof ResultatEleveSousServicePeriode){
+ res.nbNotes = moyenne.nbNotes
+ }
break
case MoyenneType.TEXTUELLE:
res.moyenne = null
res.noteTextuelle = moyenne.valeurTextuelle
+ if (res instanceof ResultatEleveServicePeriode ||
+ res instanceof ResultatEleveSousServicePeriode){
+ res.nbNotes = null
+ }
break
default:
throw new IllegalArgumentException(
import org.lilie.services.eliot.securite.impl.CompteUtilisateurEtat
import org.lilie.services.eliot.notes.notes.EtablissementNotesService
import org.lilie.services.eliot.textes.TypeActivite
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.constantes.TemplateDocumentEnum
/**
* tests:NotesImpressionServiceTests.
List<Avis> listeAvis = avisService.internalFindOrCreeAllAvisParDefaut(etablissement1)
- List<TypeAvis> listeTypeAvis = listeAvis.groupBy{it.type}.keySet().toList().sort()
+ List<TypeAvis> listeTypeAvis = listeAvis.groupBy {it.type}.keySet().toList().sort()
avis1Eleve1 = new AvisElevePeriode(
eleve: eleve1.autorite,
)
List<EleveImpressionInfo> eleveInfos = [EleveImpressionInfo1, EleveImpressionInfo2]
+ TemplateDocument templateDocument = TemplateDocument.findByCode(TemplateDocumentEnum.BULLETIN_NOTES_1.toString())
+
// Récupère les données du Bulletin
eleveInfos = notesImpressionService.findAllInfoNoteEleve(
securiteSessionDicerteur,
periodeT1_1.typePeriode,
null,
true,
- false)
+ false,
+ templateDocument
+ )
//Recuperation de EleveImpressionInfo pour eleve1 , periodeT1_1
EleveImpressionInfo eleveImpressionInfo1 = eleveInfos.find {it.personne.id == eleve1.id}
NoteFormateur nf = classe1enTrimestres.etablissement.etablissementNotes.
- getNoteFormateur()
+ getNoteFormateur()
//Tester la bonne recuperation des données dans eleveImpressionInfo1
assertNotNull("Les données de l'eleve1 {eleve1} pour Notes ne sont pas recuperés",
//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.moyenneEleve, 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.moyenneClasse, nf.format(resultClassePeriodeT1.moyenne))
//tester la bonne recuperation des données dans MatiereImpressionInfo
MatiereImpressionInfo matiereImpressionInfo1 = eleveImpressionInfo1.
)
List<EleveImpressionInfo> eleveInfos = [eleveImpressionInfo1, eleveImpressionInfo2]
+ TemplateDocument templateDocument = TemplateDocument.findByCode(TemplateDocumentEnum.BULLETIN_NOTES_1.toString())
+
// Récupère les données du Bulletin
eleveInfos = notesImpressionService.findAllInfoNoteEleve(
securiteSessionDicerteur,
periodeT1_1.typePeriode,
null,
false,
- true)
+ true,
+ templateDocument)
StructureEnseignement classe =
localStructureEnseignementService.findClasseForEleve(
}
-
/**
* crée un ResultatEleveServicePeriode
* @param periode
infoCalculMoyennesClasseService.creeVerrou(classe1enTrimestres)
- // Appeller la methode majMoyenne pour tester quelle sont les moyennes qui sont recalculés
+ // Appeler la methode majMoyenne pour tester quelle sont les moyennes qui sont recalculés
moyenneService.majMoyennes(
securiteSessionEnseignant,
classe1enTrimestres,
assertEquals("la moyenne pour le Resultat Eleve-Service-Periode Annee n'est pas correct",
moyenneAnnuel_E1, resultatEleveServicePeriode4.moyenne)
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT1_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode1?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT1_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode1?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT2_1?.typePeriode?.libelle}""",
+ 1, resultatEleveServicePeriode2?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT2_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode2?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT3_1?.typePeriode?.libelle}""",
+ 1, resultatEleveServicePeriode3?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT3_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode3?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periode_Annee?.typePeriode?.libelle}""",
+ 1, resultatEleveServicePeriode4?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periode_Annee?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode4?.nbEleves)
+
//Tester le recalcul de moyenne et la mise a jour de uptodate dans ResultatClassePeriode
ResultatClassePeriode resultatClassePeriode1 = ResultatClassePeriode.findByClasseAndPeriode(classe1enTrimestres, periodeT1_1)
ResultatClassePeriode resultatClassePeriode2 = ResultatClassePeriode.findByClasseAndPeriode(classe1enTrimestres, periodeT2_1)
assertEquals("la moyenne pour le Resultat Eleve-Service-Periode Annee n'est pas correct",
moyenneAnnuel_E1, resultatEleveServicePeriode4.moyenne)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT1_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode1?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT1_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode1?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT2_1?.typePeriode?.libelle}""",
+ 1, resultatEleveServicePeriode2?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT2_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode2?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT3_1?.typePeriode?.libelle}""",
+ 1, resultatEleveServicePeriode3?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT3_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode3?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periode_Annee?.typePeriode?.libelle}""",
+ 1, resultatEleveServicePeriode4?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periode_Annee?.typePeriode?.libelle}""",
+ 2, resultatEleveServicePeriode4?.nbEleves)
+
+
//Tester le recalcul de moyenne et la mise a jour de uptodate dans ResultatClassePeriode
ResultatClassePeriode resultatClassePeriode1 = ResultatClassePeriode.findByClasseAndPeriode(classe1enTrimestres, periodeT1_1)
ResultatClassePeriode resultatClassePeriode2 = ResultatClassePeriode.findByClasseAndPeriode(classe1enTrimestres, periodeT2_1)
ResultatEleveServicePeriode resultatEleveServiceParentPeriode4 =
getResultatEleveServicePeriode(periode_Annee, serviceParent, eleve1)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT1_1?.typePeriode?.libelle}""",
+ 1, resultatEleveServiceParentPeriode1?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT1_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServiceParentPeriode1?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT2_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServiceParentPeriode2?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT2_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServiceParentPeriode2?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT3_1?.typePeriode?.libelle}""",
+ 1, resultatEleveServiceParentPeriode3?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periodeT3_1?.typePeriode?.libelle}""",
+ 2, resultatEleveServiceParentPeriode3?.nbEleves)
+
+ assertEquals("""le rang de l'élève d'id ${eleve1?.id} n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periode_Annee?.typePeriode?.libelle}""",
+ 2, resultatEleveServiceParentPeriode4?.rang)
+
+ assertEquals("""le nombre d'élèves n'est pas correct
+ pour le service ${service?.matiere?.libelleLong}
+ et la période ${periode_Annee?.typePeriode?.libelle}""",
+ 2, resultatEleveServiceParentPeriode4?.nbEleves)
+
+
//***Les resultatsEleveSousServicePeriode pour l'eleve 1
//recuperer le ResultatEleveSousServicePeriode pour la periode T1 , eleve1 et sousService1
import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
import org.lilie.services.eliot.scolarite.AbstractScolariteController
-
-import org.lilie.services.eliot.impression.ImpressionTemplateTypeDonneesService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateTypeDonneesService
/**
* code commun aux différents éditeurs pour le publipostage
import org.lilie.services.eliot.impression.constantes.TypeMedia
import org.lilie.services.eliot.scolarite.page.Page
-import org.lilie.services.eliot.impression.*
import org.lilie.services.eliot.impression.contenu.ImpressionModeleContenuService
import org.lilie.services.eliot.impression.contenu.ModeleContenu
+import org.lilie.services.eliot.impression.TemplateEliot
+import org.lilie.services.eliot.impression.TemplateTypeFonctionnalite
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.ImpressionServiceNomUniqueException
+
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
class ImpressionEditionController extends AbstractEditionController {
ImpressionEditionService impressionEditionService
ImpressionTemplateDocumentService impressionTemplateDocumentService
ImpressionModeleContenuService impressionModeleContenuService
-
/**
* Permet de convertir les informations de type media sous forme de map
* dans le but de les mettre dans le modèle
modele.listeMedia = listeMedia() as JSON
modele.listeModeleCourrier = listModeleCourrier() as JSON
modele.listeModeleSms = listModeleSms() as JSON
+
if (chainModel?.messageErreur) {
modele.messageErreur = chainModel.messageErreur
}
// champs ou methodes private
private static final String CODE_ERR_SUPRESSION_TEMPLATE_UTILISATEUR = 'eliot.impression.templateUtilisateur.erreur.echecSuppression'
-
- static final String DEBUT_CODE_MESSAGE_TITRE = 'eliot.impression.editeur.zone.titre.'
static final String CODE_MESSAGE_NOM_DUPLIQUE = 'eliot.impression.templateUtilisateur.erreur.nomDuplique'
}
// identifiant du modèle de document
modele.idModele = params.templateDocumentId
+
+
return modele
}
class DonneesApercu {
private static final String LOREM_IPSUM = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
- private static final String ASSEZ_BIEN="assez bien."
- private static final String ORAL="oral"
- private static final String ECRIT="écrit"
+ private static final String ASSEZ_BIEN = "assez bien."
+ private static final String ORAL = "oral"
+ private static final String ECRIT = "écrit"
static public List<EleveImpressionInfo> data(Etablissement etablissement,
TemplateDocument templatedocument) {
)
eleveImpression.annee_scol_deb = "2011"
-
eleveImpression.annee_scol_fin = "2012"
eleveImpression.etablissement_academie = etablissement.academie
MatiereImpressionInfo francais = creerMatiereImpressionInfoFrancais()
eleveImpression.donneesTableau.lignesTableau << francais
+ eleveImpression.donneesTableau.nomPeriodePrecedente1 = "1er T."
+ eleveImpression.donneesTableau.nomPeriodePrecedente2 = "2ième T."
+ eleveImpression.donneesTableau.nomPeriodePrecedente3 = "3ième T."
+
SousMatiereImpressionInfo ecrit = creerSousMatiereImpressionInfoEcrit()
francais.sousMatieres << ecrit
SousMatiereImpressionInfo oral = creerSousMatiereImpressionInfoOral()
eleveImpression.donneesTableau.lignesTableau << philo
}
-
/**
* Notes de Math
* @param eleveImpression
}
private static MatiereImpressionInfo creerMatiereImpressionInfoHistoire() {
- return new MatiereImpressionInfo(
+ return addNbElevesNotes(new MatiereImpressionInfo(
prof: "Mme D'HARCOURT",
libelle: "HISTOIRE GEO",
moyenneEleve: 7.5,
moyenneClasse: 16.75,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 20.05,
appreciation: "Eleve très moyen. En amélioration.",
- coeff:1
+ coeff: 1
+ )
)
}
private static MatiereImpressionInfo creerMatiereImpressionInfoPhilo() {
- return new MatiereImpressionInfo(
+ return addNbElevesNotes(new MatiereImpressionInfo(
prof: "Arovet L.I",
libelle: "PHILOSOPHIE",
moyenneEleve: 7.5,
moyenneClasse: 16.75,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 20.05,
appreciation: LOREM_IPSUM,
- coeff:1
- )
+ coeff: 1
+ ))
}
private static MatiereImpressionInfo creerMatiereImpressionInfoMath() {
- return new MatiereImpressionInfo(
+ return addNbElevesNotes(new MatiereImpressionInfo(
prof: "M. KRIEG",
libelle: "MATHEMATIQUES",
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "10/30",
- appreciation:"",
+ rangs: "10/30",
+ appreciation: "",
moyenneMin: 11.2,
moyenneMax: 16.3,
- coeff:2
+ coeff: 2
+ )
)
}
private static MatiereImpressionInfo creerMatiereImpressionInfoAllemand() {
- return new MatiereImpressionInfo(
+ return addNbElevesNotes(new MatiereImpressionInfo(
prof: "M. DUPOND, M. DURANT, P. MARTIN, F. RAYON, G. DOURY",
libelle: "ALLEMAND",
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "12/30",
+ rangs: "12/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
appreciation: LOREM_IPSUM
- )
+ ))
}
+ private static SousMatiereImpressionInfo addNbElevesNotes(SousMatiereImpressionInfo impressionInfo) {
+ impressionInfo.nbNotes = 5
+ impressionInfo.moyennePrec1 = "10.5"
+ impressionInfo.moyennePrec2 = "11.5"
+ impressionInfo.moyennePrec3 = "9.5"
+ return impressionInfo
+ }
+
private static SousMatiereImpressionInfo creerSousMatiereImpressionInfoOral() {
- return new SousMatiereImpressionInfo(
+ return addNbElevesNotes(new SousMatiereImpressionInfo(
libelle: ORAL,
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
nbNotes: 1,
appreciation: "",
- coeff:1
- )
+ coeff: 1
+ ))
}
private static SousMatiereImpressionInfo creerSousMatiereImpressionInfoEcrit() {
libelle: ECRIT,
moyenneEleve: 10.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
nbNotes: 2,
- coeff:1
+ coeff: 1
)
}
libelle: "histoire",
moyenneEleve: 11.3,
moyenneClasse: 12.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 13.2,
moyenneMax: 16.3,
nbNotes: 2,
- coeff:1
+ coeff: 1
)
}
libelle: "Français",
moyenneEleve: 15.3,
moyenneClasse: 11.7,
- rang: "10/30",
+ rangs: "10/30",
moyenneMin: 11.2,
moyenneMax: 16.3,
appreciation: ASSEZ_BIEN,
- coeff:1
+ coeff: 1
)
}
eleveImpression.donneesTableau.moyenneMin = 5.0
eleveImpression.donneesTableau.moyenneMax = 15.0
- eleveImpression.donneesTableau.moyenneGeneraleEleve = 11.0
- eleveImpression.donneesTableau.moyenneGeneraleClasse = 10.0
+ eleveImpression.donneesTableau.moyenneEleve = 11.0
+ eleveImpression.donneesTableau.moyenneClasse = 10.0
eleveImpression.absences << new AbsencesImpression(
date: new Date(2011 - 1900, 2, 10),
import grails.converters.JSON
import org.lilie.services.eliot.scolarite.page.Page
-import org.lilie.services.eliot.impression.ImpressionEditionService
+import org.lilie.services.eliot.scolarite.parametrages.modelededocument.ImpressionEditionService
import org.lilie.services.eliot.impression.TemplateTypeFonctionnalite
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.impression.constantes.ConfigImpression
import org.lilie.services.eliot.impression.donnees.template.ZoneTemplateJasperInfo
import org.lilie.services.eliot.impression.constantes.TypeZone
import org.lilie.services.eliot.impression.TemplateEliot
-import org.lilie.services.eliot.impression.ImpressionMoteurService
import org.springframework.web.multipart.MultipartHttpServletRequest
import org.springframework.web.multipart.MultipartFile
-import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.ImpressionServiceNomUniqueException
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.applications.ModuleEliot
-import org.lilie.services.eliot.scolarite.parametrages.modelededocument.ImageService
-import org.lilie.services.eliot.scolarite.parametrages.modelededocument.ImageType
+import org.lilie.services.eliot.impression.image.ImpressionImageService
+import org.lilie.services.eliot.impression.image.ImageType
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.scolarite.etablissement.PreferenceEtablissementService
+import org.lilie.services.eliot.scolarite.parametrages.modelededocument.ImpressionApercuService
+import org.lilie.services.eliot.impression.template.fonte.ImpressionPoliceService
-class ImpressionEditionCourrierController extends AbstractImpressionEditionController {
+
+class ImpressionEditionCourrierController extends AbstractImpressionEditionController{
// gestion du zoom
static float zoomX = 1.5
-// static float zoomY = 2.2
static float zoomY = 3.2
ImpressionEditionService impressionEditionService
- ImpressionMoteurService impressionMoteurService
ImpressionTemplateDocumentService impressionTemplateDocumentService
- ImageService imageService
+ ImpressionImageService impressionImageService
+ ImpressionPoliceService impressionPoliceService
PreferenceEtablissementService preferenceEtablissementService
+ ImpressionApercuService impressionApercuService
/**
* Recherche pour un éventuel sous-modèle eliot, la liste
modele.listeMedia = listeMedia() as JSON
modele.listeModele = listModele() as JSON
+
if (chainModel?.messageErreur) {
modele.messageErreur = chainModel.messageErreur
}
List<ZoneTemplateJasperInfo> zones) {
zones.each {
ZoneTemplateJasperInfo zone ->
+
if (zone.codeTemplateDefaut) {
zone.template = message(code: zone.codeTemplateDefaut)
if (zone.template == zone.codeTemplateDefaut) {
message(code: DEBUT_CODE_MESSAGE_TITRE + 'tableau')
break
+
+ case TypeZone.BULLETIN:
+
+ zone.libelle =
+ message(code: DEBUT_CODE_MESSAGE_TITRE + 'bulletin')
+
+ break
+
}
}
}
templateDocument,
templateEliot
)
+
calculeLibelleZones(zones)
- calculeValeurParDefaut(templateDocument, zones)
+
+ calculeValeurParDefaut(
+ templateDocument,
+ zones
+ )
+
zoom(zones)
reponse = zones.collect {
it.toMap()
Map parametres = (Map) JSON.parse(params.params)
long idModele = parametres.id
String nom = parametres.nom
+ String police = parametres.police
List zones = parametres.zones
try {
- impressionEditionService.enregistreZonesTemplateJasper(idModele, nom, zones)
+
+ impressionEditionService.enregistreZonesTemplateJasper(
+ idModele,
+ nom,
+ police,
+ zones
+ )
+
} catch (ImpressionServiceNomUniqueException e) {
render([
success: false,
]
} catch (Exception e) {
- log.error "${e.stackTrace}"
+ log.error e
reponse = [
success: false,
message: message(code: CODE_ERR_CREATION_TEMPLATE_UTILISATEUR)
return
}
- imageService.enregistre(
+ impressionImageService.enregistre(
ImageType.LOGO,
etablissementCourant(),
- filePath.getInputStream().bytes)
+ filePath.getInputStream().bytes,
+ null)
render messageRetour(true, [code: CODE_SUCC_LOGO_MAJ])
}
return
}
- imageService.enregistre(
+ // TOIMP : à récupérer auprès du front
+ TemplateDocument templateDocument = null
+
+ impressionImageService.enregistre(
ImageType.CACHET,
etablissementCourant(),
- filePath.getInputStream().bytes
+ filePath.getInputStream().bytes,
+ templateDocument
)
render messageRetour(true, [code: CODE_SUCC_CACHET_MAJ])
def apercu = {
TemplateDocument templateDocument = TemplateDocument.get(params.templateId)
if (templateDocument) {
- List<EleveImpressionInfo> data = DonneesApercu.data(
- etablissementCourant(),
- templateDocument
- )
- ByteArrayOutputStream documentPDF = impressionMoteurService.creePdf(
+ ByteArrayOutputStream documentPDF = impressionApercuService.apercu(
etablissementCourant(),
- templateDocument,
- data
+ templateDocument
)
sendPdfFile(
*/
def lireLogo = {
- if (etablissementCourant()) {
-
- def image = imageService.load(ImageType.LOGO, etablissementCourant())
-
- response.contentType = ConfigImpression.TYPE_MIME_JPEG
- response.characterEncoding = "UTF-8"
- response.outputStream << image
+ chargeImage(
+ response,
+ params.templateId,
+ ImageType.LOGO
+ )
- } else {
- def reponse = [
- success: false,
- message: message(
- code: 'eliot.impression.logo.erreur.etablissementNull'
- )
- ]
- render reponse as JSON
- }
}
/**
*/
def lireCachet = {
- if (etablissementCourant()) {
+ chargeImage(
+ response,
+ params.templateId,
+ ImageType.CACHET
+ )
- def image = imageService.load(ImageType.CACHET, etablissementCourant())
+ }
- response.contentType = ConfigImpression.TYPE_MIME_JPEG
- response.characterEncoding = "UTF-8"
- response.outputStream << image
+ def imageVide ={
- } else {
- def reponse = [
- success: false,
- message: message(code: CODE_ERR_CACHET_MAJ_ETAB_NULL)
- ]
- render reponse as JSON
+ chargeImage(
+ response,
+ null,
+ ImageType.VIDE
+ )
+
+ }
+
+ private def chargeImage(def response, def templateId, ImageType imageType) {
+
+ TemplateDocument templateDocument = null
+ if (templateId) {
+ templateDocument = TemplateDocument.get(templateId)
}
+
+ byte[] image = impressionImageService.load(
+ imageType,
+ etablissementCourant(),
+ templateDocument
+ )
+
+ response.contentType = ConfigImpression.TYPE_MIME_JPEG
+ response.characterEncoding = "UTF-8"
+ response.outputStream << image
+
}
+
+
def edition = {
TemplateDocument templateDocument = TemplateDocument.get(
prepareSousModelePourModele(modele,
templateDocument.templateEliot)
+ modele.listePolices = impressionPoliceService.getAllFontes() as JSON
+
+ if (templateDocument.police) {
+ modele.police = templateDocument.police
+ } else {
+ modele.police = "Arial"
+ }
+
+ modele.listeTaillePolice = listeTaillePolice() as JSON
+
// on récupère la liste des éléments qui composent le modèle de
// document
modele.listeElements = listZones(
)
}
+ private def listeTaillePolice() {
+
+ List resultat = []
+ impressionPoliceService.allTaillePolice.each {Integer size ->
+ resultat << [
+ size: size,
+ libelle: size + ' pt'
+ ]
+ }
+
+ return resultat
+ }
+
@SuppressWarnings('CatchException') // JTRA : Pour gérer une réponse en cas d'erreur
def supprimeCachet = {
Map reponse = [:]
return templateTypeFonctionnaliteEnum.getModuleEliot()
}
- // champs ou methodes private
+// champs ou methodes private
private static final String CODE_ERR_LOGO_TAILLE_GRAND = 'eliot.impression.logo.erreur.tailleTropGrande'
private static final String CODE_ERR_LOGO_NULL = 'eliot.impression.logo.erreur.logoNull'
static final String DEBUT_CODE_MESSAGE_TITRE = 'eliot.impression.editeur.zone.titre.'
static final String CODE_MESSAGE_NOM_DUPLIQUE = 'eliot.impression.templateUtilisateur.erreur.nomDuplique'
-
}
package org.lilie.services.eliot.scolarite.parametrages.modelededocument.editeurs
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.ImpressionEditionService
+import org.lilie.services.eliot.scolarite.parametrages.modelededocument.ImpressionEditionService
import org.lilie.services.eliot.impression.donnees.template.ZoneTemplateJasperInfo
import org.lilie.services.eliot.impression.TemplateChampMemo
import grails.converters.JSON
eliot.impression.champsPublipostage.eleve_NbAbsExc=Nombre d’absences justifiées
eliot.impression.champsPublipostage.eleve_NbAbsence=Nombre total d'absences
eliot.impression.champsPublipostage.eleve_NbRetard=Nombre total de retards
-
eliot.impression.champsPublipostage.eleve_ApprGenerale=Appréciation générale de l'élève
-
eliot.impression.champsPublipostage.eleve_AvisConseil=Avis du conseil
eliot.impression.champsPublipostage.eleve_AvisOrientation=Avis d'orientation
-
eliot.impression.champsPublipostage.eleve_LibelleAvisConseil=Libellé avis du conseil de classe
eliot.impression.champsPublipostage.eleve_LibelleAvisOrientation=Libellé avis d'orientation
-
eliot.impression.champsPublipostage.etablissement=Etablissement
eliot.impression.champsPublipostage.avis_chef_etablissement=Avis du chef d'établissement pour le Brevet
eliot.impression.champsPublipostage.annee_scol_fin=Date de fin de l'année scolaire
eliot.impression.champsPublipostage.etablissement_academie=Académie de l'établissement
eliot.impression.champsPublipostage.etablissement_nature=Nature de l'établissement
eliot.impression.champsPublipostage.Date_Absence=Date d'absence la plus récente
-
+eliot.impression.champsPublipostage.classe_Effectif=Effectif de la classe
+eliot.impression.champsPublipostage.eleve_NbAbsJusRec=Nombre d'absences justifiées recevables
+eliot.impression.champsPublipostage.eleve_NbAbsJusNonRec=Nombre d'absences justifiées non recevables
+eliot.impression.champsPublipostage.eleve_NbAbsDemiPens=Nombre total d'absences à la demi-pension
+eliot.impression.champsPublipostage.eleve_NbAbsInternat=Nombre total d'absences à l'internat
+eliot.impression.champsPublipostage.eleve_NbDepAnti=Nombre total de départs anticipés
+eliot.impression.champsPublipostage.eleve_NbPunitions=Nombre de punitions
+eliot.impression.champsPublipostage.eleve_NbSanctions=Nombre de sanctions
# libellé des média de sortie du publipostage
eliot.impression.media.courrier=Courrier
eliot.impression.editeur.zone.titre.textInfoEleve=Informations concernant l'élève
eliot.impression.editeur.zone.titre.textTitre=Titre
eliot.impression.editeur.zone.titre.textObservation=Observation
+eliot.impression.editeur.zone.titre.bulletin=Corps du bulletin
eliot.impression.editeur.modification.succes=La modification a bien été enregistrée
eliot.impression.editeur.logo.erreur=Le logo n'a pas été correctement enregistré
eliot.impression.editeur.suppression=La suppression s'est correctement effectuée
eliot.impression.editeur.sms.tropGrand=Le nombre de caractères maximum du modèle est dépassé. Le texte a été tronqué.
eliot.impression.editeur.sms.infoLimite=Nombre de caractères envoyés limité à 160.
eliot.impression.editeur.sms.nomSmsObligatoire=Le nom du modèle de SMS est obligatoire.
+eliot.impression.editeur.zone.bulletinCheckBox.moyenneGenerale=Moyenne générale
+eliot.impression.editeur.zone.bulletinCheckBox.coefficient=Coefficient
+eliot.impression.editeur.zone.bulletinCheckBox.moyennePrecedente=Moyennes précédentes
+eliot.impression.editeur.zone.bulletinCheckBox.moyenneMinMax=Moyennes Min./Max.
+eliot.impression.editeur.zone.bulletinCheckBox.nombreNotes=Nombre de notes
+eliot.impression.editeur.zone.bulletinCheckBox.rangs=Rang/Nombre d'élèves
scolarite.format.dateJJMMAAAA=dd/MM/yyyy
import org.lilie.services.eliot.impression.TemplateDocument
import org.springframework.transaction.support.DefaultTransactionStatus
import org.springframework.jdbc.datasource.JdbcTransactionObjectSupport
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.scolarite.impression.importmodeles.ImpressionImportModeleService
import org.lilie.services.eliot.impression.ImpressionImportService
*/
protected boolean templateEliotEstObsolete(TemplateEliotEnum templateEliotEnum,
Integer version) {
- Boolean result = false
- TemplateEliot template = (TemplateEliot) templateEliots.find {
- it.code == templateEliotEnum.toString()
- }
- if (template?.numeroVersion != version) {
- result = true
- }
- return result
+// Boolean result = false
+// TemplateEliot template = (TemplateEliot) templateEliots.find {
+// it.code == templateEliotEnum.toString()
+// }
+// if (template?.numeroVersion != version) {
+// result = true
+// }
+// return result
+
+ return true
}
/**
import org.springframework.context.ApplicationContext
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import org.lilie.services.eliot.impression.ImpressionImportService
* @return true si le modèle est obsolète
*/
private boolean templateDocumentEstObsolete(ModelesUsine modelesUsine) {
- Boolean result = false
- TemplateDocument template = (TemplateDocument) templateDocuments.find {
- it.code == modelesUsine.getDocument().toString()
- }
-
- if (template?.numeroVersion != modelesUsine.getVersion()) {
- result = true
- }
- return result
+// Boolean result = false
+// TemplateDocument template = (TemplateDocument) templateDocuments.find {
+// it.code == modelesUsine.getDocument().toString()
+// }
+ return true
}
private void metAJourDocument(ModelesUsine documentsUsine,
package org.lilie.services.eliot.scolarite.impression.importmodeles.donnees
+/**
+ * @deprecated
+ */
class VersionModele {
- public final static Integer VERSION = 159
+ public final static Integer VERSION = 160
}
--- /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.scolarite.parametrages.modelededocument
+
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.impression.TemplateDocument
+
+import org.lilie.services.eliot.impression.ImpressionMoteurService
+import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
+import org.lilie.services.eliot.scolarite.parametrages.modelededocument.editeurs.DonneesApercu
+import org.lilie.services.eliot.impression.donnees.DonneesOptions
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.scolarite.IntervalleEnum
+
+/**
+ * Génération de l'aperçu
+ * @author othe
+ */
+class ImpressionApercuService {
+
+ ImpressionMoteurService impressionMoteurService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
+
+ /**
+ * Gestion de l'aperçu
+ * @param etablissement
+ * @param templateDocument
+ * @return
+ */
+ public ByteArrayOutputStream apercu(Etablissement etablissement, TemplateDocument templateDocument) {
+
+ List<EleveImpressionInfo> data = DonneesApercu.data(
+ etablissement,
+ templateDocument
+ )
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.ANNEE)
+
+ DonneesOptions donneesOptions = new DonneesOptions(
+ data: data,
+ options: impressionBulletinOptionsService.getParametreOptions(
+ templateDocument,
+ typePeriode)
+ )
+
+ return impressionMoteurService.creePdf(
+ etablissement,
+ templateDocument,
+ donneesOptions
+ )
+
+ }
+
+
+}
* <http://www.cecill.info/licences.fr.html>.
*/
-
-
-
-
-
-
-package org.lilie.services.eliot.impression
+package org.lilie.services.eliot.scolarite.parametrages.modelededocument
import net.sf.jasperreports.engine.JRBand
import net.sf.jasperreports.engine.JRElement
import org.lilie.services.eliot.impression.constantes.ConfigImpression
import org.lilie.services.eliot.impression.constantes.TypeZone
import org.lilie.services.eliot.impression.donnees.template.ZoneTemplateJasperInfo
-import org.lilie.services.eliot.scolarite.etablissement.PreferenceEtablissementService
import org.springframework.transaction.annotation.Transactional
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import net.sf.jasperreports.engine.design.JRDesignStaticText
import net.sf.jasperreports.engine.design.JRDesignComponentElement
+import org.lilie.services.eliot.impression.template.bulletin.ImpressionBulletinTemplateService
+import org.lilie.services.eliot.impression.TemplateEliot
+import org.lilie.services.eliot.impression.TemplateTypeFonctionnalite
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.ImpressionServiceException
+import org.lilie.services.eliot.impression.TemplateJasper
+import org.lilie.services.eliot.impression.TemplateChampMemo
+import org.lilie.services.eliot.impression.TemplateDocumentSousTemplateEliot
+import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.scolarite.IntervalleEnum
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+import org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise
+import org.lilie.services.eliot.impression.template.fonte.PoliceEnum
/**
* Service d'edition
+ * @author othe
*/
@SuppressWarnings('CatchException')
class ImpressionEditionService {
static transactional = false
SessionFactory sessionFactory
- PreferenceEtablissementService preferenceEtablissementService
ImpressionTemplateDocumentService impressionTemplateDocumentService
+ ImpressionBulletinTemplateService impressionBulletinTemplateService
+ ImpressionBulletinOptionsService impressionBulletinOptionsService
/**
* Retourne la liste des template eliot disponibles
* @return la liste des templates Eliot du type de fonctionnalité et de ses fils
*/
private List<TemplateEliot> findAllSousTemplateForTypeFonctionnalite(
- TemplateTypeFonctionnalite typeFonctionnalite,
- boolean sousRapport) {
+ TemplateTypeFonctionnalite typeFonctionnalite,
+ boolean sousRapport) {
def res = []
def criteria = TemplateEliot.createCriteria()
res += criteria.list {
TemplateEliot templateEliot)
throws ImpressionServiceException {
- String jrxml = ""
- if (templateDocument) {
- jrxml = templateDocument?.templateEliot?.templateJasper?.jrxml
- }
- else {
- jrxml = templateEliot?.templateJasper?.jrxml
- }
+ JasperDesign jasperDesign = construitModeleEdition(templateDocument, templateEliot)
- if (jrxml == null) {
- throw new ImpressionServiceException(
- "Aucun template jrxml pour template utilisateur ${templateDocument}"
- )
- }
- ByteArrayInputStream is = new ByteArrayInputStream(
- jrxml.getBytes(ConfigImpression.DEFAULT_ENCODING)
- )
- JasperDesign jasperDesign = JRXmlLoader.load(is)
def zones = []
int offsetOnY = 0
band.elements.each { JRElement elt ->
// fsil : recherche des zones textes ou memo dans la premiere bande:
- if (elt instanceof JRDesignTextField) {
- ZoneTemplateJasperInfo zone = zoneTemplateJasperIfoForJRDesignTextField(
- templateDocument, elt, offsetOnY)
- zones << zone
- } else if (elt instanceof JRDesignComponentElement) {
- ZoneTemplateJasperInfo zone = zoneTemplateJasperInfoForJRDesignComponentElement(
- elt,
- offsetOnY,
- TypeZone.TEXT)
- zones << zone
-
- } else if (elt instanceof JRDesignStaticText) {
- ZoneTemplateJasperInfo zone = zoneTemplateJasperInfoForJRDesignStaticText(
- elt,
- offsetOnY,
- TypeZone.TEXT)
- zones << zone
- } else if (elt instanceof JRDesignImage) {
-
- ZoneTemplateJasperInfo zone
- // si on est sur la première bande c'est le logo
- if (index == 0) {
- zone = zoneTemplateJasperInfoForJRDesignImage(
- elt,
- offsetOnY,
- TypeZone.LOGO
+ switch (elt.getClass()) {
+ case JRDesignTextField:
+ ZoneTemplateJasperInfo zone = zoneTemplateJasperIfoForJRDesignTextField(
+ templateDocument,
+ (JRDesignTextField) elt,
+ offsetOnY
)
- }
- else {
- // sinon c'est que c'est le cachet
- zone = zoneTemplateJasperInfoForJRDesignImage(
- elt,
+
+ zones << zone
+
+ break
+ case JRDesignComponentElement:
+ ZoneTemplateJasperInfo zone = zoneTemplateJasperInfoForJRDesignComponentElement(
+ (JRDesignComponentElement) elt,
offsetOnY,
- TypeZone.CACHET
- )
+ TypeZone.TEXT)
+ zones << zone
+ break
- }
- zones << zone
- } else if (elt instanceof JRDesignSubreport) {
- // fsil : recherche du sous model (unique dans le template)
- if (nombreModeles > 0) {
- throw new ImpressionServiceException(
- "Le moteur d'impression ne gere pas plus d'un " +
- "internalModele dans le template."
- )
- } else {
- log.info "Element modele : " + elt.getClass().getCanonicalName()
- }
- ZoneTemplateJasperInfo zone =
- zoneTemplateJasperIfoForJRDesignSubreport(
- templateDocument,
- elt,
- offsetOnY
- )
- nombreModeles++
- zones << zone
+ case JRDesignStaticText:
+
+ ZoneTemplateJasperInfo zone = zoneTemplateJasperInfoForJRDesignStaticText(
+ (JRDesignStaticText) elt,
+ offsetOnY,
+ TypeZone.TEXT)
+ zones << zone
+
+ break
+
+ case JRDesignImage:
+
+ ZoneTemplateJasperInfo zone
+ // si on est sur la première bande c'est le logo
+ if (index == 0) {
+ zone = zoneTemplateJasperInfoForJRDesignImage(
+ (JRDesignImage) elt,
+ offsetOnY,
+ TypeZone.LOGO
+ )
+ }
+ else {
+ // sinon c'est que c'est le cachet
+ zone = zoneTemplateJasperInfoForJRDesignImage(
+ (JRDesignImage) elt,
+ offsetOnY,
+ TypeZone.CACHET
+ )
+
+ }
+ zones << zone
+
+ break
+
+
+ case JRDesignSubreport:
+
+ if (impressionBulletinTemplateService.isModeleBulletin(templateDocument)) {
+
+ ZoneTemplateJasperInfo zone =
+ zoneTemplateJasperIfoForJRDesignSubreport(
+ templateDocument,
+ (JRDesignSubreport) elt,
+ offsetOnY,
+ TypeZone.BULLETIN
+ )
+ nombreModeles++
+ zones << zone
+ }
+ else {
+
+ ZoneTemplateJasperInfo zone =
+ zoneTemplateJasperIfoForJRDesignSubreport(
+ templateDocument,
+ (JRDesignSubreport) elt,
+ offsetOnY
+ )
+ nombreModeles++
+ zones << zone
+ }
+
+
+ break
}
+
}
offsetOnY += band.height
}
return zones
}
+ /**
+ * Construction de l'objet jasperdesign à partir du modele de doc ou du modele jasper
+ * @param templateDocument
+ * @param templateEliot
+ * @return
+ */
+ private JasperDesign construitModeleEdition(TemplateDocument templateDocument, TemplateEliot templateEliot) {
+ String jrxml = ""
+ if (templateDocument) {
+ jrxml = templateDocument?.templateEliot?.templateJasper?.jrxml
+ }
+ else {
+ jrxml = templateEliot?.templateJasper?.jrxml
+ }
+
+ if (jrxml == null) {
+ throw new ImpressionServiceException(
+ "Aucun template jrxml pour template utilisateur ${templateDocument}"
+ )
+ }
+ ByteArrayInputStream is = new ByteArrayInputStream(
+ jrxml.getBytes(ConfigImpression.DEFAULT_ENCODING)
+ )
+
+ JasperDesign jasperDesign = JRXmlLoader.load(is)
+ jasperDesign
+ }
+
/**
* Enregistre une modification d'un élément de modèle pour les sous-états et
* pour les champs memo.
case TypeZone.SOUSMODEL:
modifieZoneTemplateJasperTypeSousModele(templateDocument, zoneInfo)
break
+ case TypeZone.BULLETIN:
+ modifiezoneTemplateJasperTypeBulletin(templateDocument, zoneInfo)
+ break
}
}
+ /**
+ * Enregistre les options d'impression du bulletin de notes
+ * @param templateDocument
+ * @param zoneInfo
+ */
+ private void modifiezoneTemplateJasperTypeBulletin(TemplateDocument templateDocument, ZoneTemplateJasperInfo zoneInfo) {
+// on recherche l'éventuel sous-template associé au modèle de bulletin
+ TemplateDocumentSousTemplateEliot templateDocSousTemplate =
+ TemplateDocumentSousTemplateEliot.findByTemplateDocumentAndParam(
+ templateDocument,
+ 'tableau'
+ )
+
+ TemplateEliot ssTemplateEliot = TemplateEliot.findByCode(TemplateEliotEnum.BUL_NOTES_TABLEAU.toString())
+
+ if (!templateDocSousTemplate) {
+ new TemplateDocumentSousTemplateEliot(
+ templateDocument: templateDocument,
+ param: 'tableau',
+ templateEliot: ssTemplateEliot
+ ).save(flush: true, failOnError: true)
+ }
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = (BulletinOptionsPersonnalise) zoneInfo.complement
+
+ BulletinOptions bulletinOptions = BulletinOptions.findByTemplateDocument(templateDocument)
+
+ if (!bulletinOptions) {
+ bulletinOptions = new BulletinOptions()
+ bulletinOptions.templateDocument = templateDocument
+ }
+
+ bulletinOptions.moyenneGenerale = bulletinOptionsPersonnalise.moyenneGenerale
+ bulletinOptions.moyenneMinMax = bulletinOptionsPersonnalise.moyenneMinMax
+ bulletinOptions.moyennePrecedente = bulletinOptionsPersonnalise.moyennePrec
+ bulletinOptions.nombreNotes = bulletinOptionsPersonnalise.nombreNotes
+ bulletinOptions.rangs = bulletinOptionsPersonnalise.rangs
+ bulletinOptions.coefficient = bulletinOptionsPersonnalise.coefficient
+ bulletinOptions.save(flush: true, failOnError: true)
+ }
+
/**
* Retourne la liste des noms de champs des memo d'un template jasper (retourne la liste
* des noms de champ associé)
join 'typeFonctionalite'
}
TreeMap<String, TemplateTypeFonctionnalite> foncs =
- new TreeMap<String, TemplateTypeFonctionnalite>()
+ new TreeMap<String, TemplateTypeFonctionnalite>()
templatesEliot.each { TemplateEliot templateEliot ->
templateDocument, zone.champ)
if (templateChampMemo) {
zone.template = templateChampMemo.template
+ if (templateChampMemo.size) {
+ zone.size = templateChampMemo.size
+ } else {
+ zone.size = textField.fontSize
+ }
} else {
+ // on récupère la taille de la police dans le modele
+ zone.size = textField.fontSize
// sinon, c'est qu'il n'existe pas. Dans ce cas on doit rechercher l'éventuelle
// valeur par défaut
zone.codeTemplateDefaut = "eliot.impression.defaut.memo." +
return zone
}
-
-
/**
* Retourne un objet de type ZoneTemplateJasperInfo constitué à partir d'un element
* JRdesignSubreport
*/
private ZoneTemplateJasperInfo zoneTemplateJasperIfoForJRDesignSubreport(TemplateDocument templateDocument,
JRDesignSubreport subreport,
- int offsetOnY) {
+ int offsetOnY,
+ TypeZone typeZone = TypeZone.SOUSMODEL) {
+
+
+ TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T3)
+
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
+ impressionBulletinOptionsService.getParametreOptions(templateDocument, typePeriode)
+
ZoneTemplateJasperInfo zone = new ZoneTemplateJasperInfo(
x: subreport.x,
y: subreport.y + offsetOnY,
width: subreport.width,
height: subreport.height,
- typeZone: TypeZone.SOUSMODEL,
- champ: subreport.expression.chunks[0].text
+ typeZone: typeZone,
+ champ: subreport.expression.chunks[0].text,
+ complement: bulletinOptionsPersonnalise
)
// recupere l'id du sous modelsi il existe
if (templateDocument) {
TemplateDocumentSousTemplateEliot templateDocumentSousTemplateEliot =
- TemplateDocumentSousTemplateEliot.findByTemplateDocumentAndParam(
- templateDocument,
- zone.champ
- )
+ TemplateDocumentSousTemplateEliot.findByTemplateDocumentAndParam(
+ templateDocument,
+ zone.champ
+ )
zone.idTemplateJasper = templateDocumentSousTemplateEliot?.templateEliot?.id
}
* @throws ImpressionServiceException
*/
public void modifieZoneTemplateJasperTypeMemo(
- TemplateDocument templateDocument,
- ZoneTemplateJasperInfo zoneInfo)
+ TemplateDocument templateDocument,
+ ZoneTemplateJasperInfo zoneInfo)
throws ImpressionServiceException {
// recherche du template groovy
try {
if (templateChampMemo) {
+ templateChampMemo.size = zoneInfo.size
templateChampMemo.template = zoneInfo.template
templateChampMemo.save(flush: true, failOnError: true)
} else {
- sauveChampMemo(templateDocument, zoneInfo)
+ sauveChampMemo(
+ templateDocument,
+ zoneInfo
+ )
}
} catch (Exception e) {
log.error e.message
* @param zoneInfo
*/
public void sauveChampMemo(TemplateDocument templateDocument, ZoneTemplateJasperInfo zoneInfo) {
- new TemplateChampMemo(
+ new TemplateChampMemo(
templateDocument: templateDocument,
champ: zoneInfo.champ,
- template: zoneInfo.template
+ template: zoneInfo.template,
+ size: zoneInfo.size
).save(flush: true, failOnError: true)
}
)
TemplateDocumentSousTemplateEliot templateDocSousTemplate =
- TemplateDocumentSousTemplateEliot.findByTemplateDocumentAndParam(
- templateDocument,
- zoneInfo.champ
- )
+ TemplateDocumentSousTemplateEliot.findByTemplateDocumentAndParam(
+ templateDocument,
+ zoneInfo.champ
+ )
if (ssTemplateEliot) {
if (templateDocSousTemplate) {
*/
public void enregistreZonesTemplateJasper(long idModele,
String nom,
+ String police,
List zones) {
TemplateDocument templateDocument = TemplateDocument.get(idModele)
throw new ImpressionServiceException("Le modèle ${idModele} n'existe pas.")
}
- if (templateDocument.nom != nom) {
+ police = 'Arial'
+
+ if (!PoliceEnum.verifie(police)) {
+ throw new IllegalArgumentException("La police $police est inconnue.")
+ }
+
+ if ((templateDocument.nom != nom) || (templateDocument.police != police)) {
impressionTemplateDocumentService.modifieTemplateDocument(
templateDocument,
nom,
+ police,
templateDocument.descriptif
)
}
zones.each {
TypeZone typeZone
+ Object complement = null
+ Integer size = null
+
+ if (!it.typeZone) {
+ throw new IllegalStateException("Le type de zone est obligatoire.")
+ }
switch (it.typeZone) {
- case 1: typeZone = TypeZone.MEMO
+ case 1:
+ typeZone = TypeZone.MEMO
+ size = it.size
break
case 2: typeZone = TypeZone.TEXT
break
break
case 5: typeZone = TypeZone.CACHET
break
+ case 6: typeZone = TypeZone.BULLETIN
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = new BulletinOptionsPersonnalise()
+ bulletinOptionsPersonnalise.moyenneGenerale = it.complement.moyenneGenerale
+ bulletinOptionsPersonnalise.coefficient = it.complement.coefficient
+ bulletinOptionsPersonnalise.moyennePrec1 = it.complement.moyennePrecedente
+ bulletinOptionsPersonnalise.moyennePrec2 = it.complement.moyennePrecedente
+ bulletinOptionsPersonnalise.moyenneMinMax = it.complement.moyenneMinMax
+ bulletinOptionsPersonnalise.nombreNotes = it.complement.nombreNotes
+ bulletinOptionsPersonnalise.rangs = it.complement.rangs
+ complement = bulletinOptionsPersonnalise
+ break
+
}
ZoneTemplateJasperInfo zoneTemplateJasperInfo =
- new ZoneTemplateJasperInfo(
- champ: it.champ,
- typeZone: typeZone,
- template: it.template,
- idTemplateJasper: it.idTemplateJasper
- )
+ new ZoneTemplateJasperInfo(
+ champ: it.champ,
+ typeZone: typeZone,
+ template: it.template,
+ idTemplateJasper: it.idTemplateJasper,
+ complement: complement,
+ size: size
+ )
+
modifieZoneTemplateJasper(
templateDocument,
* @param nom
* @param templateDocument
*/
- public void modifieNomModele(String nom, TemplateDocument templateDocument){
+ public void modifieNomModele(String nom, TemplateDocument templateDocument) {
templateDocument.nom = nom
templateDocument.save(flush: true, failOnError: true)
}
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.url.supprimeLogo = '${createLink(action: 'supprimeLogo', controller: 'impressionEditionCourrier')}';
//DATAs
+%{--eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.data.nomFonte = "${nomFonte.encodeAsJavaScript()}";--}%
+%{--eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.data.listeFontes = ${listeFontes};--}%
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.data.nomTemplate = "${nomTemplate.encodeAsJavaScript()}";
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.data.listeElements = ${listeElements};
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.data.listeSousRapport = ${listeSousRapport};
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.premierItemTableau = '${g.message(code: "eliot.scolarite.libelle.premierItemTableau").encodeAsJavaScript()}';
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.titre = '${g.message(code: "eliot.impression.editeur.zone.titre.textTitre").encodeAsJavaScript()}';
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.supprimer = '${g.message(code: "eliot.scolarite.libelle.supprimer").encodeAsJavaScript()}';
-
+eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.bulletinCheckBox.moyenneGenerale = '${g.message(code: "eliot.impression.editeur.zone.bulletinCheckBox.moyenneGenerale").encodeAsJavaScript()}';
+eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.bulletinCheckBox.coefficient = '${g.message(code: "eliot.impression.editeur.zone.bulletinCheckBox.coefficient").encodeAsJavaScript()}';
+eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.bulletinCheckBox.moyennePrecedente = '${g.message(code: "eliot.impression.editeur.zone.bulletinCheckBox.moyennePrecedente").encodeAsJavaScript()}';
+eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.bulletinCheckBox.moyenneMinMax = '${g.message(code: "eliot.impression.editeur.zone.bulletinCheckBox.moyenneMinMax").encodeAsJavaScript()}';
+eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.bulletinCheckBox.nombreNotes = '${g.message(code: "eliot.impression.editeur.zone.bulletinCheckBox.nombreNotes").encodeAsJavaScript()}';
+eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.libelle.bulletinCheckBox.rangs = '${g.message(code: "eliot.impression.editeur.zone.bulletinCheckBox.rangs").encodeAsJavaScript()}';
//HEADERS
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele.header.template = '${g.message(code: "eliot.scolarite.libelle.template").encodeAsJavaScript()}';
</locales>
-->
</fontFamily>
+
+ <fontFamily name="Courier">
+ <normal>org/lilie/services/fonts/courier/Courier.ttf</normal>
+ <bold>org/lilie/services/fonts/courier/Courier-Bold.ttf</bold>
+ <italic>org/lilie/services/fonts/courier/Courier-Oblique.ttf</italic>
+ <boldItalic>org/lilie/services/fonts/courier/Courier-Bold.ttf</boldItalic>
+ <pdfEncoding>Identity-H</pdfEncoding>
+ <pdfEmbedded>true</pdfEmbedded>
+ <exportFonts>
+ <export key="net.sf.jasperreports.html">Courier</export>
+ <export key="net.sf.jasperreports.xhtml">Courier</export>
+ </exportFonts>
+ <!--
+ <locales>
+ <locale>en_US</locale>
+ <locale>de_DE</locale>
+ </locales>
+ -->
+ </fontFamily>
+
</fontFamilies>
-package org.lilie.services.eliot.impression
+package org.lilie.services.eliot.scolarite
import org.hibernate.SessionFactory
import org.lilie.services.eliot.impression.constantes.TypeMedia
import org.lilie.services.eliot.impression.constantes.TypeZone
import org.lilie.services.eliot.impression.donnees.template.ZoneTemplateJasperInfo
-import org.lilie.services.eliot.scolarite.Etablissement
import grails.converters.JSON
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
import org.lilie.services.eliot.test.PopulationTestEtablissement
import org.lilie.services.eliot.notes.EtablissementNotes
-import org.lilie.services.eliot.scolarite.EtablissementSts
+
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.impression.TemplateTypeFonctionnalite
+import org.lilie.services.eliot.impression.TemplateEliot
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.TemplateChampMemo
+import org.lilie.services.eliot.impression.PublipostageSuivi
+import org.lilie.services.eliot.impression.TemplateJasper
+import org.lilie.services.eliot.impression.TemplateDocumentSousTemplateEliot
class ImpressionEditionServiceTests extends GroovyTestCase {
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="A4" pageWidth="595" pageHeight="842" columnWidth="539" leftMargin="28" rightMargin="28" topMargin="28" bottomMargin="28">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
- <property name="ireport.y" value="342"/>
+ <property name="ireport.y" value="329"/>
<style name="titre_document" hAlign="Center" fontName="Arial" fontSize="18"/>
<style name="label" hAlign="Left" fontName="Arial" fontSize="10"/>
<style name="valeur_champ" fontName="Arial" fontSize="10"/>
<parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["/home/olivier/Documents/notes/jasper/"]]></defaultValueExpression>
</parameter>
+ <parameter name="options" class="java.lang.Object" isForPrompting="false"/>
<field name="classe_ProfPrincipal" class="java.lang.String"/>
<field name="classe_PeriodeNom" class="java.lang.String"/>
<field name="classe_PeriodeDebut" class="java.lang.String"/>
<subreportParameter name="ligneMatiere">
<subreportParameterExpression><![CDATA[$P{ligneMatiere}]]></subreportParameterExpression>
</subreportParameter>
+ <subreportParameter name="options">
+ <subreportParameterExpression><![CDATA[$P{options}]]></subreportParameterExpression>
+ </subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{sousModele})]]></dataSourceExpression>
<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{tableau}]]></subreportExpression>
</subreport>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
- <property name="ireport.y" value="159"/>
+ <property name="ireport.y" value="158"/>
<style name="titre_document" hAlign="Center" fontName="Arial" fontSize="18"/>
<style name="label" hAlign="Left" fontName="Arial" fontSize="10"/>
<style name="valeur_champ" fontName="Arial" fontSize="10"/>
+ <style name="bordure">
+ <box>
+ <pen lineWidth="0.25"/>
+ <topPen lineWidth="0.25"/>
+ <leftPen lineWidth="0.25"/>
+ <bottomPen lineWidth="0.25"/>
+ <rightPen lineWidth="0.25"/>
+ </box>
+ </style>
<parameter name="tableau" class="java.lang.Object" isForPrompting="false"/>
<parameter name="ligneMatiere" class="java.lang.Object" isForPrompting="false"/>
<parameter name="ligneSousMatiere" class="java.lang.Object" isForPrompting="false"/>
</parameter>
<parameter name="logo" class="java.lang.Object"/>
<parameter name="cachet" class="java.lang.Object"/>
+ <parameter name="options" class="java.lang.Object" isForPrompting="false"/>
<field name="classe_ProfPrincipal" class="java.lang.String"/>
<field name="classe_PeriodeNom" class="java.lang.String"/>
<field name="classe_PeriodeDebut" class="java.lang.String"/>
</band>
<band height="33" splitType="Stretch">
<subreport runToBottom="false">
- <reportElement x="0" y="0" width="555" height="32"/>
+ <reportElement style="bordure" x="0" y="0" width="555" height="32"/>
<subreportParameter name="ligneSousMatiere">
<subreportParameterExpression><![CDATA[$P{ligneSousMatiere}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="ligneMatiere">
<subreportParameterExpression><![CDATA[$P{ligneMatiere}]]></subreportParameterExpression>
</subreportParameter>
+ <subreportParameter name="options">
+ <subreportParameterExpression><![CDATA[$P{options}]]></subreportParameterExpression>
+ </subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{sousModele})]]></dataSourceExpression>
<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{tableau}]]></subreportExpression>
</subreport>
</parameter>
<parameter name="logo" class="java.lang.Object"/>
<parameter name="cachet" class="java.lang.Object"/>
+ <parameter name="options" class="java.lang.Object" isForPrompting="false"/>
<field name="classe_ProfPrincipal" class="java.lang.String"/>
<field name="classe_PeriodeNom" class="java.lang.String"/>
<field name="classe_PeriodeDebut" class="java.lang.String"/>
<subreportParameter name="ligneMatiere">
<subreportParameterExpression><![CDATA[$P{ligneMatiere}]]></subreportParameterExpression>
</subreportParameter>
+ <subreportParameter name="options">
+ <subreportParameterExpression><![CDATA[$P{options}]]></subreportParameterExpression>
+ </subreportParameter>
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{sousModele})]]></dataSourceExpression>
<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{tableau}]]></subreportExpression>
</subreport>
<textFieldExpression class="java.lang.String"><![CDATA[$F{textAdresse}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement x="100" y="0" width="439" height="80"/>
+ <reportElement x="103" y="0" width="436" height="80"/>
<textElement markup="html">
<font fontName="Arial" size="10" pdfFontName="Helvetica" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{textEtablissement}]]></textFieldExpression>
</textField>
<image isUsingCache="true" isLazy="true" onErrorType="Blank">
- <reportElement x="0" y="0" width="100" height="110"/>
+ <reportElement x="0" y="0" width="99" height="94"/>
<imageExpression class="java.io.InputStream"><![CDATA[$P{logo}]]></imageExpression>
</image>
</band>
<detail>
<band height="255" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
- <reportElement style="valeur_champ" stretchType="RelativeToBandHeight" x="256" y="133" width="283" height="99"/>
+ <reportElement style="valeur_champ" stretchType="RelativeToBandHeight" x="263" y="133" width="276" height="99"/>
<textElement markup="html">
<font fontName="Arial" pdfFontName="Helvetica" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{textAdresse}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement x="100" y="0" width="439" height="80"/>
+ <reportElement x="103" y="0" width="436" height="80"/>
<textElement markup="html">
<font fontName="Arial" size="10" pdfFontName="Helvetica" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{textEtablissement}]]></textFieldExpression>
</textField>
<image isUsingCache="true" isLazy="true" onErrorType="Blank">
- <reportElement x="0" y="0" width="100" height="110"/>
+ <reportElement x="0" y="0" width="99" height="94"/>
<imageExpression class="java.io.InputStream"><![CDATA[$P{logo}]]></imageExpression>
</image>
</band>
<detail>
<band height="255" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
- <reportElement style="valeur_champ" stretchType="RelativeToBandHeight" x="256" y="133" width="283" height="99"/>
+ <reportElement style="valeur_champ" stretchType="RelativeToBandHeight" x="263" y="133" width="276" height="99"/>
<textElement markup="html">
<font fontName="Arial" pdfFontName="Helvetica" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{textAdresse}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement x="100" y="0" width="439" height="80"/>
+ <reportElement x="103" y="0" width="436" height="80"/>
<textElement markup="html">
<font fontName="Arial" size="10" pdfFontName="Helvetica" isPdfEmbedded="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{textEtablissement}]]></textFieldExpression>
</textField>
<image isUsingCache="true" isLazy="true" onErrorType="Blank">
- <reportElement x="0" y="0" width="100" height="110"/>
+ <reportElement x="0" y="0" width="99" height="94"/>
<imageExpression class="java.io.InputStream"><![CDATA[$P{logo}]]></imageExpression>
</image>
</band>
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="LignesMatieres" pageWidth="555" pageHeight="842" columnWidth="277" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
<property name="ireport.zoom" value="5.0"/>
- <property name="ireport.x" value="1213"/>
+ <property name="ireport.x" value="1014"/>
<property name="ireport.y" value="0"/>
<style name="cellule" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="7">
<box topPadding="0" leftPadding="3" bottomPadding="0" rightPadding="3">
<field name="moyenneMin" class="java.lang.String"/>
<field name="moyenneMax" class="java.lang.String"/>
<field name="coeff" class="java.lang.String"/>
+ <field name="appreciation" class="java.lang.String"/>
+ <field name="prof" class="java.lang.String"/>
<field name="moyenneClasse" class="java.lang.String"/>
<field name="moyenneEleve" class="java.lang.String"/>
+ <field name="moyennePrec1" class="java.lang.String"/>
+ <field name="moyennePrec2" class="java.lang.String"/>
+ <field name="rangs" class="java.lang.String"/>
+ <field name="nbNotes" class="java.lang.Integer"/>
+ <field name="moyennePrec3" class="java.lang.String"/>
</subDataset>
<parameter name="ligneSousMatiere" class="java.lang.Object"/>
<field name="libelle" class="java.lang.String"/>
- <field name="rang" class="java.lang.String"/>
<field name="moyenneMin" class="java.lang.String"/>
<field name="moyenneMax" class="java.lang.String"/>
<field name="coeff" class="java.lang.String"/>
+ <field name="rangs" class="java.lang.String"/>
+ <field name="nbNotes" class="java.lang.Integer"/>
<field name="appreciation" class="java.lang.String"/>
<field name="sousMatieres" class="java.util.List"/>
<field name="prof" class="java.lang.String"/>
<field name="moyenneClasse" class="java.lang.String"/>
<field name="moyenneEleve" class="java.lang.String"/>
+ <field name="moyennePrec1" class="java.lang.String"/>
+ <field name="moyennePrec2" class="java.lang.String"/>
+ <field name="moyennePrec3" class="java.lang.String"/>
<detail>
<band height="20" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
- <reportElement style="cellule_app" stretchType="RelativeToBandHeight" mode="Opaque" x="253" y="0" width="302" height="20">
+ <reportElement key="appreciation" style="cellule_app" stretchType="RelativeToBandHeight" mode="Opaque" x="334" y="0" width="221" height="20">
<printWhenExpression><![CDATA[($F{sousMatieres}.size()>0)]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Left">
<textFieldExpression class="java.lang.String"><![CDATA[$F{appreciation}]]></textFieldExpression>
</textField>
<subreport>
- <reportElement style="cellule_app" stretchType="RelativeToBandHeight" x="0" y="0" width="253" height="20"/>
+ <reportElement key="colonnes" style="cellule_app" stretchType="RelativeToBandHeight" x="0" y="0" width="334" height="20"/>
<subreportParameter name="moyenneMin">
<subreportParameterExpression><![CDATA[$F{moyenneMin}]]></subreportParameterExpression>
</subreportParameter>
- <subreportParameter name="prof">
- <subreportParameterExpression><![CDATA[$F{prof}]]></subreportParameterExpression>
- </subreportParameter>
<subreportParameter name="moyenneEleve">
<subreportParameterExpression><![CDATA[$F{moyenneEleve}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="libelle">
<subreportParameterExpression><![CDATA[$F{libelle}]]></subreportParameterExpression>
</subreportParameter>
- <subreportParameter name="rang">
- <subreportParameterExpression><![CDATA[$F{rang}]]></subreportParameterExpression>
+ <subreportParameter name="moyenneMax">
+ <subreportParameterExpression><![CDATA[$F{moyenneMax}]]></subreportParameterExpression>
+ </subreportParameter>
+ <subreportParameter name="prof">
+ <subreportParameterExpression><![CDATA[$F{prof}]]></subreportParameterExpression>
+ </subreportParameter>
+ <subreportParameter name="moyennePrec3">
+ <subreportParameterExpression><![CDATA[$F{moyennePrec3}]]></subreportParameterExpression>
+ </subreportParameter>
+ <subreportParameter name="moyennePrec2">
+ <subreportParameterExpression><![CDATA[$F{moyennePrec2}]]></subreportParameterExpression>
+ </subreportParameter>
+ <subreportParameter name="moyennePrec1">
+ <subreportParameterExpression><![CDATA[$F{moyennePrec1}]]></subreportParameterExpression>
+ </subreportParameter>
+ <subreportParameter name="rangs">
+ <subreportParameterExpression><![CDATA[$F{rangs}]]></subreportParameterExpression>
+ </subreportParameter>
+ <subreportParameter name="nbNotes">
+ <subreportParameterExpression><![CDATA[$F{nbNotes}]]></subreportParameterExpression>
</subreportParameter>
<subreportParameter name="moyenneClasse">
<subreportParameterExpression><![CDATA[$F{moyenneClasse}]]></subreportParameterExpression>
</subreportParameter>
- <subreportParameter name="moyenneMax">
- <subreportParameterExpression><![CDATA[$F{moyenneMax}]]></subreportParameterExpression>
- </subreportParameter>
<subreportParameter name="coeff">
<subreportParameterExpression><![CDATA[$F{coeff}]]></subreportParameterExpression>
</subreportParameter>
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="donnees" pageWidth="555" pageHeight="842" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
- <property name="ireport.zoom" value="5.0"/>
- <property name="ireport.x" value="1043"/>
+ <property name="ireport.zoom" value="4.0"/>
+ <property name="ireport.x" value="1053"/>
<property name="ireport.y" value="0"/>
- <style name="cellule" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="7">
+ <style name="cellule" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="8">
<box topPadding="0" leftPadding="3" bottomPadding="0" rightPadding="3">
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25"/>
<rightPen lineWidth="0.25"/>
</box>
</style>
- <style name="cellule_non_bordee" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="7">
+ <style name="cellule_non_bordee" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="8">
<box leftPadding="3" rightPadding="3"/>
</style>
- <style name="cellule_app" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="7">
+ <style name="cellule_app" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="8">
<box topPadding="0" leftPadding="3" bottomPadding="0" rightPadding="3">
<pen lineWidth="0.25"/>
<topPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
<field name="coeff" class="java.lang.String"/>
<field name="moyenneClasse" class="java.lang.String"/>
<field name="moyenneEleve" class="java.lang.String"/>
+ <field name="moyennePrec1" class="java.lang.String"/>
+ <field name="rangs" class="java.lang.String"/>
+ <field name="nbNotes" class="java.lang.Integer"/>
+ <field name="moyennePrec2" class="java.lang.String"/>
+ <field name="moyennePrec3" class="java.lang.String"/>
</subDataset>
<parameter name="libelle" class="java.lang.String"/>
- <parameter name="rang" class="java.lang.String"/>
<parameter name="moyenneMin" class="java.lang.String"/>
<parameter name="moyenneMax" class="java.lang.String"/>
<parameter name="coeff" class="java.lang.String"/>
<parameter name="appreciation" class="java.lang.String"/>
- <parameter name="sousMatieres" class="java.util.List"/>
+ <parameter name="sousMatieres" class="java.util.List" isForPrompting="false"/>
<parameter name="prof" class="java.lang.String"/>
<parameter name="moyenneClasse" class="java.lang.String"/>
<parameter name="moyenneEleve" class="java.lang.String"/>
+ <parameter name="moyennePrec1" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="moyennePrec2" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="rangs" class="java.lang.String"/>
+ <parameter name="nbEleve" class="java.lang.Integer"/>
+ <parameter name="nbNotes" class="java.lang.Integer" isForPrompting="false"/>
+ <parameter name="moyennePrec3" class="java.lang.String" isForPrompting="false"/>
<detail>
<band height="20" splitType="Stretch">
<textField>
- <reportElement style="cellule_non_bordee" x="0" y="0" width="113" height="10"/>
+ <reportElement style="cellule_non_bordee" x="0" y="0" width="91" height="10"/>
<textElement textAlignment="Left">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{libelle}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
- <reportElement style="cellule_non_bordee" x="0" y="10" width="113" height="10"/>
+ <reportElement style="cellule_non_bordee" x="0" y="10" width="91" height="10"/>
<textElement textAlignment="Left">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{prof}]]></textFieldExpression>
</textField>
<rectangle>
- <reportElement stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="0" width="113" height="20"/>
+ <reportElement key="cadreMatiere" stretchType="RelativeToBandHeight" mode="Transparent" x="0" y="0" width="91" height="20"/>
<graphicElement>
<pen lineWidth="0.25"/>
</graphicElement>
</rectangle>
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="169" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="226" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{coeff}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="197" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="280" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{moyenneMin}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="225" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="307" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{moyenneMax}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="113" y="0" width="28" height="20"/>
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" x="172" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{moyenneEleve}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="141" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="199" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{moyenneClasse}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
- <reportElement style="cellule_app" stretchType="RelativeToBandHeight" mode="Opaque" x="253" y="0" width="302" height="20" forecolor="#000000">
+ <reportElement key="appreciation" style="cellule_app" stretchType="RelativeToBandHeight" mode="Opaque" x="361" y="0" width="194" height="20" forecolor="#000000">
<printWhenExpression><![CDATA[($P{sousMatieres}.size()==0)]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Left">
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{appreciation}]]></textFieldExpression>
</textField>
+ <textField isBlankWhenNull="true">
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" mode="Transparent" x="91" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$P{moyennePrec1}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="253" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$P{rangs}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="334" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Integer"><![CDATA[$P{nbNotes}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" mode="Transparent" x="118" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$P{moyennePrec2}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" mode="Transparent" x="145" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8" isBold="false"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$P{moyennePrec3}]]></textFieldExpression>
+ </textField>
</band>
<band height="1" splitType="Stretch">
<printWhenExpression><![CDATA[($P{sousMatieres}.size()>0)]]></printWhenExpression>
<datasetRun subDataset="sousMatieres">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{sousMatieres})]]></dataSourceExpression>
</datasetRun>
- <jr:column width="113">
- <jr:detailCell style="table_TD" height="20" rowSpan="1">
+ <jr:column width="91">
+ <jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="113" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="91" height="20"/>
<textElement>
- <font fontName="Arial" isBold="false" isItalic="true"/>
+ <font fontName="Arial" size="8" isBold="false" isItalic="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{libelle}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
- <jr:column width="28">
+ <jr:column width="27">
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="28" height="20"/>
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
<textElement>
- <font fontName="Arial"/>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyennePrec1}]]></textFieldExpression>
+ </textField>
+ </jr:detailCell>
+ </jr:column>
+ <jr:column width="27">
+ <jr:detailCell height="20" rowSpan="1">
+ <textField isBlankWhenNull="true">
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyennePrec2}]]></textFieldExpression>
+ </textField>
+ </jr:detailCell>
+ </jr:column>
+ <jr:column width="27">
+ <jr:detailCell height="20" rowSpan="1">
+ <textField isBlankWhenNull="true">
+ <reportElement key="" style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyennePrec3}]]></textFieldExpression>
+ </textField>
+ </jr:detailCell>
+ </jr:column>
+ <jr:column width="27">
+ <jr:detailCell style="table_TD" height="20" rowSpan="1">
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneEleve}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
- <jr:column width="28">
+ <jr:column width="27">
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
<textElement>
- <font fontName="Arial"/>
+ <font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneClasse}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
- <jr:column width="28">
+ <jr:column width="27">
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
<textElement>
- <font fontName="Arial"/>
+ <font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{coeff}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
- <jr:column width="28">
+ <jr:column width="27">
<jr:detailCell style="table_TD" height="20" rowSpan="1">
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
<textElement>
- <font fontName="Arial"/>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{rangs}]]></textFieldExpression>
+ </textField>
+ </jr:detailCell>
+ </jr:column>
+ <jr:column width="27">
+ <jr:detailCell height="20" rowSpan="1">
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneMin}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
- <jr:column width="28">
- <jr:detailCell style="table_TD" height="20" rowSpan="1">
+ <jr:column width="27">
+ <jr:detailCell height="20" rowSpan="1">
<textField isBlankWhenNull="true">
- <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="28" height="20"/>
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
<textElement>
- <font fontName="Arial"/>
+ <font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneMax}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
+ <jr:column width="27">
+ <jr:detailCell height="20" rowSpan="1">
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" stretchType="RelativeToBandHeight" x="0" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Integer"><![CDATA[$F{nbNotes}]]></textFieldExpression>
+ </textField>
+ </jr:detailCell>
+ </jr:column>
</jr:table>
</componentElement>
</band>
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Tableau" pageWidth="555" pageHeight="842" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
<property name="ireport.zoom" value="3.0"/>
- <property name="ireport.x" value="0"/>
+ <property name="ireport.x" value="592"/>
<property name="ireport.y" value="0"/>
+ <import value="org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise"/>
<style name="cellule" mode="Opaque" backcolor="#F0F0F0" hAlign="Center" vAlign="Middle" fontName="Arial" fontSize="7">
<box>
<pen lineWidth="0.25"/>
</subDataset>
<parameter name="ligneMatiere" class="java.lang.Object"/>
<parameter name="ligneSousMatiere" class="java.lang.Object"/>
+ <parameter name="options" class="org.lilie.services.eliot.impression.template.bulletin.option.BulletinOptionsPersonnalise" isForPrompting="false"/>
<field name="libelle" class="java.lang.String"/>
- <field name="rang" class="java.lang.String"/>
<field name="moyenneMin" class="java.lang.String"/>
<field name="moyenneMax" class="java.lang.String"/>
<field name="coeff" class="java.lang.String"/>
<field name="appreciation" class="java.lang.String"/>
- <field name="moyenneGeneraleEleve" class="java.lang.String"/>
- <field name="moyenneGeneraleClasse" class="java.lang.String"/>
+ <field name="moyenneEleve" class="java.lang.String"/>
+ <field name="moyenneClasse" class="java.lang.String"/>
<field name="lignesTableau" class="java.util.List"/>
<field name="allNoteTextuelle" class="java.lang.String"/>
<field name="existeNoteTextuelle" class="java.lang.Boolean"/>
+ <field name="nomPeriodePrecedente1" class="java.lang.String"/>
+ <field name="nomPeriodePrecedente2" class="java.lang.String"/>
+ <field name="rangs" class="java.lang.String"/>
+ <field name="nbNotes" class="java.lang.Integer"/>
+ <field name="moyennePrec1" class="java.lang.String"/>
+ <field name="moyennePrec2" class="java.lang.String"/>
+ <field name="nomPeriodePrecedente3" class="java.lang.String"/>
+ <field name="moyennePrec3" class="java.lang.String"/>
<columnHeader>
<band height="21" splitType="Stretch">
<staticText>
- <reportElement style="cellule" x="253" y="1" width="302" height="20"/>
+ <reportElement key="appreciation" style="cellule" x="361" y="1" width="194" height="20"/>
<textElement>
<font fontName="Arial" size="8" isBold="false"/>
</textElement>
<text><![CDATA[Appréciations]]></text>
</staticText>
<staticText>
- <reportElement style="titre" mode="Opaque" x="0" y="11" width="113" height="10" backcolor="#F0F0F0"/>
+ <reportElement key="titreEnseignant" style="titre" mode="Opaque" x="0" y="11" width="91" height="10" backcolor="#F0F0F0"/>
<textElement textAlignment="Left">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Enseignants]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="113" y="1" width="56" height="10"/>
+ <reportElement key="titreMoyennes" style="cellule" mode="Opaque" x="172" y="1" width="54" height="10"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Moyennes]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="113" y="11" width="28" height="10"/>
+ <reportElement key="moyenneEleve" style="cellule" x="172" y="11" width="27" height="10"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Elève]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="141" y="11" width="28" height="10"/>
+ <reportElement key="moyenneClasse" style="cellule" x="199" y="11" width="27" height="10"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Classe]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="169" y="1" width="28" height="20"/>
+ <reportElement key="coeff" style="cellule" x="226" y="1" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Coeff.]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="197" y="1" width="56" height="10"/>
+ <reportElement key="titreMoyenneMin" style="cellule" x="280" y="1" width="54" height="10"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Moyennes]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="197" y="11" width="28" height="10"/>
+ <reportElement key="moyenneMin" style="cellule" x="280" y="11" width="27" height="10"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Min.]]></text>
</staticText>
<staticText>
- <reportElement style="cellule" x="225" y="11" width="28" height="10"/>
+ <reportElement key="moyenneMax" style="cellule" x="307" y="11" width="27" height="10"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Max.]]></text>
</staticText>
<staticText>
- <reportElement style="titre" mode="Opaque" x="0" y="1" width="113" height="10"/>
+ <reportElement key="titreMatiere" style="titre" mode="Opaque" x="0" y="1" width="91" height="10"/>
<textElement textAlignment="Left">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Matières]]></text>
</staticText>
+ <staticText>
+ <reportElement key="titreMoyennePrec" style="cellule" x="91" y="1" width="27" height="10"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <text><![CDATA[Moy.]]></text>
+ </staticText>
+ <staticText>
+ <reportElement key="rangs" style="cellule" x="253" y="1" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <text><![CDATA[Rangs]]></text>
+ </staticText>
+ <staticText>
+ <reportElement key="nbNotes" style="cellule" x="334" y="1" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <text><![CDATA[Nbre
+notes]]></text>
+ </staticText>
+ <textField isBlankWhenNull="true">
+ <reportElement key="moyennePrec1" style="cellule" x="91" y="11" width="27" height="10"/>
+ <textElement>
+ <font size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{nomPeriodePrecedente1}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement key="moyennePrec2" style="cellule" x="118" y="11" width="27" height="10"/>
+ <textElement>
+ <font size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{nomPeriodePrecedente2}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement key="moyennePrec3" style="cellule" x="145" y="11" width="27" height="10"/>
+ <textElement>
+ <font size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{nomPeriodePrecedente3}]]></textFieldExpression>
+ </textField>
</band>
</columnHeader>
<detail>
<subreportParameter name="ligneSousMatiere">
<subreportParameterExpression><![CDATA[$P{ligneSousMatiere}]]></subreportParameterExpression>
</subreportParameter>
- <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{lignesTableau})]]></dataSourceExpression>
+ <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{lignesTableau})
+]]></dataSourceExpression>
<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{ligneMatiere}]]></subreportExpression>
</subreport>
</band>
<band height="21">
+ <printWhenExpression><![CDATA[$P{options}.getMoyenneGenerale()]]></printWhenExpression>
<rectangle>
- <reportElement style="cellule" x="169" y="0" width="28" height="20"/>
- <graphicElement>
- <pen lineWidth="0.25"/>
- </graphicElement>
- </rectangle>
- <rectangle>
- <reportElement style="cellule" x="197" y="0" width="28" height="20"/>
- <graphicElement>
- <pen lineWidth="0.25"/>
- </graphicElement>
- </rectangle>
- <rectangle>
- <reportElement style="cellule" x="225" y="0" width="28" height="20"/>
- <graphicElement>
- <pen lineWidth="0.25"/>
- </graphicElement>
- </rectangle>
- <rectangle>
- <reportElement style="cellule" x="253" y="0" width="302" height="20"/>
+ <reportElement key="appreciation" style="cellule" x="361" y="0" width="194" height="20"/>
<graphicElement>
<pen lineWidth="0.25"/>
</graphicElement>
</rectangle>
<staticText>
- <reportElement style="titre" mode="Opaque" x="0" y="0" width="113" height="20"/>
+ <reportElement style="titre" mode="Opaque" x="0" y="0" width="91" height="20"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Moyenne générale]]></text>
</staticText>
<textField pattern="" isBlankWhenNull="true">
- <reportElement style="cellule" x="113" y="0" width="28" height="20"/>
+ <reportElement key="col231" style="cellule" x="172" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
- <textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneGeneraleEleve}]]></textFieldExpression>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneEleve}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
- <reportElement style="cellule" x="141" y="0" width="28" height="20"/>
+ <reportElement key="col232" style="cellule" x="199" y="0" width="27" height="20"/>
<textElement>
<font fontName="Arial" size="8"/>
</textElement>
- <textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneGeneraleClasse}]]></textFieldExpression>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneClasse}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement x="197" y="0" width="28" height="20"/>
+ <reportElement style="cellule" x="280" y="0" width="27" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneMin}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
- <reportElement x="226" y="0" width="27" height="20"/>
+ <reportElement style="cellule" x="307" y="0" width="27" height="20"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{moyenneMax}]]></textFieldExpression>
</textField>
+ <textField pattern="" isBlankWhenNull="true">
+ <reportElement key="col13" style="cellule" x="91" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyennePrec1}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" x="334" y="0" width="27" height="20"/>
+ <textElement>
+ <font size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.Integer"><![CDATA[$F{nbNotes}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" x="226" y="0" width="27" height="20"/>
+ <textElement>
+ <font size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{coeff}]]></textFieldExpression>
+ </textField>
+ <textField isBlankWhenNull="true">
+ <reportElement style="cellule" x="253" y="0" width="27" height="20"/>
+ <textElement>
+ <font size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{rangs}]]></textFieldExpression>
+ </textField>
+ <textField pattern="" isBlankWhenNull="true">
+ <reportElement key="" style="cellule" x="118" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyennePrec2}]]></textFieldExpression>
+ </textField>
+ <textField pattern="" isBlankWhenNull="true">
+ <reportElement key="" style="cellule" x="145" y="0" width="27" height="20"/>
+ <textElement>
+ <font fontName="Arial" size="8"/>
+ </textElement>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{moyennePrec3}]]></textFieldExpression>
+ </textField>
</band>
<band height="11" splitType="Stretch">
<printWhenExpression><![CDATA[$F{existeNoteTextuelle}]]></printWhenExpression>
zoneLogoEdite : 'zoneLogoEdite',
zoneCachetEdite : 'zoneCachetEdite',
- actionFocusNomTemplate : 'actionFocusNomTemplate'
+ actionFocusNomTemplate : 'actionFocusNomTemplate',
+ actionChangeBulletinComplement: 'actionChangeBulletinComplement'
},
composantId : {
texteNonEditable : 2,
sousModele : 3,
logo : 4,
- cachet : 5
+ cachet : 5,
+ bulletin : 6
}
};
\ No newline at end of file
},
this
);
+
+ listeElementsModeleView.addListener(
+ this.Constantes.eventId.actionChangeBulletinComplement,
+ function(zoneId, typeZone, complement) {
+ this.changeBulletinComplement(zoneId, typeZone, complement);
+ },
+ this
+ );
+
},
/**
this.Constantes.eventId.actionEnvoyerDonneesEditees,
donnees
);
+ },
+
+ changeBulletinComplement: function(zoneId, typeZone, complement) {
+ this.fireEvent(this.Constantes.eventId.actionEnvoyerDonneesEditees,
+ {
+ champ: zoneId,
+ typeZone: typeZone,
+ complement: complement
+ });
}
+
});
var NameSpace = eliot.scolarite.parametrages.modelededocument.creermodifier;
this.Constantes = NameSpace.Constantes;
this.Modele = NameSpace.Modele;
+ this.ConfigServeur = this.Modele;
this.addEvents(
/**
* @params idCombo id de la zone éditée
* @params idItem id de item sélectionné
*/
- this.Constantes.eventId.actionSelectionneSousRapport
+ this.Constantes.eventId.actionSelectionneSousRapport,
+
+ /**
+ * @event actionChangeBulletinComplement
+ * @param zoneId
+ * @param typeZone
+ * @param complement
+ */
+ this.Constantes.eventId.actionChangeBulletinComplement
);
// Création le panel de template
var cachetBox = undefined;
switch (listeElement[i].action) {
+
case this.Constantes.action.memo :
editor = new Ext.Button({
idButton : listeElement[i].id,
};
break;
+ case this.Constantes.action.bulletin :
+ // on construit ici les checkbox pour le paramétrage des options du bulletin
+ // il faut lire listeElement[i].complement pour avoir les données
+ editor = this.creeBulletinEditor(listeElement[i]);
+
+ break;
}
this.templatePanel.add(listeElement[i]);
}
+ },
+
+ creeBulletinEditor: function(element) {
+
+ this.bulletinCheckboxes = {
+ moyenneGenerale: this.creeBulletinCheckbox(element, 'moyenneGenerale'),
+ coefficient: this.creeBulletinCheckbox(element, 'coefficient'),
+ moyennePrecedente: this.creeBulletinCheckbox(element, 'moyennePrecedente'),
+ moyenneMinMax: this.creeBulletinCheckbox(element, 'moyenneMinMax'),
+ nombreNotes: this.creeBulletinCheckbox(element, 'nombreNotes'),
+ rangs: this.creeBulletinCheckbox(element, 'rangs')
+ };
+
+ var editor = new Ext.Panel({
+ layout: 'column',
+ items: [
+ {
+ layout: 'form',
+ labelWidth: '135',
+ width: 140,
+ items: [
+ {
+ xtype: 'label',
+ labelSeparator: '',
+ fieldLabel: element.libelle
+ }
+ ]
+ },
+ {
+ layout: 'form',
+ hideLabels: true,
+ width: 220,
+ items: [
+ this.bulletinCheckboxes.moyenneGenerale,
+ this.bulletinCheckboxes.coefficient,
+ this.bulletinCheckboxes.moyennePrecedente
+ ]
+ },
+ {
+ layout: 'form',
+ hideLabels: true,
+ width: 220,
+ items: [
+ this.bulletinCheckboxes.moyenneMinMax,
+ this.bulletinCheckboxes.nombreNotes,
+ this.bulletinCheckboxes.rangs
+ ]
+ }
+ ]
+ });
+
+ return editor;
+ },
+
+ creeBulletinCheckbox: function(element, name) {
+ return new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight: normal; font-size: 11px;">'
+ + this.ConfigServeur.libelle.bulletinCheckBox[name] + '</span>',
+ checked: element.complement[name],
+ listeners: {
+ check: function () {
+ this.updateBulletinCheckboxValues(element);
+ },
+ scope: this
+ }
+ })
+ },
+
+ updateBulletinCheckboxValues: function(element) {
+
+ var complement = {
+ moyenneGenerale: this.bulletinCheckboxes.moyenneGenerale.checked,
+ coefficient: this.bulletinCheckboxes.coefficient.checked,
+ moyennePrecedente: this.bulletinCheckboxes.moyennePrecedente.checked,
+ moyenneMinMax: this.bulletinCheckboxes.moyenneMinMax.checked,
+ nombreNotes: this.bulletinCheckboxes.nombreNotes.checked,
+ rangs: this.bulletinCheckboxes.rangs.checked
+ };
+
+ this.fireEvent(this.Constantes.eventId.actionChangeBulletinComplement,
+ element.id, element.action, complement);
}
+
});
*/
eliot.scolarite.parametrages.modelededocument.creermodifier.Modele = {
- data : {
- nomTemplate : undefined,
- listeElements : undefined,
- listeSousRapport : undefined,
- listeChampPublipostage : undefined,
- idModeleUtilisateur : undefined
- },
+ data:{
+ nomTemplate:undefined,
+ nomFonte:undefined,
+ listeElements:undefined,
+ listeFontes:undefined,
+ listeSousRapport:undefined,
+ listeChampPublipostage:undefined,
+ idModeleUtilisateur:undefined
+ },
- url : {
- enregistreZonesTemplateJasper : undefined,
- apercu : undefined,
- upLoadLogo : undefined,
- upLoadCachet : undefined,
- loadImage : undefined,
- afficheEdition : undefined,
- supprimeLogo : undefined,
- supprimeCachet : undefined
- },
+ url:{
+ enregistreZonesTemplateJasper:undefined,
+ apercu:undefined,
+ upLoadLogo:undefined,
+ upLoadCachet:undefined,
+ loadImage:undefined,
+ afficheEdition:undefined,
+ supprimeLogo:undefined,
+ supprimeCachet:undefined
+ },
- message : {
- erreurInconnue : undefined,
- enregistrementMaskText : undefined,
- selectionneImage : undefined,
- formatImage : undefined,
- choisirTableau : undefined,
- choisirPulipostage : undefined
- },
+ message:{
+ erreurInconnue:undefined,
+ enregistrementMaskText:undefined,
+ selectionneImage:undefined,
+ formatImage:undefined,
+ choisirTableau:undefined,
+ choisirPulipostage:undefined
+ },
- header : {
- template : undefined
- },
+ header:{
+ template:undefined
+ },
- libelle : {
- enregistrer : undefined,
- annuler : undefined,
- enregisterApercu : undefined,
- nomTemplate : undefined,
- valider : undefined,
- upLoadTextField : undefined,
- upLoadTextFieldCachet : undefined,
- upLoad : undefined,
- changeImage : undefined,
- modifier : undefined,
- premierItem : undefined,
- premierItemTableau : undefined,
- titre : undefined,
- supprimer : undefined
- },
+ libelle:{
+ enregistrer:undefined,
+ annuler:undefined,
+ enregisterApercu:undefined,
+ nomTemplate:undefined,
+ valider:undefined,
+ upLoadTextField:undefined,
+ upLoadTextFieldCachet:undefined,
+ upLoad:undefined,
+ changeImage:undefined,
+ modifier:undefined,
+ premierItem:undefined,
+ premierItemTableau:undefined,
+ titre:undefined,
+ supprimer:undefined,
+ bulletinCheckBox: {
+ moyenneGenerale: undefined,
+ coefficient: undefined,
+ moyennePrecedente: undefined,
+ moyenneMinMax: undefined,
+ nombreNotes: undefined,
+ rangs: undefined
+ }
+ },
- icon : {
- enregistrement : undefined,
- annulation : undefined,
- apercu : undefined,
- modification : undefined
- }
+ icon:{
+ enregistrement:undefined,
+ annulation:undefined,
+ apercu:undefined,
+ modification:undefined
+ }
};
\ No newline at end of file