--- /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
+
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailPlageInfo
+import org.springframework.context.MessageSource
+
+
+class FicheEleveAbsencesJourMarshallerService {
+
+ def messageSource
+
+ Map marshallFicheEleveAbsencesJour(DetailJourInfo detailJourInfo){
+
+ SimpleDateFormat sdfJS = new SimpleDateFormat("dd/MM/yyyy", Locale.FRANCE)
+
+ //Conteneur principal à envoyer au FO
+ Map ficheEleveAbsencesJour = [:]
+
+ //Données dans ficheEleveAbsencesJour
+ List detailDuJourData = []
+
+ //Données dans detailDuJourData
+ // Map detailDuJour = [:]
+
+ Map detailDuJour = detailJourInfo.getInfo(formatJour, toolTipDetail)
+ detailDuJourData << detailDuJour
+ ficheEleveAbsencesJour.put('detailDuJourData',detailDuJourData)
+ ficheEleveAbsencesJour.put('date',sdfJS.format(detailJourInfo.jour))
+ ficheEleveAbsencesJour.put('success',true)
+
+ return ficheEleveAbsencesJour
+ }
+
+ /**
+ * Formatage du jour
+ */
+ private Closure formatJour = {
+ Date jour ->
+// MessageSource messageSource = applicationContext.getBean("messageSource")
+ String result
+ Calendar cal = Calendar.getInstance()
+ cal.setTime(jour)
+ switch (cal.get(Calendar.DAY_OF_WEEK)) {
+ case Calendar.MONDAY:
+ result = messageSource.getMessage('eliot.jour.Lundi', null, null)
+ break
+ case Calendar.TUESDAY:
+ result = messageSource.getMessage('eliot.jour.Mardi', null, null)
+ break
+ case Calendar.WEDNESDAY:
+ result = messageSource.getMessage('eliot.jour.Mercredi', null, null)
+ break
+ case Calendar.THURSDAY:
+ result = messageSource.getMessage('eliot.jour.Jeudi', null, null)
+ break
+ case Calendar.FRIDAY:
+ result = messageSource.getMessage('eliot.jour.Vendredi', null, null)
+ break
+ case Calendar.SATURDAY:
+ result = messageSource.getMessage('eliot.jour.Samedi', null, null)
+ break
+ case Calendar.SUNDAY:
+ result = messageSource.getMessage('eliot.jour.Dimanche', null, null)
+ break
+ }
+ SimpleDateFormat sdf = new SimpleDateFormat(
+ messageSource.getMessage('eliot.format.dateDDMM', null, null),
+ Locale.FRANCE
+ )
+ return result + ' ' + sdf.format(jour)
+ }
+
+ /**
+ * Closure utilisée pour générer la bulle d'aide sur le détail du jour
+ */
+ private toolTipDetail = {
+ DetailPlageInfo detail ->
+ SimpleDateFormat sdf = new SimpleDateFormat(
+ messageSource.getMessage('eliot.format.heureHHMM', null, null),
+ Locale.FRANCE
+ )
+ String result = ''
+ if (detail.motif) {
+ result = messageSource.getMessage('eliot.libelle.motif', null, null) + ' : ' + detail.motif.libelle
+ }
+ if (detail.retard) {
+ if (result) { result += "<br/>"}
+ result += messageSource.getMessage(
+ 'eliot.bilan.detail.retard',
+ [sdf.format(detail.heureArrivee), sdf.format(detail.heureDebutCours)]as Object[],
+ null
+ )
+ }
+ if (detail.depart) {
+ if (result) { result += "<br/>"}
+ result += messageSource.getMessage(
+ 'eliot.bilan.detail.departanticipe',
+ [sdf.format(detail.heureDepart), sdf.format(detail.heureFinCours)] as Object[],
+ null
+ )
+ }
+ return result
+ }
+
+}
\ 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
+
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsences
+import org.lilie.services.eliot.scolarite.personne.eleve.TotauxAbsencesEleve
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesEleve
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesValeur
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreLigneInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreJourInfo
+import org.lilie.services.eliot.scolarite.Periode
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodes
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodesValeur
+import org.lilie.services.eliot.temps.Mois
+import org.lilie.services.eliot.absences.parametrage.general.PasDeDecompteEnum
+
+class FicheEleveAbsencesMarshallerService {
+
+ FicheEleveAbsencesJourMarshallerService ficheEleveAbsencesJourMarshallerService
+ def messageSource
+
+ Map marshallFicheEleveAbsences(FicheEleveAbsences ficheEleveAbsences) {
+
+ Map resultat = [:]
+
+ Map detailAbsencesJour = ficheEleveAbsencesJourMarshallerService.marshallFicheEleveAbsencesJour(
+ ficheEleveAbsences.detailAbsencesJour
+ )
+
+ resultat.put(
+ 'tableauInfo',
+ this.marshallTableauInfo(ficheEleveAbsences.tableauInfo)
+ )
+ resultat.put(
+ 'calendrierData',
+ this.marshallCalendrierData(ficheEleveAbsences.calendrierData)
+ )
+ resultat.put(
+ 'detailDuJourData', detailAbsencesJour.get('detailDuJourData')
+ )
+ resultat.put('plagesHorairesInfo', ficheEleveAbsences.plageHorairesInfo)
+ resultat.put('date', detailAbsencesJour.get('date'))
+ resultat.put('success', detailAbsencesJour.get('success'))
+ resultat.put('moisPosition', ficheEleveAbsences.dateDuJourPositions.mois)
+ resultat.put('jourPosition', ficheEleveAbsences.dateDuJourPositions.jour)
+ resultat.put('tauxAbsenteisme', Double.toString(ficheEleveAbsences.tauxAbsenteisme) + '%')
+
+ return resultat
+ }
+
+ Map marshallTableauInfo(TotauxAbsencesEleve totauxAbsencesEleve) {
+ List dataIndexInfo = marshallDataIndex(totauxAbsencesEleve)
+ return [
+ dataIndex: dataIndexInfo[1],
+ ordres: dataIndexInfo[0],
+ data: [
+ marshallAbsencesJustifiees(
+ totauxAbsencesEleve.mensuelJustifiees,
+ totauxAbsencesEleve.periodeJustifiees
+ ),
+ marshallAbsencesNonJustifiees(
+ totauxAbsencesEleve.mensuelNonJustifiees,
+ totauxAbsencesEleve.periodeNonJustifiees
+ ),
+ marshallAbsencesTotal(
+ totauxAbsencesEleve.mensuelTotal,
+ totauxAbsencesEleve.periodeTotal
+ ),
+ marshallAbsencesNonRecevables(
+ totauxAbsencesEleve.mensuelNonRecevables,
+ totauxAbsencesEleve.periodeNonRecevables
+ ),
+ marshallRetards(
+ totauxAbsencesEleve.mensuelRetards,
+ totauxAbsencesEleve.periodeRetards
+ ),
+ marshallDepartsAnticipes(
+ totauxAbsencesEleve.mensuelDepartAnticipes,
+ totauxAbsencesEleve.periodeDepartAnticipes
+ ),
+ marshallInternats(
+ totauxAbsencesEleve.mensuelInternats,
+ totauxAbsencesEleve.periodeInternats
+ ),
+ marshallDemiPensions(
+ totauxAbsencesEleve.mensuelDemiPensions,
+ totauxAbsencesEleve.periodeDemiPensions
+ )
+ ]
+ ]
+ }
+
+ List marshallDataIndex(TotauxAbsencesEleve totauxAbsencesEleve) {
+ List ordres = ['type']
+ Map result = [type: getPasDeDecompteLibelle(totauxAbsencesEleve.pasDeDecompte)]
+
+ totauxAbsencesEleve.mensuelTotal.tableauStatsMensuelles.valeurs.each {
+ StatsMensuellesValeur statsMensuellesValeur ->
+ ordres.add(statsMensuellesValeur.mois.name())
+ result.put(
+ statsMensuellesValeur.mois.name(),
+ messageSource.getMessage(
+ statsMensuellesValeur.mois.codeMessage,
+ null,
+ null
+ )
+ )
+ }
+
+ totauxAbsencesEleve.periodeTotal.periodes.each {Periode periode ->
+ Mois periodeLastMois = Mois.parseByDate(periode.dateFin)
+ int index = ordres.indexOf(periodeLastMois.name())
+ ordres.add(index + 1, periode.id)
+ result.put(periode.id, periode.typePeriode.libelle)
+ }
+
+ result.put(
+ 'total',
+ messageSource.getMessage('ficheeleve.libelle.total', null, null)
+ )
+ ordres << 'total'
+
+ return [ordres, result]
+ }
+
+ private String getPasDeDecompteLibelle(PasDeDecompteEnum pasDeDecompteEnum) {
+ String pasDeDecompte = ''
+ switch (pasDeDecompteEnum) {
+ case PasDeDecompteEnum.JOUR:
+ pasDeDecompte = messageSource.getMessage('eliot.pasDeDecompte.jour', null, null)
+ break;
+ case PasDeDecompteEnum.DEMI_JOUR:
+ pasDeDecompte = messageSource.getMessage('eliot.pasDeDecompte.demiJour', null, null)
+ break;
+ case PasDeDecompteEnum.HEURE:
+ pasDeDecompte = messageSource.getMessage('eliot.pasDeDecompte.heure', null, null)
+ break;
+ }
+
+ return pasDeDecompte
+ }
+
+ Map marshallInternats(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.internat', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallDemiPensions(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.demipension', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallDepartsAnticipes(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.departsanticipes', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallRetards(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.retards', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallAbsencesNonRecevables(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.nonrecevables', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallAbsencesTotal(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage('ficheeleve.libelle.total', null, null)
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallAbsencesNonJustifiees(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.nonjustifiees', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallAbsencesJustifiees(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [
+ type: messageSource.getMessage(
+ 'ficheeleve.libelle.justifiees', null, null
+ )
+ ]
+ result += marshallValeursMensuelles(statsMensuellesEleve, statsPeriodes)
+ return result
+ }
+
+ Map marshallValeursMensuelles(StatsMensuellesEleve statsMensuellesEleve,
+ StatsPeriodes statsPeriodes) {
+ Map result = [:]
+ statsMensuellesEleve.tableauStatsMensuelles.valeurs.each {
+ StatsMensuellesValeur statsMensuellesValeur ->
+ result.put(statsMensuellesValeur.mois.name(), statsMensuellesValeur.valeurBrute)
+ }
+ statsPeriodes.lignes[0].tableauStatsPeriodes.valeurs.each {
+ StatsPeriodesValeur statsPeriodesValeur ->
+ result.put(statsPeriodesValeur.periode.id, statsPeriodesValeur.valeurBrute)
+ }
+ result.put('total', statsMensuellesEleve.tableauStatsMensuelles.totalLigne)
+ return result
+ }
+
+ List marshallCalendrierData(List<RegistreLigneInfo> calendrierData) {
+ List mois = []
+
+ calendrierData.each() { RegistreLigneInfo registreLigneInfo ->
+ Map moisARecuperer = [:]
+ moisARecuperer.put("mois", registreLigneInfo.mois)
+ registreLigneInfo.jours.each() { RegistreJourInfo registreJourInfo ->
+ Map matinInfos = [:]
+ Map apresMidiInfos = [:]
+ Map jour = [:]
+
+ matinInfos.put("ouvert", registreJourInfo.matin.ouvert)
+ matinInfos.put("couleur", registreJourInfo.matin.couleur)
+ matinInfos.put("sansMotif", registreJourInfo.matin.sansMotif)
+
+ jour.put("matin", matinInfos)
+
+ apresMidiInfos.put("ouvert", registreJourInfo.apresMidi.ouvert)
+ apresMidiInfos.put("couleur", registreJourInfo.apresMidi.couleur)
+ apresMidiInfos.put("sansMotif", registreJourInfo.apresMidi.sansMotif)
+
+ jour.put("apresMidi", apresMidiInfos)
+
+ moisARecuperer.put("jour" + registreJourInfo.numJour, jour)
+ }
+
+ mois << moisARecuperer
+ }
+
+ return mois
+ }
+
+}
\ 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
+
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveSanction
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.temps.DateUtil
+import org.lilie.services.eliot.absences.PartenaireAPrevenirIncident
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.absences.ProtagonisteIncident
+import org.springframework.context.ApplicationContext
+
+
+class FicheEleveSanctionsMarshallerService {
+
+ ApplicationContext applicationContext
+
+ Map marshallFicheEleveSanctions(FicheEleveSanction ficheEleveSanction){
+
+ List allSanction = []
+ List allPunition = []
+ List allIncident = []
+
+ SimpleDateFormat sdfJS = new SimpleDateFormat("MM/dd/yyyy", Locale.FRANCE)
+
+ Object[] argsVide = []
+ Locale locale = Locale.FRANCE
+
+ ficheEleveSanction.sanctions.each{
+ Map sanction = [
+ "date" : sdfJS.format(it.date), //DateUtil.formateDateToJS(it.date),
+ "type" : it.typeSanction.libelle,
+ "responsable" : it.censeur.nomNormalise,
+ "statut" : it.effectue ? 'effectuée' : 'non effectuée'
+ //TODO i18n ->
+// (String) applicationContext.getMessage(
+// 'ficheeleve.libelle.onglet.incidents.effectue',
+// argsVide,
+// locale
+// ) :
+// (String) applicationContext.getMessage(
+// 'ficheeleve.libelle.onglet.incidents.nonEffectue',
+// argsVide,
+// locale
+// )
+ ]
+ allSanction << sanction
+ }
+
+ ficheEleveSanction.punitions.each{
+ Map punition = [
+ "date" : sdfJS.format(it.date),
+ "type" : it.typePunition.libelle,
+ "responsable" : it.censeur.nomNormalise,
+ "statut" : it.effectue ? 'effectuée' : 'non effectuée'
+ //TODO i18n->
+// (String) applicationContext.getMessage(
+// 'ficheeleve.libelle.onglet.incidents.effectue',
+// argsVide,
+// locale
+// ) :
+// (String) applicationContext.getMessage(
+// 'ficheeleve.libelle.onglet.incidents.nonEffectue',
+// argsVide,
+// locale
+// )
+ ]
+ allPunition << punition
+ }
+
+ String allPartenaireAPrevenir = ""
+ String allProtagoniste = ""
+ String virgule = ""
+ ficheEleveSanction.incidents.each{
+ PartenaireAPrevenirIncident.findByIncident(it).each{
+ virgule = allPartenaireAPrevenir.size() == 0 ? '' : ', '
+ allPartenaireAPrevenir += virgule + it.partenaireAPrevenir.libelle
+ }
+
+ ProtagonisteIncident.findByIncident(it).each{
+ virgule = allProtagoniste.size() == 0 ? '' : ', '
+ allProtagoniste += virgule + Personne.findByAutorite(it.autorite).nomAffichage()
+ }
+
+ Map incident = [
+ "dateHeure" : DateUtil.formateDateJourHeure(it.date),
+ "typeIncident" : it.type.libelle,
+ "lieu" : it.lieu.libelle,
+ "gravite" : it.gravite,
+ "partenaires" : allPartenaireAPrevenir,
+ "protagonistes" : allProtagoniste,
+ ]
+ allIncident << incident
+ }
+
+ Map ficheEleveSanctions = [
+ sanctions : allSanction,
+ punitions : allPunition,
+ incidents : allIncident,
+ dateDebutAnneeScolaire : ficheEleveSanction.dateDebutAnneeScolaire,
+ dateFinAnneeScolaire : ficheEleveSanction.dateFinAnneeScolaire,
+ dateDebut : ficheEleveSanction.dateDebut,
+ dateFin : ficheEleveSanction.dateFin
+ ]
+
+ return ficheEleveSanctions
+
+ }
+
+}
\ No newline at end of file
import org.lilie.services.eliot.securite.impl.Autorite
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.exception.SauvegardeEchoueException
+import org.lilie.services.eliot.temps.DateUtil
import org.lilie.services.eliot.droits.EliotDroitsService
import org.lilie.services.eliot.droits.Action
import org.lilie.services.eliot.droits.FonctionsEliot
import org.lilie.services.eliot.notes.resultat.bulletin.BulletinService
import org.lilie.services.eliot.scolarite.Calendrier
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import java.text.SimpleDateFormat
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsences
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveCalendrierMoisPosition
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsencesService
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsencesCalendrierService
class JsonFicheEleveController extends AbstractEliotController {
FicheEleveService ficheEleveService
FicheEleveCommentaireService ficheEleveCommentaireService
+ FicheEleveMarshallerService ficheEleveMarshallerService
EliotDroitsService eliotDroitsService
LocalStructureEnseignementService localStructureEnseignementService
RecapElevePeriodeService recapElevePeriodeService
TypeAvisService typeAvisService
BulletinService bulletinService
CalendrierService calendrierService
- FicheEleveMarshallerService ficheEleveMarshallerService
+ PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
+ FicheEleveAbsencesMarshallerService ficheEleveAbsencesMarshallerService
+ FicheEleveAbsencesJourMarshallerService ficheEleveAbsencesJourMarshallerService
+ FicheEleveAbsencesService ficheEleveAbsencesService
+ FicheEleveAbsencesCalendrierService ficheEleveAbsencesCalendrierService
/**
* Retourne la fiche de l'élève.
try {
verifieDroitsFicheEleve(securiteSession)
- SimpleDateFormat sdfJS = new SimpleDateFormat("MM/dd/yyyy", Locale.FRANCE)
-
- Calendrier calendrier = calendrierService.
- getCalendrierForEtablissement(etablissementCourant())
-
- String debutAnneeScolaire = calendrier.premierJour ? sdfJS.format(calendrier.premierJour) : null
- String finAnneeScolaire = calendrier.dernierJour ? sdfJS.format(calendrier.dernierJour) : null
-
Personne eleve = Personne.get(params?.eleveId.toLong())
FicheEleve ficheEleve = ficheEleveService.construitFicheEleve(
securiteSession,
)
result.ficheEleve = ficheEleveMarshallerService.marshallFicheEleve(ficheEleve)
result.voirOngletCommentaire = getDroitFicheEleveCommentaire(securiteSession)
- //TODO : A envoyer dans le service
- result.donneesOngletSanctions = ficheEleveService.getDonneesOngletSanction(1)
- result.donneesOngletSanctions << ['dateDebutAnneeScolaire' : debutAnneeScolaire]
- result.donneesOngletSanctions << ['dateFinAnneeScolaire' : finAnneeScolaire]
- result.donneesOngletSanctions << ['dateDebut' : debutAnneeScolaire]
- result.donneesOngletSanctions << ['dateFin' : new Date()]
- //TODO : fin
result.donneesNotes = getDonneesSpecifiquesNotes(eleve, ficheEleve.classe)
result[EliotConstantes.JSON_SUCCESS] = true
} catch (AutorisationException ex) {
marchalleTypeAvis(typesAvis)
}
-
/**
* Retourne la fiche de l'élève
* @param eleveId identifiant de l'autorité d'un élève
// la branche fiche eleve - absences
Autorite eleveAutorite = Autorite.get(params?.eleveId.toLong())
Personne eleve = Personne.findByAutorite(eleveAutorite)
- redirect(action:'getFicheEleveByIdPersonne', params: ['eleveId':eleve.id])
+ redirect(action: 'getFicheEleveByIdPersonne', params: ['eleveId': eleve.id])
+ }
+
+ /**
+ * Retourne les sanctions / punitions / incidents
+ * @param eleveId identifiant de l'autorité d'un élève
+ * @author jcok
+ */
+ def getSanctionsByEleveId = {
+
+ Map result = (Map) [:]
+
+ Personne eleve = Personne.get(params.eleveId.toLong())
+
+ Calendrier calendrier = calendrierService.
+ getCalendrierForEtablissement(etablissementCourant())
+ Date dateDuJour = new Date()
+
+ Date dateDebut
+ Date dateFin
+
+ //Si dateDebut et dateFin ne sont pas présent, c'est le premier appel de la page
+ if (!params.dateDebut && !params.dateFin) {
+ dateDebut = calendrier.premierJour
+ dateFin = dateDuJour
+ }
+ else {
+ dateDebut = DateUtil.parseDateJavascript(params.dateDebut)
+ dateFin = DateUtil.parseDateJavascript(params.dateFin)
+ }
+
+ result.donneesOngletSanctions =
+ ficheEleveService.getDonneesOngletSanction(
+ eleve,
+ calendrier,
+ dateDebut,
+ dateFin
+ )
+
+ result.success = true
+
+ render result as JSON
+ }
+
+ /**
+ * Retourne les données d'absences nécessaires pour
+ * l'anglet 'Absences' de la fiche élève
+ */
+ def getEleveAbsences = {
+
+ Calendrier calendrier = calendrierService.
+ getCalendrierForEtablissement(etablissementCourant())
+
+ Personne eleve = Personne.get(params.eleveId.toLong())
+
+ SecuriteSession securiteSession = getSecuriteSession()
+ Etablissement etablissement = securiteSession.etablissementCourant
+
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences =
+ preferencesEtablissementAbsencesService.
+ getPreferencesEtablissementForEtablissement(etablissement)
+
+ FicheEleveAbsences ficheEleveAbsences =
+ ficheEleveService.getFicheEleveAbsencesData(
+ securiteSession,
+ calendrier,
+ eleve,
+ preferencesEtablissementAbsences
+ )
+
+ render ficheEleveAbsencesMarshallerService.
+ marshallFicheEleveAbsences(ficheEleveAbsences) as JSON
+ }
+
+ def getAbsencesDetailDuJour = {
+
+ Calendrier calendrier = calendrierService.
+ getCalendrierForEtablissement(etablissementCourant())
+
+ Personne eleve = Personne.get(params.eleveId.toLong())
+
+ SecuriteSession securiteSession = getSecuriteSession()
+ Etablissement etablissement = securiteSession.etablissementCourant
+
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences =
+ preferencesEtablissementAbsencesService.
+ getPreferencesEtablissementForEtablissement(etablissement)
+
+ List <FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition =
+ ficheEleveAbsencesService.associerPositionEtMois(calendrier)
+
+ DetailJourInfo detailJourInfo =
+ ficheEleveAbsencesCalendrierService.getDetailAbsencesJour(
+ eleve,
+ preferencesEtablissementAbsences,
+ calendrier,
+ params.jourPosition,
+ params.moisPosition,
+ allFicheEleveCalendrierMoisPosition
+ )
+
+ Map resultats = ficheEleveAbsencesJourMarshallerService.
+ marshallFicheEleveAbsencesJour(detailJourInfo)
+
+ render resultats as JSON
}
/**
NoteFormateur noteFormateur =
etablissementCourant().etablissementNotes.getNoteFormateur(
- message(code:'eliot.separateur.decimal.ficheEleve', default: '.')
+ message(code: 'eliot.separateur.decimal.ficheEleve', default: '.')
)
render ficheEleveNotesMarchallerService.
marchalleInfoConseil(result, noteFormateur) as JSON
NoteFormateur noteFormateur =
etablissementCourant().etablissementNotes.getNoteFormateur(
- message(code:'eliot.separateur.decimal.ficheEleve', default: '.')
+ message(code: 'eliot.separateur.decimal.ficheEleve', default: '.')
)
Bulletin bulletin = bulletinService.construisBulletin(
ficheeleve.libelle.annuler=Annuler
ficheeleve.libelle.onglet.identite=Identit\u00e9
ficheeleve.libelle.onglet.commentaires=Commentaires
+ficheeleve.libelle.onglet.absences=Absences
+ficheeleve.libelle.onglet.sanctions=Sanctions
ficheeleve.libelle.bloceleve.titre=El\u00e8ve
ficheeleve.libelle.blocResponsable1.titre=Responsable l\u00e9gal
ficheeleve.libelle.blocResponsable2.titre=Second responsable l\u00e9gal
ficheeleve.libelle.message.erreur=Une erreur est survenue lors de l'enregistrement des commentaires.
ficheeleve.libelle.message.annulation=Les modifications de commentaires ont \u00e9t\u00e9 annul\u00e9es.
ficheeleve.libelle.format.date=d/m/Y
+ficheeleve.libelle.tableau=Tableau
+ficheeleve.libelle.calendrier=Calendrier
+ficheeleve.libelle.detailDu=D\u00e9tail du
+ficheeleve.libelle.onglet.punitions=Punitions
+ficheeleve.libelle.onglet.incidents=Incidents
+ficheeleve.libelle.onglet.sanctions.dateDebut=Date de d\u00e9but
+ficheeleve.libelle.onglet.sanctions.dateFin=Date de fin
+ficheeleve.libelle.onglet.sanctions.date=Date
+ficheeleve.libelle.onglet.sanctions.type=Type
+ficheeleve.libelle.onglet.sanctions.responsable=Responsable
+ficheeleve.libelle.onglet.sanctions.statut=Statut
+ficheeleve.libelle.onglet.sanctions.dateHeure=Date et heure
+ficheeleve.libelle.onglet.sanctions.typeIncident=Type d'incident
+ficheeleve.libelle.onglet.sanctions.lieu=Lieu
+ficheeleve.libelle.onglet.sanctions.gravite=Gravit\u00e9
+ficheeleve.libelle.onglet.sanctions.partenaires=Partenaires pr\u00e9venus
+ficheeleve.libelle.onglet.sanctions.protagonistes=Protagonistes
+ficheeleve.libelle.onglet.sanctions.dateIncorrecte.debFin=La date de fin doit \u00eatre sup\u00e9rieure ou \u00e9gale \u00e0 la date de d\u00e9but.
+ficheeleve.libelle.onglet.sanctions.dateIncorrecte.anneeScolaire=Les dates doivent \u00eatre inclues dans l'ann\u00e9e scolaire en cours.
+ficheeleve.libelle.onglet.sanctions.chercher=Chercher
+ficheeleve.libelle.onglet.incidents.effectue=effectuée
+ficheeleve.libelle.onglet.sanctions.nonEffectue=non effectuée
+ficheeleve.libelle.tauxAbsences=Taux d'absent\u00e9isme
+ficheeleve.libelle.total=Total
+ficheeleve.libelle.internat=Internat
+ficheeleve.libelle.demipension=Demi-pension
+ficheeleve.libelle.departsanticipes=D\u00e9parts anticip\u00e9s
+ficheeleve.libelle.retards=Retards
+ficheeleve.libelle.nonrecevables=Non recevables
+ficheeleve.libelle.nonjustifiees=Non Justifi\u00e9es
+ficheeleve.libelle.justifiees=Justifi\u00e9es
ficheeleve.libelle.ongletConseil=Conseil
ficheeleve.libelle.ongletNote=Notes
etat.libelle.EN_COURS=En cours
etat.libelle.TERMINE=Termin\u00e9
etat.libelle.ERREUR=Erreur
+
+eliot.jour.Lundi=Lundi
+eliot.jour.Mardi=Mardi
+eliot.jour.Mercredi=Mercredi
+eliot.jour.Jeudi=Jeudi
+eliot.jour.Vendredi=Vendredi
+eliot.jour.Samedi=Samedi
+eliot.jour.Dimanche=Dimanche
+
+eliot.format.dateDDMM=dd/MM
+eliot.format.heureHHMM=HH:mm
+eliot.libelle.motif=Motif
+eliot.bilan.detail.departanticipe=D\u00e9part \u00e0 {0} au lieu de {1}
+eliot.bilan.detail.retard=Arriv\u00e9e \u00e0 {0} au lieu de {1}
+
+eliot.pasDeDecompte.jour=(en jours)
+eliot.pasDeDecompte.demiJour=(en demi-journ\u00e9es)
+eliot.pasDeDecompte.heure=(en heures)
class RegistreLigneInfo {
Personne eleve
List<RegistreJourInfo> jours
+ String mois
Map getInfo() {
Map result = [
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.scolarite.Personne
-import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordService
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
import org.lilie.services.eliot.temps.DateUtil
import org.lilie.services.eliot.applications.absences.AbsencesType
-import org.lilie.services.eliot.applications.absences.BilanService
+
import org.lilie.services.eliot.absences.Appel
import org.lilie.services.eliot.absences.AbsenceJournee
import org.lilie.services.eliot.absences.PlageHoraire
class RegistreMensuelService {
LocalStructureEnseignementService localStructureEnseignementService
- TableauDeBordService tableauDeBordService
CalendrierService calendrierService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
MotifService motifService
LocalPersonneService localPersonneService
- BilanService bilanService
PlageHoraireService plageHoraireService
static transactional = true
import org.lilie.services.eliot.absences.statistiques.volumehoraire.VolumesAllStructureEnseignements
import org.lilie.services.eliot.absences.statistiques.volumehoraire.VolumeMensuel
-import org.lilie.services.eliot.absences.statistiques.CalendrierAbsencesService
import org.lilie.services.eliot.absences.statistiques.mensuelle.PeriodeMensuelle
import org.lilie.services.eliot.absences.statistiques.volumehoraire.VolumesUneStructureEnseignement
+import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
/**
* Permet de manipuler des informations d'emploi du temps
LocalStructureEnseignementService localStructureEnseignementService
LocalPersonneService localPersonneService
PlageHoraireService plageHoraireService
- CalendrierAbsencesService calendrierAbsencesService
+ CalendrierService calendrierService
/**
* @param securiteSession
PeriodeMensuelle periodeMensuelle ->
volumeParMois.put(
periodeMensuelle.mois,
- calendrierAbsencesService.countPasDeDecompteOuvertSurPeriode(
+ calendrierService.countPasDeDecompteOuvertSurPeriode(
securiteSession,
periodeMensuelle.dateDebut,
periodeMensuelle.dateFin,
--- /dev/null
+package org.lilie.services.eliot.absences.parametrage.general
+
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.annuaire.SecuriteSession
+
+/**
+ * Gestion des paramétrages généraux d'absences.
+ * Etendu par AbsencesGeneralService.
+ * @author jbui
+ */
+class GeneralService {
+
+ static final Float FACTEUR_LONGUEUR_PLAGE_DEMI_HEURE = 0.5
+
+ static final Byte CODE_LONGUEUR_PLAGE_HEURE = 1
+ static final Byte CODE_LONGUEUR_PLAGE_DEMI_HEURE = 2
+
+
+ /**
+ * Retourne le pas de décompte
+ * @param securiteSesion la session courante
+ * @param preferences les préférences de la session courante
+ * @return pasDeDecompte
+ */
+ PasDeDecompteEnum getPasDeDecompte(SecuriteSession securiteSession,
+ PreferencesEtablissementAbsences preferences
+ ) {
+ return PasDeDecompteEnum.parseByLibelle(
+ preferences.pasDecompte
+ )
+ }
+
+ /**
+ * Retourne le code correspondant au paramètre de longueur de plage
+ * @param preferences
+ * @return 1 pour une heure, 2 pour une demi-heure
+ */
+ Byte getCodeLongueurPlage(preferences) {
+ if (preferences.longueurPlage == FACTEUR_LONGUEUR_PLAGE_DEMI_HEURE) {
+ return CODE_LONGUEUR_PLAGE_DEMI_HEURE
+ } else {
+ return CODE_LONGUEUR_PLAGE_HEURE
+ }
+ }
+
+}
--- /dev/null
+package org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction
+
+import org.lilie.services.eliot.absences.TypeIncident
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.springframework.dao.DataIntegrityViolationException
+import org.lilie.services.eliot.GormUtils
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.LibelleLongException
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.CreationContraintException
+
+/**
+ * Gestion des types d'incidents.
+ * Etendu par AbsencesTypeIncidentService.
+ * @author jbui
+ */
+class TypeIncidentService {
+
+ def messageSource
+
+ public final static String ELEMENT = "type d'incident"
+
+/**
+ * Récupère les types d'incidents
+ * Si aucun types d'incidents n'est crées, il crée les types par défauts
+ * @param pref
+ * @return typeIncidents : la liste des types d'incidents
+ */
+ List<TypeIncident> getTypesIncident(PreferencesEtablissementAbsences pref) {
+
+ List<TypeIncident> typesIncident = TypeIncident.withCriteria {
+ eq('preferencesEtablissement.id', pref.id)
+ order "libelle", "asc"
+ }
+ if (typesIncident.size() == 0) {
+ typesIncident = creeTypesIncidentParDefaut(pref)
+ }
+
+ return typesIncident
+ }
+
+ private List<TypeIncident> creeTypesIncidentParDefaut(PreferencesEtablissementAbsences pref) {
+
+ List<TypeIncident> typeIncidents = []
+ for (DefaultsTypeIncident typeEnum: DefaultsTypeIncident.values()) {
+ typeIncidents.add(getTypeIncident(pref,
+ messageSource.getMessage(typeEnum.libelle, null, null))
+ )
+
+ }
+
+ // Classement
+ typeIncidents.sort {it.libelle}
+
+ return typeIncidents
+ }
+
+ private TypeIncident getTypeIncident(PreferencesEtablissementAbsences pref,
+ String libelle) {
+
+ TypeIncident type = TypeIncident.
+ findByLibelleAndPreferencesEtablissement(libelle, pref)
+ if(type != null) {
+ return type
+ }
+
+ Closure action = {
+ return internalCreeTypeIncident(pref, libelle)
+ }
+
+ Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
+ return TypeIncident.findByLibelleAndPreferencesEtablissement(libelle, pref)
+ }
+
+ return GormUtils.withSavepoint(action, onDataIntegrityViolation)
+ }
+
+ /**
+ * Permet de créer un type d'incident
+ * @param pref : la préfénerence de l'établissement
+ * @param libelle : le libellé du type d'incident
+ * @return type : type d'incident
+ * @throws org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.LibelleLongException
+ * @throws org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.CreationContraintException
+ */
+ protected TypeIncident internalCreeTypeIncident(PreferencesEtablissementAbsences pref,
+ String libelle
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ TypeIncident type = new TypeIncident(
+ preferencesEtablissement: pref,
+ libelle: libelle
+ )
+
+ save(type)
+
+ return type
+ }
+
+ /**
+ * vérifie les propriétés du type
+ * - le nombre de caractères mpax
+ * - l'unicité
+ * @param type
+ * @param libelle
+ * @throws LibelleLongException
+ * @throws CreationContraintException
+ */
+ void save(TypeIncident type)
+ throws LibelleLongException,
+ CreationContraintException {
+
+ // Validation du nombre de caractères [max 30]
+ if (!type.validate(["libelle"])) {
+ // Lève une exception
+ throw new LibelleLongException(ELEMENT, type.libelle)
+ }
+
+ // Validation de la contrainte d'intégrité portée
+ // sur le libellé et la préférence de l'établissement
+ try {
+ type.save(flush: true)
+ }
+ catch (DataIntegrityViolationException e) {
+ throw new CreationContraintException(ELEMENT, type.libelle, e)
+ }
+ }
+}
--- /dev/null
+package org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction
+
+import org.lilie.services.eliot.absences.TypePunition
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.LibelleLongException
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.CreationContraintException
+import org.springframework.dao.DataIntegrityViolationException
+import org.lilie.services.eliot.GormUtils
+
+/**
+ * Gestion des types de punitions.
+ * Etendu par AbsencesTypePunitionService.
+ * @author jbui
+ */
+class TypePunitionService {
+ public final static String ELEMENT = "type de punition"
+ def messageSource
+
+/**
+ * Récupère les types de punition
+ * Si aucun types de punition n'est crées, il crée les types par défauts
+ * @param pref
+ * @return typePunition : la liste des types de punition
+ */
+ List<TypePunition> getTypesPunition(PreferencesEtablissementAbsences pref)
+ throws LibelleLongException,
+ CreationContraintException {
+
+ List<TypePunition> typesPunition = TypePunition.withCriteria {
+ eq('preferencesEtablissement.id', pref.id)
+ order "libelle", "asc"
+ }
+ if (typesPunition.size() == 0) {
+ typesPunition = creeTypesPunitionParDefaut(pref)
+ }
+
+ return typesPunition
+ }
+
+ private List<TypePunition> creeTypesPunitionParDefaut(
+ PreferencesEtablissementAbsences pref
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ List<TypePunition> typesPunition = []
+ for (DefaultsTypePunition typeEnum: DefaultsTypePunition.values()) {
+ typesPunition.add(getTypePunition(pref,
+ messageSource.getMessage(typeEnum.libelle, null, null))
+ )
+ }
+ // Classement
+ typesPunition.sort {it.libelle}
+
+ return typesPunition
+ }
+
+ private TypePunition getTypePunition(PreferencesEtablissementAbsences pref,
+ String libelle
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ TypePunition type = TypePunition.
+ findByLibelleAndPreferencesEtablissement(libelle, pref)
+ if(type != null) {
+ return type
+ }
+
+ Closure action = {
+ return internalCreeTypePunition(pref, libelle)
+ }
+
+ Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
+ return TypePunition.findByLibelleAndPreferencesEtablissement(libelle, pref)
+ }
+
+ return GormUtils.withSavepoint(action, onDataIntegrityViolation)
+ }
+
+ protected TypePunition internalCreeTypePunition(PreferencesEtablissementAbsences pref,
+ String libelle
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ TypePunition type = new TypePunition(
+ preferencesEtablissement: pref,
+ libelle: libelle
+ )
+
+ save(type)
+
+ return type
+ }
+
+/**
+ * vérifie les propriétés du type
+ * - le nombre de caractères mpax
+ * - l'unicité
+ * @param type
+ * @param libelle
+ * @throws LibelleLongException
+ * @throws CreationContraintException
+ */
+ void save(TypePunition type)
+ throws LibelleLongException,
+ CreationContraintException {
+
+ // Validation du nombre de caractères [max 30]
+ if (!type.validate(["libelle"])) {
+ // Lève une exception
+ throw new LibelleLongException(ELEMENT, type.libelle)
+ }
+
+ // Validation de la contrainte d'intégrité portée
+ // sur le libellé et la préférence de l'établissement
+ try {
+ type.save(flush: true)
+ }
+ catch (DataIntegrityViolationException e) {
+ throw new CreationContraintException(ELEMENT, type.libelle, e)
+ }
+
+ }
+
+
+}
--- /dev/null
+package org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction
+
+import org.lilie.services.eliot.absences.TypeSanction
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.LibelleLongException
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.CreationContraintException
+import org.springframework.dao.DataIntegrityViolationException
+import org.lilie.services.eliot.GormUtils
+
+/**
+ * Gestion des types de sanctions.
+ * Etendue par AbsencesTypeSanctionService.
+ * @author jbui
+ */
+class TypeSanctionService {
+
+ def messageSource
+
+ public final static String ELEMENT = "type de sanction"
+
+/**
+ * Récupère les types de sanctions
+ * Si aucun types de sanction n'est crées, il crée les types par défauts
+ * @param pref
+ * @return TypesSanction : la liste des types de sanction
+ */
+ List<TypeSanction> getTypesSanction(PreferencesEtablissementAbsences pref)
+ throws LibelleLongException,
+ CreationContraintException {
+
+ List<TypeSanction> typesSanction = TypeSanction.withCriteria {
+ eq('preferencesEtablissement.id', pref.id)
+ order "libelle", "asc"
+ }
+ if (typesSanction.size() == 0) {
+ typesSanction = creeTypesSanctionParDefaut(pref)
+ }
+
+ return typesSanction
+ }
+
+ private List<TypeSanction> creeTypesSanctionParDefaut(
+ PreferencesEtablissementAbsences pref
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ List<TypeSanction> typesSanction = []
+ for (DefaultsTypeSanction typeEnum: DefaultsTypeSanction.values()) {
+ typesSanction.add(getTypeSanction(pref,
+ messageSource.getMessage(typeEnum.libelle, null, null))
+ )
+ }
+
+ // Classement
+ typesSanction.sort {it.libelle}
+
+ return typesSanction
+ }
+
+ private TypeSanction getTypeSanction(PreferencesEtablissementAbsences pref,
+ String libelle
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ TypeSanction type = TypeSanction.
+ findByLibelleAndPreferencesEtablissement(libelle, pref)
+ if(type != null) {
+ return type
+ }
+
+ Closure action = {
+ return internalCreeTypeSanction(pref, libelle)
+ }
+
+ Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
+ return TypeSanction.findByLibelleAndPreferencesEtablissement(libelle, pref)
+ }
+
+ return GormUtils.withSavepoint(action, onDataIntegrityViolation)
+ }
+
+ protected TypeSanction internalCreeTypeSanction(PreferencesEtablissementAbsences pref,
+ String libelle
+ ) throws LibelleLongException,
+ CreationContraintException {
+
+ TypeSanction type = new TypeSanction(
+ preferencesEtablissement: pref,
+ libelle: libelle
+ )
+
+ save(type)
+
+ return type
+ }
+
+ /**
+ * vérifie les propriétés du type
+ * - le nombre de caractères mpax
+ * - l'unicité
+ * @param type
+ * @param libelle
+ * @throws LibelleLongException
+ * @throws CreationContraintException
+ */
+ void save(TypeSanction type)
+ throws LibelleLongException,
+ CreationContraintException {
+
+ // Validation du nombre de caractères [max 30]
+ if (!type.validate(["libelle"])) {
+ // Lève une exception
+ throw new LibelleLongException(ELEMENT, type.libelle)
+ }
+
+ // Validation de la contrainte d'intégrité portée
+ // sur le libellé et la préférence de l'établissement
+ try {
+ type.save(flush: true)
+ }
+ catch (DataIntegrityViolationException e) {
+ throw new CreationContraintException(ELEMENT, type.libelle, e)
+ }
+ }
+
+}
* <http://www.cecill.info/licences.fr.html>.
*/
-package org.lilie.services.eliot.absences.statistiques.mensuelle
+package org.lilie.services.eliot.absences.statistiques.commons
/**
* Définit le niveau de détail désiré pour les stats mensuelles
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.commons
+
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.Personne
+
+/**
+ * Interface implémentée par des classes de statistiques croisant des listes
+ * d'élèves et des périodes temporelles
+ */
+public interface StatsAbsencesParPeriode {
+
+ /**
+ * Ajoute un incrément à la valeur correspondant à l'élève et à la période
+ * @param structureEnseignement
+ * @param eleve
+ * @param date
+ * @param valeur
+ */
+ void incrementeValeur(
+ StructureEnseignement structureEnseignement,
+ Personne eleve,
+ Date date,
+ Double valeur
+ )
+}
\ No newline at end of file
import org.lilie.services.eliot.scolarite.structureenseignement.EffectifsClasseGroupe
import org.lilie.services.eliot.absences.statistiques.Type
+import org.lilie.services.eliot.absences.statistiques.commons.StatsAbsencesParPeriode
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
+
/**
* Représente le résultat d'une requête de stats mensuelles par classe
* @author jbui
*/
-class StatsMensuelles {
+class StatsMensuelles implements StatsAbsencesParPeriode {
List<Mois> mois = []
NiveauDetail niveauDetail
List<StatsMensuellesEleve> statsEleves = []
List<StatsMensuellesNiveau> statsNiveau = []
+ @Override
+ void incrementeValeur(
+ StructureEnseignement structureEnseignement,
+ Personne eleve,
+ Date date,
+ Double valeur
+ ) {
+ Calendar cal = Calendar.getInstance()
+ cal.setTime(date)
+ StatsMensuellesLigne statLigne = getLigne(structureEnseignement, eleve)
+ Mois mois = Mois.parseByNumero(cal.get(Calendar.MONTH) + 1)
+
+ if (statLigne) {
+ //Récupération ou création de la valeur
+ StatsMensuellesValeur statValeur = statLigne.tableauStatsMensuelles.
+ findOrCreateStatValeur(mois)
+ statValeur.valeurBrute += valeur
+ }
+ }
+
/**
* Retourne l'objet StatsMensuellesStructure correspondant à la structure
* d'enseignement dont l'id est passé en paramètre.
return statStruct
}
+ /**
+ * Retourne la bonne ligne de statistiques selon les paramètres
+ * @param struct
+ * @param personne
+ * @return une StatsMensuellesLigne
+ */
+ StatsMensuellesLigne getLigne(StructureEnseignement structureEnseignement,
+ Personne eleve) {
+ StatsMensuellesLigne statLigne
+ switch (niveauDetail) {
+ case NiveauDetail.STRUCTURE_ENSEIGNEMENT:
+ //Récupération des stats de la structure
+ statLigne = findStatsStructure(
+ structureEnseignement
+ )
+ break
+ case NiveauDetail.ELEVE:
+ //Récupération des stats de l'élève
+ statLigne = findStatsEleve(eleve)
+ break
+ case NiveauDetail.NIVEAU:
+ //Récupération des stats du niveau
+ statLigne = findStatsNiveau(structureEnseignement.niveauGeneral)
+ }
+ return statLigne
+ }
+
/**
* Retourne l'objet StatsMensuellesEleve correspondant à l'élève
* dont l'id est passé en paramètre.
* @param eleveId : id de l'élève
* @return une StatsMensuellesEleve
*/
- StatsMensuellesEleve findStatsEleve(
- Personne eleve,
- StructureEnseignement structureEnseignement) {
+ StatsMensuellesEleve findStatsEleve(Personne eleve) {
StatsMensuellesEleve statEleve = (StatsMensuellesEleve) this.
statsEleves.find {
}
}
if (typeStats in [Type.INCIDENTS, Type.PUNITIONS, Type.SANCTIONS]) {
- if(totalValeurBrutes){
+ if (totalValeurBrutes) {
return 100
} else {
return 0
import org.lilie.services.eliot.absences.statistiques.StatsParams
import org.lilie.services.eliot.absences.statistiques.Type
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
/**
* DTO représentant les critères de sélection pour les stats mensuelles
import org.lilie.services.eliot.temps.DateUtil
import org.lilie.services.eliot.absences.Sanction
import org.lilie.services.eliot.absences.Incident
-import org.lilie.services.eliot.absences.consultation.AbstractConsultationService
-import org.lilie.services.eliot.absences.Appel
+
import org.lilie.services.eliot.scolarite.Personne
-import org.lilie.services.eliot.absences.AbsenceJournee
-import org.lilie.services.eliot.absences.PlageHoraire
+
import org.lilie.services.eliot.annuaire.FonctionEnum
import org.lilie.services.eliot.applications.absences.BilanAbsencesParPersonneInfo
-import org.lilie.services.eliot.applications.absences.BilanAbsenceInfo
-import java.text.SimpleDateFormat
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeIncidentService
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.absences.ScolariteService
import org.lilie.services.eliot.absences.emploidutemps.EmploiDuTempsService
import org.lilie.services.eliot.scolarite.NiveauGeneral
import org.lilie.services.eliot.absences.statistiques.Type
import org.lilie.services.eliot.absences.statistiques.volumehoraire.VolumesAllStructureEnseignements
import org.lilie.services.eliot.scolarite.structureenseignement.EffectifsClasseGroupe
+import org.lilie.services.eliot.applications.absences.BilanService
+import org.lilie.services.eliot.absences.statistiques.commons.StatsAbsencesParPeriode
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
-class StatsMensuellesService extends AbstractConsultationService {
+class StatsMensuellesService extends BilanService {
TypePunitionService typePunitionService
TypeIncidentService typeIncidentService
CalendrierService calendrierService
TypeSanctionService typeSanctionService
LocalStructureEnseignementService localStructureEnseignementService
- ScolariteService scolariteService
EmploiDuTempsService emploiDuTempsService
final static String VALEUR_TOUS = '-1'
switch (statsMensuellesParams.niveauDetail) {
case NiveauDetail.ELEVE:
//Pour les incidents, punitions, sanction, on ne fait pas le détail par élève
- if(statsMensuellesParams.type in [Type.INCIDENTS, Type.PUNITIONS, Type.SANCTIONS]){
+ if (statsMensuellesParams.type in [Type.INCIDENTS, Type.PUNITIONS, Type.SANCTIONS]) {
result = initialiseLignesStructures(statsMensuelles, statsMensuellesParams)
} else {
result = initialiseLignesEleves(statsMensuelles, statsMensuellesParams)
* @param criteres : les critères de sélection
* @param stats : les stats à compléter
*/
- private void calculeStatsMensuellesAbsences(StatsMensuellesParams criteres,
- StatsMensuelles stats,
- PreferencesEtablissementAbsences pref
+ private StatsAbsencesParPeriode calculeStatsMensuellesAbsences(
+ StatsMensuellesParams criteres,
+ StatsAbsencesParPeriode stats,
+ PreferencesEtablissementAbsences pref
) {
+
BilanAbsencesParPersonneInfo absencesDatas = findAbsencesDatas(criteres)
- calculeCountAbsences(
+ return calculeCountAbsences(
absencesDatas,
pref,
stats,
)
}
- private void calculeCountAbsences(BilanAbsencesParPersonneInfo absencesDatas,
- PreferencesEtablissementAbsences pref,
- StatsMensuelles stats,
- NiveauDetail niveauDetail) {
- List<PlageHoraire> plages = plageHoraireService.getPlageHoraires(pref)
- switch (pref.pasDecompte) {
- case PreferencesEtablissementAbsences.DECOMPTE_HEURE:
- calculeCountAbsencesHeure(absencesDatas, pref, plages, stats, niveauDetail)
- break
- case PreferencesEtablissementAbsences.DECOMPTE_DEMIJOUR:
- calculeCountAbsencesDemiJour(absencesDatas, pref, stats, niveauDetail)
- break
- case PreferencesEtablissementAbsences.DECOMPTE_JOUR:
- calculeCountAbsencesJour(absencesDatas, stats, niveauDetail)
- break
- }
- }
-
- /**
- * Calcule le nombre d'absences en heures
- * @param absencesDatas : les données d'absences
- * contient une liste de tableaux contenant chacun
- * - l'Appel
- * - l'AppelLigne
- * - la StructureEnseignement
- * - la Personne élève
- * - l'absenceJournee
- * @param pref : les préférences établissement
- * @param stats : les stats à compléter
- */
- private void calculeCountAbsencesHeure(BilanAbsencesParPersonneInfo absencesDatas,
- PreferencesEtablissementAbsences pref,
- List<PlageHoraire> plages,
- StatsMensuelles stats,
- NiveauDetail niveauDetail) {
- Set<Long> appelIds = absencesDatas.appels*.id
- Map nbPlagesParAppel = findPlagesCountForAllAppels(appelIds.toList())
-
- Calendar cal = Calendar.getInstance()
-
- absencesDatas.eachAbsence {
- Personne personne, BilanAbsenceInfo info ->
- Appel appel = info.appelLigne.appel
- AppelLigne appelLigne = info.appelLigne
- AbsenceJournee absenceJournee = info.absenceJournee
- StructureEnseignement struct = info.structureEnseignement
- Mois mois
- Integer nbPlages
-
- cal.clear()
-
- if (appel) {
- cal.setTime(appel.dateHeureDebut)
- mois = Mois.parseByNumero(cal.get(Calendar.MONTH) + 1)
- nbPlages = (Integer) nbPlagesParAppel[appel.id]
- } else {
- cal.setTime(absenceJournee.date)
- nbPlages = calculeNbPlagesForAppelLigne(plages, appelLigne)
- mois = Mois.parseByNumero(cal.get(Calendar.MONTH) + 1)
- }
-
- StatsMensuellesLigne statLigne = getLigneStat(
- struct,
- personne,
- stats,
- niveauDetail
- )
-
- if (statLigne) {
- //Récupération ou création de la valeur
- StatsMensuellesValeur statValeur = statLigne.tableauStatsMensuelles.
- findOrCreateStatValeur(mois)
-
- //Incrémentation de la valeur
- statValeur.valeurBrute += (nbPlages * pref.longueurPlage)
- }
- }
- }
-
- /**
- * Retourne la bonne ligne de statistiques selon les données en cours et
- * le niveau de détail demandé
- * @param struct
- * @param personne
- * @param stats
- * @param niveauDetail
- * @return une StatsMensuellesLigne
- */
- private StatsMensuellesLigne getLigneStat(
- StructureEnseignement structureEnseignement,
- Personne personne,
- StatsMensuelles stats,
- NiveauDetail niveauDetail) {
-
- StatsMensuellesLigne statLigne
- switch (niveauDetail) {
- case NiveauDetail.STRUCTURE_ENSEIGNEMENT:
- //Récupération des stats de la structure
- statLigne = stats.findStatsStructure(
- structureEnseignement
- )
- break
- case NiveauDetail.ELEVE:
- //Récupération des stats de l'élève
- statLigne = stats.findStatsEleve(
- personne,
- structureEnseignement
- )
- break
- case NiveauDetail.NIVEAU:
- //Récupération des stats du niveau
- statLigne = stats.findStatsNiveau(structureEnseignement.niveauGeneral)
- }
- return statLigne
- }
-
- /**
- * Calcule le nombre d'absences en demi-journées
- * @param absencesDatas : les données d'absences
- * contient une liste de tableaux contenant chacun
- * - l'Appel
- * - l'AppelLigne
- * - la StructureEnseignement
- * - la Personne élève
- * @param pref : les préférences établissement
- * @param stats : les stats à compléter
- */
- private void calculeCountAbsencesDemiJour(BilanAbsencesParPersonneInfo absencesDatas,
- PreferencesEtablissementAbsences pref,
- StatsMensuelles stats,
- NiveauDetail niveauDetail) {
- Set<Appel> appels = absencesDatas.appels
- Map demiJoursParAppel = findAllDemiJoursForAllAppels(appels*.id)
- List<PlageHoraire> plages = plageHoraireService.getPlageHoraires(pref)
-
- Long lastEleveId = null
- Date lastJour = null
- Byte lastDemiJour = null
- Long currentEleveId = null
- Date currentJour = null
- Byte currentDemiJour = null
- Calendar cal = Calendar.getInstance()
-
- absencesDatas.eachAbsence {
- Personne personne, BilanAbsenceInfo info ->
- Appel appel = info.appelLigne.appel
- AppelLigne appelLigne = info.appelLigne
- StructureEnseignement struct = info.structureEnseignement
- Personne eleve = personne
-
- Byte demiJours
- Byte nbDemiJours
- if (appel) {
- demiJours = (Byte) demiJoursParAppel[appel.id]
- nbDemiJours = 1
- if (demiJours == MATIN_ET_APRES_MIDI) {
- nbDemiJours = 2
- }
- cal.setTime(appel.dateHeureDebut)
- } else {
- nbDemiJours = getNbDemiJoursForAppelLigne(appelLigne, plages)
- demiJours = getLastDemiJourForAppelLigne(appelLigne, plages)
- cal.setTime(appelLigne.absenceJournee.date)
- }
-
- currentEleveId = eleve.id
- DateUtil.setDebutJour(cal)
- currentJour = cal.getTime()
- currentDemiJour = demiJours
- if (currentDemiJour == MATIN_ET_APRES_MIDI) {
- currentDemiJour = APRES_MIDI
- } else {
- if (currentDemiJour == AUCUN) {
- throw new IllegalStateException(
- "L'appel ne porte ni sur le matin, ni sur l'après-midi."
- )
- }
- }
-
- if (currentEleveId != lastEleveId ||
- currentJour != lastJour ||
- currentDemiJour != lastDemiJour) {
-
- StatsMensuellesLigne statsLigne = getLigneStat(
- struct,
- eleve,
- stats,
- niveauDetail
- )
-
- if (statsLigne) {
- StatsMensuellesValeur statValeur = statsLigne.tableauStatsMensuelles.
- findOrCreateStatValeur(
- Mois.parseByNumero(cal.get(Calendar.MONTH) + 1)
- )
-
-
- statValeur.valeurBrute += getIncrementValeur(
- nbDemiJours,
- lastDemiJour,
- currentJour,
- lastJour
- )
- }
- }
- lastEleveId = currentEleveId
- lastJour = currentJour
- lastDemiJour = currentDemiJour
- cal.clear()
- }
- }
-
- private Double getIncrementValeur(Byte nbDemiJours,
- Byte lastDemiJour,
- Date currentJour,
- Date lastJour) {
- /**
- * Pour une absence qui s'étale sur 2 1/2 journées (matin et après-midi),
- * on vérifie que l'absence précédente ne date pas du matin même,
- * auquel cas, la nouvelle absence ne compte que pour l'après-midi
- */
- if (nbDemiJours == 2) {
- if (currentJour == lastJour && lastDemiJour == MATIN) {
- return 1
- } else {
- return 2
- }
- } else {
- return nbDemiJours
- }
- }
-
- /**
- * Calcule le nombre d'absences en journées
- * @param absencesDatas : les données d'absences
- * contient une liste de tableaux contenant chacun
- * - l'Appel
- * - l'AppelLigne
- * - la StructureEnseignement
- * - la Personne élève
- * @param stats : les stats à compléter
- */
- private void calculeCountAbsencesJour(BilanAbsencesParPersonneInfo absencesDatas,
- StatsMensuelles stats,
- NiveauDetail niveauDetail) {
- Long lastEleveId = null
- Date lastJour = null
- Long currentEleveId = null
- Date currentJour = null
- Calendar cal = Calendar.getInstance()
-
- absencesDatas.eachAbsence {
- Personne eleve, BilanAbsenceInfo info ->
- Appel appel = info.appelLigne.appel
- AppelLigne appelLigne = info.appelLigne
- StructureEnseignement struct = info.structureEnseignement
- currentEleveId = eleve.id
-
- if (appel) {
- cal.setTime(appel.dateHeureDebut)
- } else {
- cal.setTime(appelLigne.absenceJournee.date)
- }
- DateUtil.setDebutJour(cal)
- currentJour = cal.getTime()
-
- if (currentEleveId != lastEleveId ||
- currentJour != lastJour) {
- StatsMensuellesLigne statsLigne = getLigneStat(
- struct,
- eleve,
- stats,
- niveauDetail
- )
- if (statsLigne) {
- StatsMensuellesValeur statsValeur = statsLigne.tableauStatsMensuelles.
- findOrCreateStatValeur(
- Mois.parseByNumero(cal.get(Calendar.MONTH) + 1)
- )
- statsValeur.valeurBrute += 1
- }
- }
- lastEleveId = currentEleveId
- lastJour = currentJour
- cal.clear()
- }
- }
-
/**
* Calcule les statistiques concernant les différents disciplines
* (punitions, sanctions et inscidents)
if (criteres.niveauDetail == NiveauDetail.ELEVE) {
eleve = (Personne) resultatCalcul[2]
}
- StatsMensuellesLigne ligne = getLigneStat(
+
+ stats.incrementeValeur(
structureEnseignement,
eleve,
- stats,
- criteres.niveauDetail
+ periodeMensuelle.dateDebut,
+ (Double) resultatCalcul[0]
)
- if (ligne) {
- ligne.tableauStatsMensuelles.
- findOrCreateStatValeur(mois).valeurBrute += resultatCalcul[0]
- }
}
}
}
return result
}
- StatsMensuellesFiltresContenu getStatsMensuellesFiltresContenu(
- SecuriteSession securiteSession,
- PreferencesEtablissementAbsences preferencesEtablissementAbsences,
- String dataClasse,
- SimpleDateFormat sdf,
- Locale locale
- ) {
-
- return new StatsMensuellesFiltresContenu(
- calendrier: calendrierService.getCalendrierForEtablissement(
- preferencesEtablissementAbsences.etablissement
- ),
- classes: localStructureEnseignementService.findAllClasseByEtablissement(
- preferencesEtablissementAbsences.etablissement
- ),
- eleves: scolariteService.findAllPersonneEleveForStructure(securiteSession, dataClasse),
- groupeMotifs: preferencesEtablissementAbsences.groupeMotifs.toList(),
- typeSanctions: typeSanctionService.getTypesSanction(
- preferencesEtablissementAbsences
- ),
- typeIncidents: typeIncidentService.getTypesIncident(
- preferencesEtablissementAbsences
- ),
- typePunitions: typePunitionService.getTypesPunition(
- preferencesEtablissementAbsences
- )
- )
- }
}
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.periode
+
+import org.lilie.services.eliot.absences.statistiques.commons.StatsAbsencesParPeriode
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.Periode
+
+/**
+ * Created with IntelliJ IDEA.
+ * User: jeff
+ * Date: 23/04/13
+ * Time: 15:37
+ * To change this template use File | Settings | File Templates.
+ */
+class StatsPeriodes implements StatsAbsencesParPeriode {
+
+ List<StatsPeriodesLigne> lignes = []
+ List<Periode> periodes
+
+ @Override
+ void incrementeValeur(StructureEnseignement structureEnseignement,
+ Personne eleve,
+ Date date,
+ Double valeur) {
+ StatsPeriodesLigne ligne = lignes.find {
+ StatsPeriodesLigne statsPeriodesLigne ->
+ statsPeriodesLigne.personne.id == eleve.id
+ }
+
+ Periode periode = getPeriode(date)
+ if(periode){
+ StatsPeriodesValeur statValeur = ligne.tableauStatsPeriodes.findOrCreateStatValeur(periode)
+ statValeur.valeurBrute += valeur
+ }
+ }
+
+ /**
+ * @param date
+ * @return la Periode correspondant à la date
+ */
+ private Periode getPeriode(Date date){
+ periodes.find {
+ Periode periode ->
+ (date >= periode.dateDebut) && (date <= periode.dateFin)
+ }
+ }
+}
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.periode
+
+import org.lilie.services.eliot.scolarite.Personne
+
+/**
+ * Représente une ligne de stats par période
+ * @author jbui
+ */
+class StatsPeriodesLigne {
+ Personne personne
+ TableauStatsPeriodes tableauStatsPeriodes
+
+ StatsPeriodesLigne(Personne personne){
+ this.personne = personne
+ this.tableauStatsPeriodes = new TableauStatsPeriodes()
+ }
+}
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.periode
+
+import org.lilie.services.eliot.applications.absences.BilanService
+import org.lilie.services.eliot.absences.statistiques.commons.StatsAbsencesParPeriode
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.applications.absences.BilanAbsencesParPersonneInfo
+import org.lilie.services.eliot.applications.absences.BasicCriteresRecherche
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
+
+/**
+ * Calcule les stats par période
+ * @author jbui
+ */
+class StatsPeriodesService extends BilanService {
+
+ StatsAbsencesParPeriode calculeStatsPeriodesAbsences(
+ BasicCriteresRecherche criteres,
+ StatsAbsencesParPeriode stats,
+ PreferencesEtablissementAbsences pref
+ ) {
+
+ BilanAbsencesParPersonneInfo absencesDatas = findAbsencesDatas(criteres)
+
+ return calculeCountAbsences(
+ absencesDatas,
+ pref,
+ stats,
+ NiveauDetail.ELEVE
+ )
+ }
+
+}
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.periode
+
+import org.lilie.services.eliot.scolarite.Periode
+
+/**
+ * Statistiques d'absences pour une période
+ */
+class StatsPeriodesValeur {
+ Periode periode
+ Double valeurBrute = 0.0
+}
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.periode
+
+import org.lilie.services.eliot.scolarite.Periode
+
+/**
+ * Gère la liste des stats d'absences par période
+ */
+class TableauStatsPeriodes {
+ List<StatsPeriodesValeur> valeurs = []
+
+ StatsPeriodesValeur findOrCreateStatValeur(Periode periode){
+ StatsPeriodesValeur result = valeurs.find{
+ StatsPeriodesValeur statsPeriodeValeur ->
+ statsPeriodeValeur.periode.id == periode.id
+ }
+ if(!result){
+ result = new StatsPeriodesValeur()
+ result.periode = periode
+ valeurs << result
+ }
+ return result
+ }
+}
* @param tableauDeBord
* @return une List<AbsenceInfo>
*/
- private List<AbsenceInfo> findAbsenceInfos(TableauDeBordParams criteres,
- TableauDeBord tableauDeBord,
- TypeAbsencesACompterEnum typeAbsences
+ List<AbsenceInfo> findAbsenceInfos(
+ TableauDeBordParams criteres,
+ TableauDeBord tableauDeBord,
+ TypeAbsencesACompterEnum typeAbsences
) {
List<AbsenceInfo> absencesDatas
if (criteres.hasSeuil()) {
}
if (
- typeAbsence == TypeAbsencesACompterEnum.ABSENCE_AVEC_MOTIF ||
- typeAbsence == TypeAbsencesACompterEnum.ABSENCE_SANS_MOTIF ||
- typeAbsence == TypeAbsencesACompterEnum.ABSENCE_NON_VALABLE ||
- typeAbsence == TypeAbsencesACompterEnum.ABSENCE_TOUTES
+ typeAbsence == TypeAbsencesACompterEnum.ABSENCE_AVEC_MOTIF ||
+ typeAbsence == TypeAbsencesACompterEnum.ABSENCE_SANS_MOTIF ||
+ typeAbsence == TypeAbsencesACompterEnum.ABSENCE_NON_VALABLE ||
+ typeAbsence == TypeAbsencesACompterEnum.ABSENCE_TOUTES
) {
hql += """
and al.departAnticipe = false
* @return
*/
private TableauDeBordLigne findTableauDeBordLigne(
- TableauDeBord tableauDeBord, Long idEleve) {
+ TableauDeBord tableauDeBord, Long idEleve) {
TableauDeBordLigne tdbLigne =
- (TableauDeBordLigne) tableauDeBord.lignes.find {
- TableauDeBordLigne ligne ->
+ (TableauDeBordLigne) tableauDeBord.lignes.find {
+ TableauDeBordLigne ligne ->
- ligne.autoriteEleveId == idEleve
- }
+ ligne.autoriteEleveId == idEleve
+ }
return tdbLigne
}
package org.lilie.services.eliot.applications.absences
-import org.lilie.services.eliot.securite.impl.Autorite
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
import org.lilie.services.eliot.absences.AppelLigne
import org.lilie.services.eliot.absences.AbsenceJournee
import org.lilie.services.eliot.absences.Motif
+import org.lilie.services.eliot.securite.Autorite
+import org.lilie.services.eliot.absences.statistiques.commons.StatsAbsencesParPeriode
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
class BilanService {
return elevesRetard
}
+/**
+ * Contruit et exécute la requête de sélection des lignes d'appel
+ * @param criteres : les critères de sélection
+ * @return une liste dont chaque élément contient pour chaque absence
+ * - l'Appel
+ * - l'AppelLigne
+ * - la StructureEnseignement
+ * - la Personne élève
+ * - l'absenceJournee
+ */
+ BilanAbsencesParPersonneInfo findAbsencesDatas(BasicCriteresRecherche criteres) {
+ if ((criteres.structIds.size() > 0) || (criteres.eleveIds)) {
+ if (criteres.eleveIds.contains((Long)-1)) {
+ List<Autorite> autoriteEleves = localStructureEnseignementService.
+ findAllAutoritesElevesForAllStructures(
+ (Set<StructureEnseignement>) criteres.structIds.
+ collect {StructureEnseignement.get(it)}
+ )
+ criteres.eleveIds = autoriteEleves*.id
+ }
+ return getAbsencesOrRetards(criteres)
+ } else {
+ return new BilanAbsencesParPersonneInfo()
+ }
+ }
+
+ protected StatsAbsencesParPeriode calculeCountAbsences(
+ BilanAbsencesParPersonneInfo absencesDatas,
+ PreferencesEtablissementAbsences pref,
+ StatsAbsencesParPeriode stats,
+ NiveauDetail niveauDetail) {
+
+ List<PlageHoraire> plages = plageHoraireService.getPlageHoraires(pref)
+ switch (pref.pasDecompte) {
+ case PreferencesEtablissementAbsences.DECOMPTE_HEURE:
+ return calculeCountAbsencesHeure(
+ absencesDatas,
+ pref,
+ plages,
+ stats,
+ niveauDetail
+ )
+ break
+ case PreferencesEtablissementAbsences.DECOMPTE_DEMIJOUR:
+ return calculeCountAbsencesDemiJour(
+ absencesDatas,
+ pref,
+ stats,
+ niveauDetail
+ )
+ break
+ case PreferencesEtablissementAbsences.DECOMPTE_JOUR:
+ return calculeCountAbsencesJour(absencesDatas, stats, niveauDetail)
+ }
+ }
+
+ /**
+ * Calcule le nombre d'absences en heures
+ * @param absencesDatas : les données d'absences
+ * contient une liste de tableaux contenant chacun
+ * - l'Appel
+ * - l'AppelLigne
+ * - la StructureEnseignement
+ * - la Personne élève
+ * - l'absenceJournee
+ * @param pref : les préférences établissement
+ * @param stats : les stats à compléter
+ */
+ private StatsAbsencesParPeriode calculeCountAbsencesHeure(BilanAbsencesParPersonneInfo absencesDatas,
+ PreferencesEtablissementAbsences pref,
+ List<PlageHoraire> plages,
+ StatsAbsencesParPeriode stats,
+ NiveauDetail niveauDetail) {
+ Set<Long> appelIds = absencesDatas.appels*.id
+ Map nbPlagesParAppel = findPlagesCountForAllAppels(appelIds.toList())
+
+ Calendar cal = Calendar.getInstance()
+
+ absencesDatas.eachAbsence {
+ Personne personne, BilanAbsenceInfo info ->
+ Appel appel = info.appelLigne.appel
+ AppelLigne appelLigne = info.appelLigne
+ AbsenceJournee absenceJournee = info.absenceJournee
+ StructureEnseignement struct = info.structureEnseignement
+ Integer nbPlages
+ Date dateAbsence
+
+ cal.clear()
+
+ if (appel) {
+ dateAbsence = appel.dateHeureDebut
+ nbPlages = (Integer) nbPlagesParAppel[appel.id]
+ } else {
+ dateAbsence = absenceJournee.date
+ nbPlages = calculeNbPlagesForAppelLigne(plages, appelLigne)
+ }
+
+ Double valeur = (nbPlages * pref.longueurPlage)
+
+ stats.incrementeValeur(struct, personne, dateAbsence, valeur)
+ }
+ return stats
+ }
+
+ /**
+ * Calcule le nombre d'absences en demi-journées
+ * @param absencesDatas : les données d'absences
+ * contient une liste de tableaux contenant chacun
+ * - l'Appel
+ * - l'AppelLigne
+ * - la StructureEnseignement
+ * - la Personne élève
+ * @param pref : les préférences établissement
+ * @param stats : les stats à compléter
+ */
+ private StatsAbsencesParPeriode calculeCountAbsencesDemiJour(
+ BilanAbsencesParPersonneInfo absencesDatas,
+ PreferencesEtablissementAbsences pref,
+ StatsAbsencesParPeriode stats,
+ NiveauDetail niveauDetail) {
+
+ Set<Appel> appels = absencesDatas.appels
+ Map demiJoursParAppel = findAllDemiJoursForAllAppels(appels*.id)
+ List<PlageHoraire> plages = plageHoraireService.getPlageHoraires(pref)
+
+ Long lastEleveId = null
+ Date lastJour = null
+ Byte lastDemiJour = null
+ Long currentEleveId = null
+ Date currentJour = null
+ Byte currentDemiJour = null
+ Calendar cal = Calendar.getInstance()
+
+ absencesDatas.eachAbsence {
+ Personne personne, BilanAbsenceInfo info ->
+ Appel appel = info.appelLigne.appel
+ AppelLigne appelLigne = info.appelLigne
+ StructureEnseignement struct = info.structureEnseignement
+ Personne eleve = personne
+ Date dateAbsence
+
+ Byte demiJours
+ Byte nbDemiJours
+ if (appel) {
+ demiJours = (Byte) demiJoursParAppel[appel.id]
+ nbDemiJours = 1
+ if (demiJours == org.lilie.services.eliot.applications.absences.BilanService.MATIN_ET_APRES_MIDI) {
+ nbDemiJours = 2
+ }
+ dateAbsence = appel.dateHeureDebut
+ cal.setTime(appel.dateHeureDebut)
+ } else {
+ nbDemiJours = getNbDemiJoursForAppelLigne(appelLigne, plages)
+ demiJours = getLastDemiJourForAppelLigne(appelLigne, plages)
+ cal.setTime(appelLigne.absenceJournee.date)
+ dateAbsence = appelLigne.absenceJournee.date
+ }
+
+ currentEleveId = eleve.id
+ DateUtil.setDebutJour(cal)
+ currentJour = cal.getTime()
+ currentDemiJour = demiJours
+ if (currentDemiJour == BilanService.MATIN_ET_APRES_MIDI) {
+ currentDemiJour = BilanService.APRES_MIDI
+ } else {
+ if (currentDemiJour == BilanService.AUCUN) {
+ throw new IllegalStateException(
+ "L'appel ne porte ni sur le matin, ni sur l'après-midi."
+ )
+ }
+ }
+
+ if (currentEleveId != lastEleveId ||
+ currentJour != lastJour ||
+ currentDemiJour != lastDemiJour) {
+
+ Double valeur = getIncrementValeur(
+ nbDemiJours,
+ lastDemiJour,
+ currentJour,
+ lastJour
+ )
+
+ stats.incrementeValeur(struct, eleve, dateAbsence, valeur)
+ }
+ lastEleveId = currentEleveId
+ lastJour = currentJour
+ lastDemiJour = currentDemiJour
+ cal.clear()
+ }
+ return stats
+ }
+
+ private Double getIncrementValeur(Byte nbDemiJours,
+ Byte lastDemiJour,
+ Date currentJour,
+ Date lastJour) {
+ /**
+ * Pour une absence qui s'étale sur 2 1/2 journées (matin et après-midi),
+ * on vérifie que l'absence précédente ne date pas du matin même,
+ * auquel cas, la nouvelle absence ne compte que pour l'après-midi
+ */
+ if (nbDemiJours == 2) {
+ if (currentJour == lastJour && lastDemiJour == org.lilie.services.eliot.applications.absences.BilanService.MATIN) {
+ return 1
+ } else {
+ return 2
+ }
+ } else {
+ return nbDemiJours
+ }
+ }
+
+ /**
+ * Calcule le nombre d'absences en journées
+ * @param absencesDatas : les données d'absences
+ * contient une liste de tableaux contenant chacun
+ * - l'Appel
+ * - l'AppelLigne
+ * - la StructureEnseignement
+ * - la Personne élève
+ * @param stats : les stats à compléter
+ */
+ private StatsAbsencesParPeriode calculeCountAbsencesJour(
+ BilanAbsencesParPersonneInfo absencesDatas,
+ StatsAbsencesParPeriode stats,
+ NiveauDetail niveauDetail) {
+
+ Long lastEleveId = null
+ Date lastJour = null
+ Long currentEleveId = null
+ Date currentJour = null
+ Calendar cal = Calendar.getInstance()
+ Date dateAbsence
+
+ absencesDatas.eachAbsence {
+ Personne eleve, BilanAbsenceInfo info ->
+ Appel appel = info.appelLigne.appel
+ AppelLigne appelLigne = info.appelLigne
+ StructureEnseignement struct = info.structureEnseignement
+ currentEleveId = eleve.id
+
+ if (appel) {
+ cal.setTime(appel.dateHeureDebut)
+ } else {
+ cal.setTime(appelLigne.absenceJournee.date)
+ }
+ DateUtil.setDebutJour(cal)
+ currentJour = cal.getTime()
+
+ if (currentEleveId != lastEleveId ||
+ currentJour != lastJour) {
+ Double valeur = 1
+ stats.incrementeValeur(struct, eleve, cal.getTime(), valeur)
+ }
+ lastEleveId = currentEleveId
+ lastJour = currentJour
+ cal.clear()
+ }
+ return stats
+ }
+
}
--- /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
+import org.lilie.services.eliot.absences.Incident
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.securite.impl.Autorite
+import org.lilie.services.eliot.absences.ProtagonisteIncident
+
+class IncidentService {
+
+ /**
+ * @param criteres
+ * @return une liste d'incidents correspondant aux critères
+ */
+ List<Incident> findIncidentsForCriteres(DisciplineCriteresRecherche criteres) {
+ if (!criteres.elevePersonneIds) {
+ return []
+ }
+
+ List<Long> autoriteIds = criteres.elevePersonneIds.collect{
+ Personne.get(it).autoriteId
+ }
+
+ String hql = """
+ from ProtagonisteIncident as prot
+ inner join fetch prot.incident as incident
+ where prot.autorite.id in (:autoriteIds)
+ and incident.date >= :dateDebut
+ and incident.date <= :dateFin
+ """
+
+ List <ProtagonisteIncident> allProtagonisteIncident = ProtagonisteIncident.executeQuery(
+ hql,
+ [
+ dateDebut: criteres.dateDebut,
+ dateFin: criteres.dateFin,
+ autoriteIds: autoriteIds
+ ]
+ )
+
+ return allProtagonisteIncident*.incident
+ }
+
+
+
+
+}
* @return une liste de punitions correspondant aux critères
*/
List<Punition> findPunitionsForCriteres(DisciplineCriteresRecherche criteres) {
- if (criteres.elevePersonneIds) {
+ if (!criteres.elevePersonneIds) {
return []
}
String hql = """
* @return une liste de sanctions correspondant aux critères
*/
List<Sanction> findSanctionsForCriteres(DisciplineCriteresRecherche criteres) {
- if (criteres.elevePersonneIds) {
+ if (!criteres.elevePersonneIds) {
return []
}
String hql = """
import org.lilie.services.eliot.scolarite.Service
import org.lilie.services.eliot.scolarite.ServiceService
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
-import org.lilie.services.eliot.notes.exception.PeriodeNonPublieException
+//import org.lilie.services.eliot.notes.exception.PeriodeNonPublieException
import org.lilie.services.eliot.notes.NotesDroitService
import org.lilie.services.eliot.droits.Action
import org.lilie.services.eliot.applications.absences.BilanService
Personne eleve,
Periode periode,
Boolean seulementNotesEleve = false)
- throws PeriodeNonPublieException, AutorisationException {
+ throws AutorisationException {
notesDroitService.verifieAutorisationByEleve(
securiteSession,
(List) NotesFonction.ENSEIGNANT_ASSIMILE + NotesFonction.DIRECTION_ASSIMILE,
classe.etablissement.id
) && !periode.bulletinsPublies) {
- throw new PeriodeNonPublieException(
- periode,
- (Autorite) securiteSession.defaultAutorite
- )
+// throw new PeriodeNonPublieException(
+// periode,
+// (Autorite) securiteSession.defaultAutorite
+// )
}
}
import org.lilie.services.eliot.scolarite.AnneeScolaire
import groovy.time.TimeCategory
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
+import org.lilie.services.eliot.absences.statistiques.ListeJoursAEvaluer
+import org.lilie.services.eliot.absences.statistiques.JourAEvaluer
+import org.lilie.services.eliot.absences.parametrage.general.GeneralService
+import org.lilie.services.eliot.absences.parametrage.general.PasDeDecompteEnum
class CalendrierService {
PlageHoraireService plageHoraireService
SessionFactory sessionFactory
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
+ GeneralService generalService
/**
* Retourne la liste des jours fériés en fonction de la préférence établissement
Date dateFin
) {
List<JourFerieInfo> result = []
- List<Evenement> listeEvts = evenementCalendrierService.getListeEvenementsForPreferencesEtablissementAndDates(
- pref,
- dateDebut,
- dateFin
- )
+ List<Evenement> listeEvts = evenementCalendrierService.
+ getListeEvenementsForPreferencesEtablissementAndDates(
+ pref,
+ dateDebut,
+ dateFin
+ )
List<PlageHoraire> plageHoraires = PlageHoraire.
findAllByPreferencesEtablissement(pref)
Calendar cal = Calendar.getInstance()
return moisInfos
}
+ /**
+ * Compte les pas de decompte ouvert et non feriés) sur la période
+ * @param securiteSession
+ * @param dateDebut
+ * @param dateFin
+ * @return nbPasDeDecompteOuvert
+ */
+ Float countPasDeDecompteOuvertSurPeriode(SecuriteSession securiteSession,
+ Date dateDebut,
+ Date dateFin,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences
+ ) {
+
+ ListeJoursAEvaluer listeJoursAEvaluer = findJoursAEvaluerSurPeriode(
+ securiteSession,
+ dateDebut,
+ dateFin,
+ preferencesEtablissementAbsences
+ )
+
+ List<JourFerieInfo> allJourFerieInfo =
+ getJourFeriesInfoForPreferenceEtablissementAndDates(
+ preferencesEtablissementAbsences,
+ dateDebut,
+ dateFin
+ )
+
+ allJourFerieInfo.each { JourFerieInfo jourFerieInfo ->
+ JourAEvaluer jourAEvaluer = listeJoursAEvaluer.getJourAEvaluer(jourFerieInfo.date)
+ if(!jourFerieInfo.etat.isOuvertMatin()){
+ jourAEvaluer.nbPasDeDecompteMatin = 0
+ }
+ if(!jourFerieInfo.etat.isOuvertApresMidi()){
+ jourAEvaluer.nbPasDeDecompteApresMidi = 0
+ }
+ }
+
+ return listeJoursAEvaluer.countPasDeDecompte(
+ preferencesEtablissementAbsences.pasDecompte
+ )
+ }
+
+ /**
+ * Retourne tous les jours à évaluer sur la période
+ * (avec leur nombre de pas de decompte matin et aprem)
+ * @param securiteSession
+ * @param dateDebut
+ * @param dateFin
+ * @param preferencesEtablissementAbsences
+ * @return listeJourAEvaluer
+ */
+ ListeJoursAEvaluer findJoursAEvaluerSurPeriode(
+ SecuriteSession securiteSession,
+ Date dateDebut,
+ Date dateFin,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences
+ ) {
+
+ String nomDuJour
+ ListeJoursAEvaluer listeJoursAEvaluer = new ListeJoursAEvaluer()
+
+ PasDeDecompteEnum pasDeDecompte = generalService.getPasDeDecompte(
+ securiteSession,
+ preferencesEtablissementAbsences
+ )
+ Byte longueurPlage = generalService.getCodeLongueurPlage(
+ preferencesEtablissementAbsences
+ ) // 2: Demiheure 1: heure
+
+ CalendrierHebdoInfo calendrierHebdoInfo = getCalendrierHebdoInfo(preferencesEtablissementAbsences)
+
+ for (date in dateDebut..dateFin) {
+
+ nomDuJour = getNomDuJour(date)
+ Float nbPasDeDecompteMatin
+ Float nbPasDeDecompteApresMidi
+
+ List<PlageHoraireInfo> plagesHorairesOuvertes = getPlagesHorairesOuvertesJour(
+ nomDuJour,
+ calendrierHebdoInfo
+ )
+
+ nbPasDeDecompteMatin = calculeNbPasDeDecompteOuverts(
+ pasDeDecompte,
+ longueurPlage,
+ plagesHorairesOuvertes,
+ true
+ )
+ nbPasDeDecompteApresMidi = calculeNbPasDeDecompteOuverts(
+ pasDeDecompte,
+ longueurPlage,
+ plagesHorairesOuvertes,
+ false
+ )
+
+ listeJoursAEvaluer.addJourAEvaluer(
+ date,
+ nbPasDeDecompteMatin,
+ nbPasDeDecompteApresMidi
+ )
+
+ }
+
+ return listeJoursAEvaluer
+ }
+
+ /**
+ * Retourne un nombre de pas de decompte ouvert suivant le pas de decompte,
+ * la longueur plage, et pour le matin ou l'après-midi,
+ * ceci pour des plages horaires données
+ * @param pasDeDecompte
+ * @param longueurPlage
+ * @param plagesHorairesOuvertes
+ * @param matin
+ * @return nbPasDeDecompteOuvert
+ */
+ private float calculeNbPasDeDecompteOuverts(
+ PasDeDecompteEnum pasDeDecompte,
+ byte longueurPlage,
+ List<PlageHoraireInfo> plagesHorairesOuvertes,
+ Boolean matin
+ ) {
+ Float nbPasDeDecompteOuvert = 0
+ switch (pasDeDecompte) {
+ case PasDeDecompteEnum.HEURE:
+
+ switch (longueurPlage) {
+ case GeneralService.CODE_LONGUEUR_PLAGE_DEMI_HEURE:
+ nbPasDeDecompteOuvert = (Float) plagesHorairesOuvertes.findAll{
+ it.matin == matin
+ }.size() / 2
+ break
+ case GeneralService.CODE_LONGUEUR_PLAGE_HEURE:
+ nbPasDeDecompteOuvert = plagesHorairesOuvertes.findAll{
+ it.matin == matin
+ }.size()
+ break
+ }
+ break
+ case PasDeDecompteEnum.DEMI_JOUR:
+
+ Boolean matinOuvert = false
+ Boolean apremOuvert = false
+
+ plagesHorairesOuvertes.each {
+ if (it.matin) {
+ matinOuvert = true
+ }
+ if (!it.matin) {
+ apremOuvert = true
+ }
+ }
+
+ if (matinOuvert && matin) {
+ nbPasDeDecompteOuvert += 1
+ }
+ if (apremOuvert && !matin) {
+ nbPasDeDecompteOuvert += 1
+ }
+
+ break
+ case PasDeDecompteEnum.JOUR:
+ if (plagesHorairesOuvertes.size() > 0) {
+ nbPasDeDecompteOuvert = 1
+ }
+ break
+ }
+ return nbPasDeDecompteOuvert
+ }
+
+ /**
+ * Retourne le nom du jour pour une PlageHoraireInfo
+ * en fonction du jour de la semaine
+ * @param date
+ * @return nomDuJour
+ */
+ private String getNomDuJour(Date date) {
+ String nomDuJour = ''
+
+ switch (date[Calendar.DAY_OF_WEEK]) {
+ case 1:
+ nomDuJour = 'jour7'
+ break
+ case 2:
+ nomDuJour = 'jour1'
+ break
+ case 3:
+ nomDuJour = 'jour2'
+ break
+ case 4:
+ nomDuJour = 'jour3'
+ break
+ case 5:
+ nomDuJour = 'jour4'
+ break
+ case 6:
+ nomDuJour = 'jour5'
+ break
+ case 7:
+ nomDuJour = 'jour6'
+ break
+ }
+
+ return nomDuJour
+ }
+
+ /**
+ * Retourne la liste des plagesHorairesInfo qui sont ouvertes (0)
+ * pour un jour donné
+ * @param nomDuJour
+ * @param preferencesEtablissementAbsences
+ * @param calendrierHebdoInfo
+ * @return plagesHorairesOuvertes
+ */
+ private List<PlageHoraireInfo> getPlagesHorairesOuvertesJour(
+ String nomDuJour,
+ CalendrierHebdoInfo calendrierHebdoInfo
+ ) {
+ List<PlageHoraireInfo> plagesHorairesOuvertes =
+ calendrierHebdoInfo.plageHoraires.findAll {it.getAt(nomDuJour) == 0}
+
+ return plagesHorairesOuvertes
+ }
+
}
\ No newline at end of file
String dateDebut
String dateFin
Boolean matin = false
-
+
Byte jour1 = 0
Byte jour2 = 0
Byte jour3 = 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.scolarite.personne.eleve
+
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+
+class FicheEleveAbsences {
+
+ TotauxAbsencesEleve tableauInfo
+ List calendrierData
+ DetailJourInfo detailAbsencesJour
+ Map plageHorairesInfo
+ Map dateDuJourPositions
+ Double tauxAbsenteisme
+
+}
\ 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.scolarite.personne.eleve
+
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreLigneInfo
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.Calendrier
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelDataCollector
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelCurseurCellule
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreJourInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreDemiJourInfo
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordParams
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.AbsenceInfo
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TypeAbsencesACompterEnum
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelService
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordAbsencesService
+import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
+import org.lilie.services.eliot.parametrages.calendrier.PlageHoraireService
+import org.lilie.services.eliot.parametrages.motifs.MotifService
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourCommand
+import org.lilie.services.eliot.applications.absences.AbsencesType
+
+class FicheEleveAbsencesCalendrierService {
+
+ static transactional = true
+
+ RegistreMensuelService registreMensuelService
+ TableauDeBordAbsencesService tableauDeBordAbsencesService
+ CalendrierService calendrierService
+ PlageHoraireService plageHoraireService
+ MotifService motifService
+
+ /**
+ * Récupère les données du calendrier
+ * @param calendrier
+ * @result moisPositions
+ */
+ List <RegistreLigneInfo> getCalendrierData(
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences,
+ Personne eleve,
+ Calendrier calendrier,
+ List <FicheEleveCalendrierMoisPosition> allficheEleveCalendrierMoisPosition
+ ){
+
+ List <RegistreLigneInfo> allRegistreLigneInfo = []
+
+ RegistreMensuelDataCollector dataCollector = getDataCollectorForEleveAndPeriode(
+ eleve,
+ preferencesEtablissementAbsences,
+ calendrier
+ )
+
+ RegistreMensuelCurseurCellule curseurCellule = new RegistreMensuelCurseurCellule()
+
+ curseurCellule.eleve=eleve
+
+ allficheEleveCalendrierMoisPosition.each{
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPosition ->
+ curseurCellule.numMois = ficheEleveCalendrierMoisPosition.mois + 1
+ curseurCellule.numAnnee = ficheEleveCalendrierMoisPosition.annee
+
+ List<RegistreJourInfo> jours = []
+
+ (1..31).each{
+ int numJour ->
+ curseurCellule.numJour = numJour
+
+ curseurCellule.matin = true
+ RegistreDemiJourInfo infoMatin = registreMensuelService.getInfoDemiJour(
+ curseurCellule,
+ dataCollector
+ )
+
+ curseurCellule.matin = false
+ RegistreDemiJourInfo infoApresMidi = registreMensuelService.getInfoDemiJour(
+ curseurCellule,
+ dataCollector
+ )
+
+ jours.add(new RegistreJourInfo(
+ numJour: numJour,
+ matin: infoMatin,
+ apresMidi: infoApresMidi
+ ))
+
+ }
+
+ RegistreLigneInfo ligne = new RegistreLigneInfo(
+ mois: getMoisString(ficheEleveCalendrierMoisPosition.mois),
+ jours: jours
+ )
+ allRegistreLigneInfo.add(ligne)
+
+ }
+
+ return allRegistreLigneInfo
+// return ficheEleveAbsencesCalendrierMarshallerService.
+// marshallFicheEleveAbsencesCalendrier(allRegistreLigneInfo)
+
+ }
+
+ /**
+ * Crée un objet collectant toutes les données nécessaires aux calculs.
+ * @param eleves : liste des élèves
+ * @param pref : PreferenceEtablisement de l'étab
+ * @param calendrier
+ * @return RegistreMensuelDataCollector
+ */
+ private RegistreMensuelDataCollector getDataCollectorForEleveAndPeriode(
+ Personne eleve,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences,
+ Calendrier calendrier
+ ) {
+
+ TableauDeBordParams tableauDeBordParams = new TableauDeBordParams(
+ dateDebut: calendrier.premierJour,
+ dateFin: calendrier.dernierJour
+ )
+
+ List<AbsenceInfo> allAbsenceInfo =
+ tableauDeBordAbsencesService.findAbsenceDatasForElevesAndPeriode(
+ [eleve.autorite.id],
+ tableauDeBordParams,
+ TypeAbsencesACompterEnum.ABSENCE_DEPART_RETARD
+ )
+
+ return new RegistreMensuelDataCollector(
+ absenceDatas: allAbsenceInfo,
+ jourFerieInfos: calendrierService.
+ getJourFeriesInfoForPreferenceEtablissementAndDates(
+ preferencesEtablissementAbsences,
+ calendrier.premierJour,
+ calendrier.dernierJour
+ ),
+ plageHoraires: plageHoraireService.getPlageHoraires(preferencesEtablissementAbsences),
+ calendrierInfo: calendrierService.getHeuresEtDatesEtab(preferencesEtablissementAbsences),
+ motifSansMotif: motifService.getMotifSansMotif(preferencesEtablissementAbsences)
+ )
+ }
+
+ /**
+ * Récupère le détail des absences pour une journée et pour un élève
+ * @param eleve
+ * @result mapDetailAbsencesJourEleve
+ */
+ DetailJourInfo getDetailAbsencesJour(
+ Personne eleve,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences,
+ Calendrier calendrier,
+ String jourPosition,
+ String moisPosition
+ ){
+
+ List <FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition =
+ associerPositionEtMois(calendrier)
+
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPositionAUtiliser =
+ new FicheEleveCalendrierMoisPosition()
+
+ allFicheEleveCalendrierMoisPosition.each{
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPosition ->
+ if(ficheEleveCalendrierMoisPosition.position == moisPosition.toInteger()){
+ ficheEleveCalendrierMoisPositionAUtiliser = ficheEleveCalendrierMoisPosition
+ }
+ }
+
+ int annee = ficheEleveCalendrierMoisPositionAUtiliser.annee.toInteger()
+ int mois = ficheEleveCalendrierMoisPositionAUtiliser.mois.toInteger()
+ int jour = jourPosition.toInteger()
+
+ def jourSelectionne = new GregorianCalendar(
+ annee,
+ mois,
+ jour
+ )
+
+ DetailJourCommand detailJourCommand = new DetailJourCommand(
+ eleveId: eleve.autorite.id,
+ moisId: ficheEleveCalendrierMoisPositionAUtiliser.mois,
+ numJour: jourPosition.toInteger(),
+ jour: jourSelectionne,
+ parsedTypesAbsencesIds : [
+ AbsencesType.ABSENCE_VALABLE,
+ AbsencesType.ABSENCE_NON_VALABLE,
+ AbsencesType.ABSENCE_PREVISIONNELLE,
+ AbsencesType.RETARD
+ ]
+ )
+
+ DetailJourInfo detailJourInfo = registreMensuelService.getDetailJour(
+ detailJourCommand,
+ preferencesEtablissementAbsences
+ )
+
+ return detailJourInfo
+ }
+
+ /**
+ * Récupère le détail des absences pour une journée et pour un élève
+ * @param eleve
+ * @result mapDetailAbsencesJourEleve
+ */
+ DetailJourInfo getDetailAbsencesJour(
+ Personne eleve,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences,
+ Calendrier calendrier,
+ String jourPosition,
+ String moisPosition,
+ List <FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition
+ ){
+
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPositionAUtiliser =
+ new FicheEleveCalendrierMoisPosition()
+
+ allFicheEleveCalendrierMoisPosition.each{
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPosition ->
+ if(ficheEleveCalendrierMoisPosition.position == moisPosition.toInteger()){
+ ficheEleveCalendrierMoisPositionAUtiliser = ficheEleveCalendrierMoisPosition
+ }
+ }
+
+ int annee = ficheEleveCalendrierMoisPositionAUtiliser.annee.toInteger()
+ int mois = ficheEleveCalendrierMoisPositionAUtiliser.mois.toInteger()
+ int jour = jourPosition.toInteger()
+
+ def jourSelectionne = new GregorianCalendar(
+ annee,
+ mois,
+ jour
+ )
+
+ DetailJourCommand detailJourCommand = new DetailJourCommand(
+ eleveId: eleve.autorite.id,
+ moisId: ficheEleveCalendrierMoisPositionAUtiliser.annee +
+ ficheEleveCalendrierMoisPositionAUtiliser.mois,
+ numJour: jourPosition.toInteger(),
+ jour: jourSelectionne,
+ parsedTypesAbsencesIds : [
+ AbsencesType.ABSENCE_VALABLE,
+ AbsencesType.ABSENCE_NON_VALABLE,
+ AbsencesType.ABSENCE_PREVISIONNELLE,
+ AbsencesType.RETARD,
+ AbsencesType.DEPART_ANTICIPE,
+ AbsencesType.DEMI_PENSION,
+ AbsencesType.INTERNAT,
+ ]
+ )
+
+ DetailJourInfo detailJourInfo = registreMensuelService.getDetailJour(
+ detailJourCommand,
+ preferencesEtablissementAbsences
+ )
+
+ return detailJourInfo
+ }
+
+ String getMoisString (int mois){
+ switch (mois){
+ case 0 :
+ return 'Janvier'
+ break
+ case 1 :
+ return 'Février'
+ break
+ case 2 :
+ return 'Mars'
+ break
+ case 3 :
+ return 'Avril'
+ break
+ case 4 :
+ return 'Mai'
+ break
+ case 5 :
+ return 'Juin'
+ break
+ case 6 :
+ return 'Juillet'
+ break
+ case 7 :
+ return 'Août'
+ break
+ case 8 :
+ return 'Septembre'
+ break
+ case 9 :
+ return 'Octobre'
+ break
+ case 10 :
+ return 'Novembre'
+ break
+ case 11 :
+ return 'Decembre'
+ break
+ }
+
+ }
+
+
+}
--- /dev/null
+package org.lilie.services.eliot.scolarite.personne.eleve
+
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.Calendrier
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.scolarite.Periode
+
+/**
+ * Agrège les données nécessaires au calcul du tableau d'absences de la fiche élève
+ * @author jbui
+ */
+class FicheEleveAbsencesReferentiel {
+ SecuriteSession securiteSession
+ Personne eleve
+ StructureEnseignement structureEnseignement
+ Calendrier calendrier
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences
+ List<Periode> periodes
+}
--- /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.personne.eleve
+
+import org.lilie.services.eliot.scolarite.Calendrier
+import org.lilie.services.eliot.absences.PlageHoraire
+import java.text.SimpleDateFormat
+
+class FicheEleveAbsencesService {
+
+ /**
+ * Récupère une liste avec la position du tableau FO en clef,
+ * et le mois et l'année correspondante en valeur
+ * @param calendrier
+ * @result moisPositions
+ */
+ List associerPositionEtMois(Calendrier calendrier){
+
+ Date dateDebut = calendrier.premierJour
+ Date dateFin = calendrier.dernierJour
+
+ Calendar calendarDebut = dateDebut.toCalendar()
+ Calendar calendarFin = dateFin.toCalendar()
+
+ int nbrMois = compteMoisCalendrier(calendarDebut, calendarFin)
+
+ List <FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition = []
+
+ for(int i = 0; i < nbrMois; i++ ){
+ allFicheEleveCalendrierMoisPosition[i]= new FicheEleveCalendrierMoisPosition(
+ position: i+1,
+ mois: calendarDebut[Calendar.MONTH],
+ annee: calendarDebut[Calendar.YEAR],
+ moisString: getMoisString(calendarDebut[Calendar.MONTH])
+ )
+ calendarDebut.add(Calendar.MONTH, +1)
+ }
+
+ return allFicheEleveCalendrierMoisPosition
+ }
+
+ /**
+ * Récupère la position de la date et du mois du jour
+ * dans le calendrier scolaire de la Fiche élève onglet Absences
+ * @param allFicheEleveCalendrierMoisPosition
+ * @result Map positions
+ */
+ Map getDatePositions(
+ List <FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition,
+ Date date
+ ){
+
+ Calendar dateDuJourCalendar = date.toCalendar()
+ int moisDateDuJour = dateDuJourCalendar[Calendar.MONTH]
+ int jourDateDuJour = dateDuJourCalendar[Calendar.DATE]
+ int anneeDuJour = dateDuJourCalendar[Calendar.YEAR]
+
+ String moisPosition = ''
+ allFicheEleveCalendrierMoisPosition.each{
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPosition ->
+ if (ficheEleveCalendrierMoisPosition.mois == moisDateDuJour && ficheEleveCalendrierMoisPosition.annee == anneeDuJour){
+ moisPosition = ficheEleveCalendrierMoisPosition.position
+ }
+ }
+
+ String jourPosition = jourDateDuJour
+
+ return ['jour' : jourPosition,'mois' : moisPosition]
+
+ }
+
+
+ Map getPlagesHorairesInfo(List <PlageHoraire> allPlageHoraire){
+
+ String dateDebutString = ''
+ SimpleDateFormat sdfJS = new SimpleDateFormat("hh:mm", Locale.FRANCE)
+
+ Map plagesHorairesInfo = [:]
+ allPlageHoraire.each {
+ dateDebutString = sdfJS.format(it.debut)
+ plagesHorairesInfo.put('plage' + it.id, dateDebutString)
+
+ }
+
+ return plagesHorairesInfo
+ }
+
+ /**
+ * Compte le nombre de mois du calendrier de l'année scolaire
+ * @param calendarDebut
+ * @param calendarFin
+ * @result nbrMois
+ */
+ int compteMoisCalendrier(Calendar calendarDebut, Calendar calendarFin){
+ def mois = (calendarFin[Calendar.MONTH] - calendarDebut[Calendar.MONTH]) + 1
+ def annees = calendarFin[Calendar.YEAR] - calendarDebut[Calendar.YEAR]
+ def nbrMois = mois + (annees * 12)
+
+ return nbrMois
+ }
+
+ String getMoisString (int mois){
+ switch (mois){
+ case 0 :
+ return 'Janvier'
+ break
+ case 1 :
+ return 'Février'
+ break
+ case 2 :
+ return 'Mars'
+ break
+ case 3 :
+ return 'Avril'
+ break
+ case 4 :
+ return 'Mai'
+ break
+ case 5 :
+ return 'Juin'
+ break
+ case 6 :
+ return 'Juillet'
+ break
+ case 7 :
+ return 'Août'
+ break
+ case 8 :
+ return 'Septembre'
+ break
+ case 9 :
+ return 'Octobre'
+ break
+ case 10 :
+ return 'Novembre'
+ break
+ case 11 :
+ return 'Decembre'
+ break
+ }
+
+ }
+
+}
\ 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.scolarite.personne.eleve
+
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesEleve
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesParams
+import org.lilie.services.eliot.applications.absences.PriseEnCompteMotif
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodes
+import org.lilie.services.eliot.applications.absences.BasicCriteresRecherche
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodesLigne
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuelles
+import org.lilie.services.eliot.absences.statistiques.mensuelle.ModeCalcul
+import org.lilie.services.eliot.absences.statistiques.Type
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodesService
+import org.lilie.services.eliot.parametrages.motifs.MotifService
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesService
+
+class FicheEleveAbsencesTableauService {
+
+ StatsPeriodesService statsPeriodesService
+ MotifService motifService
+ StatsMensuellesService statsMensuellesService
+
+ StatsPeriodes findAbsencesPeriodesTotal(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsAbsencesTotales(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesJustifiees(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsAbsencesJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesNonJustifiees(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsAbsencesNonJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesNonRecevables(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsAbsencesNonRecevables(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesRetards(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsRetards(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesDepartAnticipes(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsDepartsAnticipes(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesInternats(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsInternat(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ StatsPeriodes findAbsencesPeriodesDemiPensions(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ BasicCriteresRecherche params = getParamsDemiPension(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findAbsencesPeriodesForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ private StatsPeriodes findAbsencesPeriodesForParams(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel,
+ StatsMensuellesParams params) {
+ StatsPeriodes statsPeriodes = new StatsPeriodes(
+ periodes: ficheEleveAbsencesReferentiel.periodes
+ )
+ statsPeriodes.lignes << new StatsPeriodesLigne(
+ ficheEleveAbsencesReferentiel.eleve
+ )
+ return (StatsPeriodes) statsPeriodesService.
+ calculeStatsPeriodesAbsences(
+ params,
+ statsPeriodes,
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences
+ )
+ }
+
+ /**
+ * Calcule les stats pour les absences à l'internat
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findAbsencesMensuellesInternat(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsInternat(ficheEleveAbsencesReferentiel)
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params,
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les absences à l'internat
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ StatsMensuellesParams getParamsInternat(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getBasicParams(
+ ficheEleveAbsencesReferentiel
+ )
+ params.internat = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS,
+ false
+ )*.id
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Calcule les stats pour les absences à la demi-pension
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findAbsencesMensuellesDemiPension(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+ StatsMensuellesParams params = getParamsDemiPension(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les absences à la demi-pension
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ StatsMensuellesParams getParamsDemiPension(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.demiPension = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS,
+ false
+ )*.id
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Calcule les stats pour les départs anticipés
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findDepartsAnticipesMensuelles(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsDepartsAnticipes(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Calcule les stats pour les critères passés en params
+ * @param securiteSession
+ * @param params
+ * @param preferencesEtablissementAbsences
+ * @param eleve
+ * @return StatsMensuellesEleve
+ */
+ private StatsMensuellesEleve findStatsMensuellesForParams(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel,
+ StatsMensuellesParams params) {
+ StatsMensuelles statsMensuelles = statsMensuellesService.calculeStatsMensuelles(
+ ficheEleveAbsencesReferentiel.securiteSession,
+ params,
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences
+ )
+
+ return statsMensuelles.findStatsEleve(ficheEleveAbsencesReferentiel.eleve)
+ }
+
+ /**
+ * Crée un critère de recherche pour les départs anticipés
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ StatsMensuellesParams getParamsDepartsAnticipes(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.departsAnticipes = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS,
+ false
+ )*.id
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Calcule les stats pour les retards
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findRetardsMensuelles(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsRetards(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les retards
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ StatsMensuellesParams getParamsRetards(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.retards = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS,
+ false
+ )*.id
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Calcule les stats pour les absences non recevables
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findAbsencesMensuellesNonRecevables(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsAbsencesNonRecevables(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les absences non recevables
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ StatsMensuellesParams getParamsAbsencesNonRecevables(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.absencesValables = false
+ params.absencesNonValables = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS,
+ false
+ )*.id
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Calcule les stats pour les absences justifiées et non justifiées
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findAbsencesMensuellesTotal(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsAbsencesTotales(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les absences justifiées et non justifiées
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ StatsMensuellesParams getParamsAbsencesTotales(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.absencesValables = true
+ params.absencesNonValables = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS,
+ false
+ )*.id
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Calcule les stats mensuelles pour les absences non justifiées
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findAbsencesMensuellesNonJustifiees(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsAbsencesNonJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les absences non justifiées
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ private StatsMensuellesParams getParamsAbsencesNonJustifiees(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.absencesValables = true
+ params.absencesNonValables = true
+ params.motifIds = [motifService.getMotifSansMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences
+ ).id]
+ params.etablissementId = ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Retourne les stats mensuelles d'un élève pour les absences justifiées
+ * @param securiteSession
+ * @param eleve
+ * @param calendrier
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesEleve
+ */
+ StatsMensuellesEleve findAbsencesMensuellesJustifiees(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = getParamsAbsencesJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+ return findStatsMensuellesForParams(
+ ficheEleveAbsencesReferentiel,
+ params
+ )
+ }
+
+ /**
+ * Crée un critère de recherche pour les absences justifiées
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @return un StatsMensuellesParams
+ */
+ private StatsMensuellesParams getParamsAbsencesJustifiees(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+ StatsMensuellesParams params = getBasicParams(ficheEleveAbsencesReferentiel)
+ params.absencesValables = true
+ params.absencesNonValables = true
+ params.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS
+ )*.id
+ params.motifIds.remove(
+ motifService.getMotifSansMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences
+ ).id
+ )
+ params.etablissementId = ficheEleveAbsencesReferentiel.
+ preferencesEtablissementAbsences.etablissement.id
+ return params
+ }
+
+ /**
+ * Crée les critères de recherche de base
+ * @param calendrier
+ * @param eleve
+ * @return un StatsMensuellesParams
+ */
+ private StatsMensuellesParams getBasicParams(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel) {
+
+ StatsMensuellesParams params = new StatsMensuellesParams(
+ modeCalcul: ModeCalcul.VOLUME,
+ type: Type.ABSENCES
+ )
+ params.dateDebut.setTime(ficheEleveAbsencesReferentiel.calendrier.premierJour)
+ params.dateFin.setTime(ficheEleveAbsencesReferentiel.calendrier.dernierJour)
+ params.eleveIds = [ficheEleveAbsencesReferentiel.eleve.autorite.id]
+ params.structIds = [ficheEleveAbsencesReferentiel.structureEnseignement.id]
+ return params
+ }
+
+
+ Double getTauxAbsenteisme (
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel
+ ){
+
+ BasicCriteresRecherche params = getParamsTauxAbsenteisme(
+ ficheEleveAbsencesReferentiel
+ )
+
+ return findTauxAbsenteismeForParams(ficheEleveAbsencesReferentiel, params)
+ }
+
+ /**
+ * Crée un critère de recherche pour le taux d'absenteisme
+ * @param ficheEleveAbsencesReferentiel
+ * @return un StatsMensuellesParams
+ */
+ private StatsMensuellesParams getParamsTauxAbsenteisme(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel
+ ){
+
+ StatsMensuellesParams statsMensuellesParams =
+ getBasicParams(ficheEleveAbsencesReferentiel)
+
+ statsMensuellesParams.modeCalcul = ModeCalcul.POURCENTAGE
+ statsMensuellesParams.isResultatsParNiveau = false
+ statsMensuellesParams.absencesValables = true
+ statsMensuellesParams.absencesNonValables = true
+ statsMensuellesParams.absencesPrevisionnelles = false
+ statsMensuellesParams.retards = false
+ statsMensuellesParams.departsAnticipes = false
+ statsMensuellesParams.demiPension = false
+ statsMensuellesParams.internat = false
+ statsMensuellesParams.start = null
+ statsMensuellesParams.limit = null
+ statsMensuellesParams.regimeIds = null
+ statsMensuellesParams.etablissementId = null
+ statsMensuellesParams.motifIds = motifService.findAllMotifForPriseEnCompteMotif(
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences,
+ PriseEnCompteMotif.STATS
+ )*.id
+
+ return statsMensuellesParams
+
+ }
+
+ /**
+ * Calcule les stats pour les critères passés en params
+ * @param securiteSession
+ * @param params
+ * @param preferencesEtablissementAbsences
+ * @param eleve
+ * @return StatsMensuellesEleve
+ */
+ private Double findTauxAbsenteismeForParams(
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel,
+ StatsMensuellesParams params) {
+ StatsMensuelles statsMensuelles = statsMensuellesService.calculeStatsMensuelles(
+ ficheEleveAbsencesReferentiel.securiteSession,
+ params,
+ ficheEleveAbsencesReferentiel.preferencesEtablissementAbsences
+ )
+
+ return statsMensuelles.statsEleves[0].tableauStatsMensuelles.totalLigne
+ }
+
+}
--- /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.personne.eleve
+
+class FicheEleveCalendrierMoisPosition {
+
+ int position
+ int mois
+ int annee
+ String moisString
+
+
+
+}
--- /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.personne.eleve
+
+import org.lilie.services.eliot.absences.Sanction
+import org.lilie.services.eliot.absences.Punition
+import org.lilie.services.eliot.absences.Incident
+
+class FicheEleveSanction {
+
+ List<Sanction> sanctions
+ List<Punition> punitions
+ List<Incident> incidents
+ String dateDebutAnneeScolaire
+ String dateFinAnneeScolaire
+ String dateDebut
+ String dateFin
+
+}
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.scolarite.FicheEleveCommentaire
import org.lilie.services.eliot.scolarite.personne.enseignant.EnseignantAnnuaireService
-import org.lilie.services.eliot.scolarite.NaturePeriode
-import org.lilie.services.eliot.notes.AppreciationElevePeriode
import org.lilie.services.eliot.FicheEleveClassesInfo
-import org.lilie.services.eliot.notes.ResultatElevePeriode
-import org.lilie.services.eliot.notes.Note
import org.lilie.services.eliot.notes.NoteService
import org.lilie.services.eliot.notes.resultat.eleve.AppreciationElevePeriodeService
-
import org.lilie.services.eliot.scolarite.Periode
+import org.lilie.services.eliot.applications.absences.DisciplineCriteresRecherche
+import org.lilie.services.eliot.applications.absences.SanctionService
+import org.lilie.services.eliot.applications.absences.PunitionService
+import org.lilie.services.eliot.scolarite.Calendrier
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.FicheEleveSanctionsMarshallerService
+import org.lilie.services.eliot.applications.absences.IncidentService
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.FicheEleveAbsencesJourMarshallerService
+import org.lilie.services.eliot.parametrages.calendrier.PlageHoraireService
+import org.lilie.services.eliot.absences.PlageHoraire
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordAbsencesService
+import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreLigneInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelService
+import org.lilie.services.eliot.scolarite.anneescolaire.AnneeScolaireService
+import org.lilie.services.eliot.parametrages.motifs.MotifService
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesService
+import org.lilie.services.eliot.scolarite.PeriodeService
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodesService
+import org.lilie.services.eliot.absences.parametrage.general.GeneralService
class FicheEleveService {
EnseignantAnnuaireService enseignantAnnuaireService
NoteService noteService
AppreciationElevePeriodeService appreciationElevePeriodeService
+ SanctionService sanctionService
+ PunitionService punitionService
+ IncidentService incidentService
+ FicheEleveSanctionsMarshallerService ficheEleveSanctionsMarshallerService
+ PlageHoraireService plageHoraireService
+ CalendrierService calendrierService
+ AnneeScolaireService anneeScolaireService
+ MotifService motifService
+ PeriodeService periodeService
+ FicheEleveAbsencesService ficheEleveAbsencesService
+ FicheEleveAbsencesCalendrierService ficheEleveAbsencesCalendrierService
+ FicheEleveAbsencesTableauService ficheEleveAbsencesTableauService
+ GeneralService generalService
/**
* Construit la fiche d'élève qui regroupe les infos personnelles d'un élève.
List<StructureEnseignement> classesEleve =
localStructureEnseignementService.findAllClasseForEleve(
- securiteSession,
- eleve
- )
+ securiteSession,
+ eleve
+ )
Map<Long, Long> countAppreciationsParPeriodeId =
appreciationElevePeriodeService.compteAppreciationsParPeriode(
)
}
+ /**
+ * Récupère les données de l'onglet "Sanctions" de la fiche élève
+ * @param eleve
+ * @param calendrier
+ * @param dateDuJour
+ * @param dateDebut
+ * @param datefin
+ * @result mapFicheEleveSanctions
+ */
+ Map getDonneesOngletSanction(
+ Personne eleve,
+ Calendrier calendrier,
+ Date dateDebut,
+ Date dateFin
+ ) {
+
+ SimpleDateFormat sdfJS = new SimpleDateFormat("MM/dd/yyyy", Locale.FRANCE)
+
+ String debutAnneeScolaire = calendrier.premierJour ? sdfJS.format(calendrier.premierJour) : null
+ String finAnneeScolaire = calendrier.dernierJour ? sdfJS.format(calendrier.dernierJour) : null
+ String dateDebutString = sdfJS.format(dateDebut)
+ String dateFinString = sdfJS.format(dateFin)
+
+ Map result = (Map) [:]
+
+ FicheEleveSanction ficheEleveSanction = new FicheEleveSanction()
+
+ DisciplineCriteresRecherche disciplineCriteresRecherche =
+ new DisciplineCriteresRecherche(
+ elevePersonneIds: [eleve.id],
+ dateDebut: dateDebut,
+ dateFin: dateFin
+ )
+
+ ficheEleveSanction.sanctions =
+ sanctionService.findSanctionsForCriteres(disciplineCriteresRecherche)
+
+ ficheEleveSanction.punitions =
+ punitionService.findPunitionsForCriteres(disciplineCriteresRecherche)
+
+ ficheEleveSanction.incidents =
+ incidentService.findIncidentsForCriteres(disciplineCriteresRecherche)
+
+ ficheEleveSanction.dateDebutAnneeScolaire = debutAnneeScolaire
+ ficheEleveSanction.dateFinAnneeScolaire = finAnneeScolaire
+ ficheEleveSanction.dateDebut = dateDebutString
+ ficheEleveSanction.dateFin = dateFinString
+
+ return ficheEleveSanctionsMarshallerService.marshallFicheEleveSanctions(ficheEleveSanction)
+ }
+
+ /**
+ * Récupère les données nécessaires à l'onglet "absences" de la fiche élève
+ * @param calendrier
+ * @param eleve
+ * @param preferencesEtablissementAbsences
+ * @result ficheEleveAbsences
+ */
+ FicheEleveAbsences getFicheEleveAbsencesData(
+ SecuriteSession securiteSession,
+ Calendrier calendrier,
+ Personne eleve,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences
+ ) {
+
+ StructureEnseignement structureEnseignement =
+ localStructureEnseignementService.findClasseForEleve(eleve)
+
+ List<FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition =
+ ficheEleveAbsencesService.associerPositionEtMois(calendrier)
+
+ Date dateDuJour = new Date()
+
+ Map dateDuJourPositions =
+ ficheEleveAbsencesService.getDatePositions(
+ allFicheEleveCalendrierMoisPosition,
+ dateDuJour
+ )
+
+ List<PlageHoraire> allPlageHoraireEtablissement =
+ plageHoraireService.getPlageHoraires(preferencesEtablissementAbsences)
+
+ Map plagesHorairesInfo =
+ ficheEleveAbsencesService.getPlagesHorairesInfo(
+ allPlageHoraireEtablissement
+ )
+
+ List<RegistreLigneInfo> calendrierData =
+ ficheEleveAbsencesCalendrierService.getCalendrierData(
+ preferencesEtablissementAbsences,
+ eleve,
+ calendrier,
+ allFicheEleveCalendrierMoisPosition
+ )
+
+ DetailJourInfo detailAbsencesJour =
+ ficheEleveAbsencesCalendrierService.getDetailAbsencesJour(
+ eleve,
+ preferencesEtablissementAbsences,
+ calendrier,
+ dateDuJourPositions.jour,
+ dateDuJourPositions.mois,
+ allFicheEleveCalendrierMoisPosition
+ )
+
+ FicheEleveAbsencesReferentiel ficheEleveAbsencesReferentiel =
+ new FicheEleveAbsencesReferentiel(
+ securiteSession: securiteSession,
+ eleve: eleve,
+ structureEnseignement: structureEnseignement,
+ calendrier: calendrier,
+ preferencesEtablissementAbsences: preferencesEtablissementAbsences,
+ periodes: structureEnseignement.getXmestres()
+ )
+
+ Double tauxAbsenteisme = ficheEleveAbsencesTableauService.getTauxAbsenteisme(
+ ficheEleveAbsencesReferentiel
+ )
+
+ TotauxAbsencesEleve totauxAbsencesEleve = new TotauxAbsencesEleve()
+
+ totauxAbsencesEleve.pasDeDecompte = generalService.getPasDeDecompte(
+ securiteSession,
+ preferencesEtablissementAbsences
+ )
+
+ totauxAbsencesEleve.mensuelJustifiees =
+ ficheEleveAbsencesTableauService.findAbsencesMensuellesJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelNonJustifiees =
+ ficheEleveAbsencesTableauService.findAbsencesMensuellesNonJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelTotal =
+ ficheEleveAbsencesTableauService.findAbsencesMensuellesTotal(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelNonRecevables =
+ ficheEleveAbsencesTableauService.findAbsencesMensuellesNonRecevables(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelRetards =
+ ficheEleveAbsencesTableauService.findRetardsMensuelles(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelDepartAnticipes =
+ ficheEleveAbsencesTableauService.findDepartsAnticipesMensuelles(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelDemiPensions =
+ ficheEleveAbsencesTableauService.findAbsencesMensuellesDemiPension(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.mensuelInternats =
+ ficheEleveAbsencesTableauService.findAbsencesMensuellesInternat(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeTotal =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesTotal(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeJustifiees =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeNonJustifiees =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesNonJustifiees(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeNonRecevables =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesNonRecevables(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeRetards =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesRetards(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeDepartAnticipes =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesDepartAnticipes(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeInternats =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesInternats(
+ ficheEleveAbsencesReferentiel
+ )
+ totauxAbsencesEleve.periodeDemiPensions =
+ ficheEleveAbsencesTableauService.findAbsencesPeriodesDemiPensions(
+ ficheEleveAbsencesReferentiel
+ )
+
+
+ FicheEleveAbsences ficheEleveAbsences = new FicheEleveAbsences(
+ tableauInfo: totauxAbsencesEleve,
+ calendrierData: calendrierData,
+ detailAbsencesJour: detailAbsencesJour,
+ plageHorairesInfo: plagesHorairesInfo,
+ dateDuJourPositions: dateDuJourPositions,
+ tauxAbsenteisme: tauxAbsenteisme
+ )
+
+ return ficheEleveAbsences
- // TOIMP a remplacer par getDonneesOngletSanction de la branche d'absences
- // une fois la branche sera dans un etat stable
- def getDonneesOngletSanction(def a) {
- return []
}
}
--- /dev/null
+package org.lilie.services.eliot.scolarite.personne.eleve
+
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesEleve
+import org.lilie.services.eliot.absences.statistiques.periode.StatsPeriodes
+import org.lilie.services.eliot.absences.parametrage.general.PasDeDecompteEnum
+
+/**
+ * Contient les comptages d'absences d'un élève
+ */
+class TotauxAbsencesEleve {
+ StatsMensuellesEleve mensuelTotal
+ StatsMensuellesEleve mensuelNonJustifiees
+ StatsMensuellesEleve mensuelJustifiees
+ StatsMensuellesEleve mensuelNonRecevables
+ StatsMensuellesEleve mensuelRetards
+ StatsMensuellesEleve mensuelDepartAnticipes
+ StatsMensuellesEleve mensuelInternats
+ StatsMensuellesEleve mensuelDemiPensions
+
+ StatsPeriodes periodeTotal
+ StatsPeriodes periodeNonJustifiees
+ StatsPeriodes periodeJustifiees
+ StatsPeriodes periodeNonRecevables
+ StatsPeriodes periodeRetards
+ StatsPeriodes periodeDepartAnticipes
+ StatsPeriodes periodeInternats
+ StatsPeriodes periodeDemiPensions
+
+ PasDeDecompteEnum pasDeDecompte
+}
return formatDate.format(date)
}
+ /**
+ * retourne la date formatée exp : 'jj/mm/yyyy hh:mm '
+ * @author bahj
+ * @param date
+ * @return une String
+ */
+ static String formateDateJourHeure(Date date) {
+ String format = 'dd/MM/yyyy HH:mm'
+ SimpleDateFormat formatDate = new SimpleDateFormat(
+ format,
+ Locale.FRANCE
+ )
+
+ return formatDate.format(date)
+ }
+
}
<%--
@author jbui
--%>
-
+<link rel="stylesheet" href="${url(uri: 'css/fiche-eleve.css')}" type="text/css"
+ media="screen"/>
<g:render template="/commons/ficheeleve/importsJs" plugin="eliot-app-plugin"/>
-<g:render template="/commons/ficheeleve/modeleFicheEleve" plugin="eliot-app-plugin"/>
-<g:javascript library="/commons/ficheeleve/Application" plugin="eliot-app-plugin"/>
+<g:render template="/commons/ficheeleve/modeleFicheEleve"
+ plugin="eliot-app-plugin"/>
+<g:javascript library="/commons/ficheeleve/Application"
+ plugin="eliot-app-plugin"/>
<g:javascript library="commons/ficheeleve/ResponsablePanelView" plugin="eliot-app-plugin"/>
<g:javascript library="commons/ficheeleve/NotePanelView" plugin="eliot-app-plugin"/>
<g:javascript library="commons/ficheeleve/ConseilPanelView" plugin="eliot-app-plugin"/>
+<g:javascript library="commons/ficheeleve/AbsencesPanelView" plugin="eliot-app-plugin"/>
+<g:javascript library="commons/ficheeleve/AbsencesPanelController" plugin="eliot-app-plugin"/>
+<g:javascript library="commons/ficheeleve/SanctionsPanelView" plugin="eliot-app-plugin"/>
+<g:javascript library="commons/ficheeleve/SanctionsPanelController" plugin="eliot-app-plugin"/>
+
<eliotjs:varI18n name="messageErreur" code="ficheeleve.libelle.message.erreur"/>
<eliotjs:varI18n name="messageAnnulation" code="ficheeleve.libelle.message.annulation"/>
<eliotjs:varI18n name="formatDate" code="ficheeleve.libelle.format.date"/>
+ <eliotjs:varI18n name="absences" code="ficheeleve.libelle.onglet.absences"/>
+ <eliotjs:varI18n name="sanctions" code="ficheeleve.libelle.onglet.sanctions"/>
+ <eliotjs:varI18n name="tableau" code="ficheeleve.libelle.tableau"/>
+ <eliotjs:varI18n name="calendrier" code="ficheeleve.libelle.calendrier"/>
+ <eliotjs:varI18n name="detailDu" code="ficheeleve.libelle.detailDu" encoded="true"/>
+ <eliotjs:varI18n name="punitions" code="ficheeleve.libelle.onglet.punitions"/>
+ <eliotjs:varI18n name="incidents" code="ficheeleve.libelle.onglet.incidents"/>
+ <eliotjs:varI18n name="dateDebut" code="ficheeleve.libelle.onglet.sanctions.dateDebut"/>
+ <eliotjs:varI18n name="dateFin" code="ficheeleve.libelle.onglet.sanctions.dateFin"/>
+ <eliotjs:varI18n name="date" code="ficheeleve.libelle.onglet.sanctions.date"/>
+ <eliotjs:varI18n name="type" code="ficheeleve.libelle.onglet.sanctions.type"/>
+ <eliotjs:varI18n name="responsable" code="ficheeleve.libelle.onglet.sanctions.responsable"/>
+ <eliotjs:varI18n name="statut" code="ficheeleve.libelle.onglet.sanctions.statut"/>
+ <eliotjs:varI18n name="dateHeure" code="ficheeleve.libelle.onglet.sanctions.dateHeure"/>
+ <eliotjs:varI18n name="typeIncident" code="ficheeleve.libelle.onglet.sanctions.typeIncident"/>
+ <eliotjs:varI18n name="lieu" code="ficheeleve.libelle.onglet.sanctions.lieu"/>
+ <eliotjs:varI18n name="gravite" code="ficheeleve.libelle.onglet.sanctions.gravite"/>
+ <eliotjs:varI18n name="partenaires" code="ficheeleve.libelle.onglet.sanctions.partenaires"/>
+ <eliotjs:varI18n name="protagonistes" code="ficheeleve.libelle.onglet.sanctions.protagonistes"/>
+ <eliotjs:varI18n name="dateIncorrecteDebFin" code="ficheeleve.libelle.onglet.sanctions.dateIncorrecte.debFin"/>
+ <eliotjs:varI18n name="dateIncorrecteAnneeScolaire" code="ficheeleve.libelle.onglet.sanctions.dateIncorrecte.anneeScolaire"/>
+ <eliotjs:varI18n name="chercher" code="ficheeleve.libelle.onglet.sanctions.chercher"/>
+ <eliotjs:varI18n name="tauxAbsences" code="ficheeleve.libelle.tauxAbsences"/>
<eliotjs:varI18n name="ongletConseil" code="ficheeleve.libelle.ongletConseil"/>
<eliotjs:varI18n name="ongletNote" code="ficheeleve.libelle.ongletNote"/>
<eliotjs:varLink name="saveCommentaire" controller="jsonFicheEleve" action="saveCommentaire"/>
<eliotjs:varLink name="construisInfoConseil" controller="jsonFicheEleve" action="construisInfoConseil"/>
<eliotjs:varLink name="construisInfoBulletin" controller="jsonFicheEleve" action="construisInfoBulletin"/>
+ <eliotjs:varLink name="getSanctionsByEleveId" controller="jsonFicheEleve" action="getSanctionsByEleveId"/>
+ <eliotjs:varLink name="getEleveAbsences" controller="jsonFicheEleve" action="getEleveAbsences"/>
+ <eliotjs:varLink name="getDetailDuJour" controller="jsonFicheEleve" action="getAbsencesDetailDuJour"/>
</eliotjs:ns>
<eliotjs:ns name="message">
--- /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.ficheeleve
+
+import org.lilie.services.eliot.scolarite.Calendrier
+import grails.plugin.spock.UnitSpec
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsencesService
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveCalendrierMoisPosition
+import org.lilie.services.eliot.absences.PlageHoraire
+
+class FicheEleveAbsencesServiceSpec extends UnitSpec{
+
+ FicheEleveAbsencesService ficheEleveAbsencesService
+ Calendrier calendrier
+
+ def setup() {
+ ficheEleveAbsencesService = new FicheEleveAbsencesService()
+
+ Calendar calendar = new GregorianCalendar(2012,8,1)
+ Date premierJour = calendar.getTime()
+ calendar = new GregorianCalendar(2013,6,31)
+ Date dernierJour = calendar.getTime()
+
+ calendrier = new Calendrier(
+ premierJour: premierJour,
+ dernierJour: dernierJour
+ )
+ }
+
+ def cleanup() {
+ }
+
+
+ def 'associerPositionEtMois'(){
+
+ given:
+
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPosition1 =
+ new FicheEleveCalendrierMoisPosition(
+ position: 1,
+ mois: 8,
+ annee: 2012,
+ moisString : 'Septembre'
+ )
+ FicheEleveCalendrierMoisPosition ficheEleveCalendrierMoisPosition2 =
+ new FicheEleveCalendrierMoisPosition(
+ position: 11,
+ mois: 6,
+ annee: 2013,
+ moisString : 'Juillet'
+ )
+
+ List <FicheEleveCalendrierMoisPosition> resultat = [
+ ficheEleveCalendrierMoisPosition1,
+ ficheEleveCalendrierMoisPosition2
+ ]
+
+
+ when:
+ List allFicheEleveCalendrierMoisPosition =
+ ficheEleveAbsencesService.associerPositionEtMois(calendrier)
+
+ then:
+
+ allFicheEleveCalendrierMoisPosition.size() == 11
+
+ allFicheEleveCalendrierMoisPosition[0].position == resultat[0].position
+ allFicheEleveCalendrierMoisPosition[0].mois == resultat[0].mois
+ allFicheEleveCalendrierMoisPosition[0].annee == resultat[0].annee
+ allFicheEleveCalendrierMoisPosition[0].moisString == resultat[0].moisString
+
+ allFicheEleveCalendrierMoisPosition[10].position == resultat[1].position
+ allFicheEleveCalendrierMoisPosition[10].mois == resultat[1].mois
+ allFicheEleveCalendrierMoisPosition[10].annee == resultat[1].annee
+ allFicheEleveCalendrierMoisPosition[10].moisString == resultat[1].moisString
+
+ }
+
+ def 'getDatePosition'(){
+
+ given:
+
+ Calendar calendar2 = new GregorianCalendar(2012,8,2)
+ Date dateDuJour = calendar2.getTime()
+
+ List <FicheEleveCalendrierMoisPosition> allFicheEleveCalendrierMoisPosition =
+ ficheEleveAbsencesService.associerPositionEtMois(calendrier)
+
+ when:
+ Map dateDuJourPosition =
+ ficheEleveAbsencesService.getDatePositions(
+ allFicheEleveCalendrierMoisPosition,
+ dateDuJour
+ )
+
+ then:
+
+ dateDuJourPosition['jour'] == "2"
+ dateDuJourPosition['mois'] == "1"
+
+ }
+
+ def 'getPlagesHorairesInfo'(){
+
+ given:
+
+ Calendar calendar = new GregorianCalendar(2012,8,1,8,0,0)
+ Date plageHoraire1 = calendar.getTime()
+
+ calendar = new GregorianCalendar(2012,8,1,9,0,0)
+ Date plageHoraire2 = calendar.getTime()
+
+ List <PlageHoraire> allPlageHoraire = [
+ new PlageHoraire(
+ debut : plageHoraire1,
+ id : 1
+ ),
+ new PlageHoraire(
+ debut : plageHoraire2,
+ id : 2
+ )
+ ]
+
+ when:
+ Map allPlagesHorairesInfo =
+ ficheEleveAbsencesService.getPlagesHorairesInfo(allPlageHoraire)
+
+ then:
+ allPlagesHorairesInfo == [plage1:'08:00', plage2:'09:00']
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+}
--- /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.ficheeleve
+
+import grails.plugin.spock.UnitSpec
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveService
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveCalendrierMoisPosition
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.scolarite.Calendrier
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.parametrages.calendrier.PlageHoraireService
+import org.lilie.services.eliot.parametrages.calendrier.PlageHoraireInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreLigneInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreJourInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreDemiJourInfo
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsencesService
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsencesCalendrierService
+import org.lilie.services.eliot.scolarite.personne.eleve.FicheEleveAbsencesTableauService
+
+class FicheEleveServiceSpec extends UnitSpec{
+
+ FicheEleveService ficheEleveService
+ PlageHoraireService plageHoraireService
+ LocalStructureEnseignementService localStructureEnseignementService
+ FicheEleveAbsencesService ficheEleveAbsencesService
+ FicheEleveAbsencesCalendrierService ficheEleveAbsencesCalendrierService
+ FicheEleveAbsencesTableauService ficheEleveAbsencesTableauService
+
+
+ def setup (){
+
+ plageHoraireService = Mock(PlageHoraireService)
+ localStructureEnseignementService = Mock(LocalStructureEnseignementService)
+ ficheEleveAbsencesService = Mock(FicheEleveAbsencesService)
+ ficheEleveAbsencesCalendrierService = Mock(FicheEleveAbsencesCalendrierService)
+ ficheEleveAbsencesTableauService = Mock(FicheEleveAbsencesTableauService)
+
+ ficheEleveService = new FicheEleveService(
+ plageHoraireService: plageHoraireService,
+ localStructureEnseignementService : localStructureEnseignementService,
+ ficheEleveAbsencesService : ficheEleveAbsencesService,
+ ficheEleveAbsencesCalendrierService : ficheEleveAbsencesCalendrierService,
+ ficheEleveAbsencesTableauService : ficheEleveAbsencesTableauService
+ )
+ }
+
+ def cleanup() {
+ }
+
+ def 'getFicheEleveAbsencesData '() {
+
+// given:
+//
+// SecuriteSession securiteSession = Mock(SecuriteSession)
+// Calendrier calendrier = Mock(Calendrier)
+// Personne eleve = Mock(Personne)
+// PreferencesEtablissementAbsences preferencesEtablissementAbsences =
+// Mock(PreferencesEtablissementAbsences)
+//
+//
+//
+//
+// when:
+// ficheEleveService.getFicheEleveAbsencesData(
+// securiteSession,
+// calendrier,
+// eleve,
+// preferencesEtablissementAbsences
+// )
+//
+//
+// then:
+//
+// 1* localStructureEnseignementService.findClasseForEleve(eleve)
+//
+// 1* plageHoraireService.getPlageHoraires(
+// preferencesEtablissementAbsences
+// )
+//
+//
+//
+//
+
+
+
+
+ }
+}
--- /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>.
+ */
+
+/*Css de la grille de calendrier*/
+.abs-grid-cell div {
+ padding: 0;
+}
+
+.abs-calendrier-plage-fermee {
+ height: 8px;
+ background-color: #BBB;
+}
+
+.abs-calendrier-plage-ouverte {
+ height: 8px;
+}
+
+.sans-motif {
+ height: 8px;
+ background-image: url(../images/sansmotif.gif);
+}
+
+.avec-motif {
+ height: 8px;
+}
+
+.abs-calendrier .x-grid3-row {
+ height: 16px;
+ font-size: 8px;
+}
+
+/*Css de la grille de détail*/
+.abs-detail .x-grid3-row {
+ height: 16px;
+}
+
+.abs-detail-plage-fermee {
+ height: 16px;
+ background-color: #BBB;
+}
+
+.detail-sans-motif {
+ height: 16px;
+ background-image: url(../images/sansmotif.gif);
+}
+
+.depart {
+ background-image: url(../images/depart.png);
+ background-repeat: no-repeat;
+ float: right;
+ width: 14px;
+ height: 16px;
+}
+
+.retard {
+ background-image: url(../images/retard.png);
+ background-repeat: no-repeat;
+ float: left;
+ width: 14px;
+ height: 16px;
+}
+
+.abs-non-valable {
+ background-image: url(../images/absnonvalable.png);
+ background-color: transparent;
+ background-repeat: repeat-x;
+ height: 16px;
+}
+
+.abs-previsionnelle {
+ background-image: url(../images/absprevisionnelle.png);
+ height: 16px;
+}
+
+/*Css de la grille Tableau*/
+.abs-tableau .x-grid3-row {
+ height: 18px;
+}
+
+.tableau-valeur {
+ text-align: center;
+}
+
+.tableau-header-1-column {
+ font-style: italic;
+ font-weight: normal;
+ background-color: white;
+ color: #000000;
+}
+
+.fieldSet-container {
+ margin-right: 4px;
+ margin-bottom: 4px;
+ margin-top: 4px;
+ padding-bottom: 4px;
+ padding-top: 5px;
+}
+
+.onglet-sanctions .x-grid3-row {
+ height: 18px;
+}
\ 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>.
+ */
+
+/**
+ * Controller de l'onglet des absences
+ * @author bahj
+ */
+
+Ext.ns('eliot.ficheeleve');
+
+eliot.ficheeleve.AbsencesPanelController = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.ns = eliot.ficheeleve;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.addEvents(
+ /**
+ * @event reconfigureDetailGrid : levé afin que la grille reconfigure
+ * son store et ses columns selon les nouvelles données
+ * @params detailStore : le store de la grille
+ * @params plagesHorairesInfo : les plages horaires de l'établissement
+ */
+ this.Constantes.eventId.configureDetailGrid,
+
+ /**
+ * @event configureTableauGrid : levé afin que la grille reconfigure
+ * son store et ses columns selon les nouvelles données
+ * @params detailStore : le store de la grille
+ * @params dataIndex : le mapping entre les header de la grille et les fields du store
+ */
+ this.Constantes.eventId.configureTableauGrid,
+
+ /**
+ * @event ongletDataDisponible : levé suite au chargement des données
+ * de l'onglet des absences par ajax
+ * @params le mois à selectionner
+ * @params le jour à selectionner
+ * @params le taux d'absentéisme
+ */
+ this.Constantes.eventId.ongletDataDisponible
+
+ );
+
+ this.plagesHorairesInfo = undefined;
+
+ this.tableauDataIndex = undefined;
+
+ this.calendrierStore = new Ext.data.JsonStore({
+ autoDestroy:true,
+ fields:this.getCalendrierStoreFields()
+ });
+
+ this.detailStore = new Ext.data.JsonStore({
+ autoDestroy:true,
+ fields:[]
+ });
+
+ this.tableauStore = new Ext.data.JsonStore({
+ autoDestroy:true,
+ fields:[]
+ });
+ },
+
+ getCalendrierStoreFields:function () {
+ var fields = [];
+
+ // Ajoute la première colonne : libellé du mois
+ fields.push({name:this.Constantes.dataIndex.mois});
+
+ // Ajoute les colonnes jours
+ for (var i = 1; i <= 31; i++) {
+ fields.push({name:this.Constantes.dataIndex.jour + i});
+ }
+
+ return fields;
+ },
+
+ observeAbsencesPanelView:function (panelAbsencesView) {
+ panelAbsencesView.addListener(
+ this.Constantes.eventId.actionSelectionCalendrierJour,
+ this.actionSelectionCalendrierJour,
+ this
+ );
+
+ panelAbsencesView.addListener(
+ this.Constantes.eventId.ongletVisible,
+ this.actionAbsencesVisibles,
+ this
+ )
+ },
+
+ actionSelectionCalendrierJour:function (moisPosition, jourPosition, eleveId) {
+ eliot.commun.AjaxHelper.request({
+ url:this.ConfigServeur.url.getDetailDuJour,
+
+ params:{
+ eleveId:eleveId,
+ moisPosition:moisPosition + 1,
+ jourPosition:jourPosition
+ },
+
+ success:function (reponse) {
+ this.chargeDetailData(reponse);
+ },
+
+ failure:function (reponse) {
+ // pas de message à afficher
+ },
+
+ scope:this
+ });
+ },
+
+ actionAbsencesVisibles:function (eleveId) {
+
+ eliot.commun.AjaxHelper.request({
+ url:this.ConfigServeur.url.getEleveAbsences,
+
+ params:{
+ eleveId:eleveId
+ },
+
+ success:function (reponse) {
+ this.construitDetailStore(reponse);
+
+ this.construitTableauStore(reponse);
+
+ this.chargeCalendrierData(reponse);
+
+ this.notifieView(reponse);
+ },
+
+ failure:function (reponse) {
+ // pas de message à afficher
+ },
+
+ maskText:this.ConfigServeur.message.loading,
+ scope:this
+ });
+
+ },
+
+ notifieView:function (donnees) {
+ this.fireEvent(
+ this.Constantes.eventId.ongletDataDisponible,
+ donnees,
+ this.detailStore,
+ this.tableauStore
+ );
+ },
+
+ construitDetailStore:function (resultats) {
+ if (this.plagesHorairesInfo === resultats.plagesHorairesInfo) {
+ return this.detailStore;
+ }
+
+ this.plagesHorairesInfo = resultats.plagesHorairesInfo;
+
+ this.detailStore = this.getJsonStore(resultats.plagesHorairesInfo);
+
+ this.detailStore.loadData(resultats.detailDuJourData);
+ },
+
+ chargeCalendrierData:function (resultats) {
+ this.calendrierStore.loadData(resultats.calendrierData);
+ },
+
+ chargeDetailData:function (resultats) {
+ this.detailStore.loadData(resultats.detailDuJourData);
+
+ this.fireEvent(
+ this.Constantes.eventId.detailDuJourChange,
+ resultats.date
+ );
+ },
+
+ construitTableauStore:function (resultats) {
+ if (this.tableauDataIndex === resultats.tableauInfo.dataIndex) {
+ return;
+ }
+
+ this.tableauDataIndex = resultats.tableauInfo.dataIndex;
+
+ this.tableauStore = this.getJsonStore(resultats.tableauInfo.dataIndex);
+
+ this.tableauStore.loadData(resultats.tableauInfo.data);
+ },
+
+ getJsonStore:function (mapping) {
+ return new Ext.data.JsonStore({
+ autoDestroy:true,
+ fields:this.getStoreFieldsFromMap(mapping)
+ });
+ },
+
+ getStoreFieldsFromMap:function (mapping) {
+ var fields = [];
+ for (var key in mapping) {
+ fields.push(key);
+ }
+
+ return fields;
+ }
+
+});
\ 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>.
+ */
+
+/**
+ * Onglet des absences
+ * @author bahj
+ */
+
+Ext.ns('eliot.ficheeleve');
+
+eliot.ficheeleve.AbsencesPanelView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.ns = eliot.ficheeleve;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ this.Config = config;
+
+ this.eleveId = undefined;
+
+ this.addEvents(
+ /**
+ * @event actionSelectionCalendrierJour : levé suite à l'action
+ * de sélection dans le calendrier
+ * @params rowIndex
+ * @params colIndex
+ */
+ this.Constantes.eventId.actionSelectionCalendrierJour,
+
+ /**
+ * @event ongletVisible : levé suite à l'action
+ * de sélection de l'onglet des absences
+ */
+ this.Constantes.eventId.ongletVisible
+ );
+
+ this.panel = new Ext.Panel(this.getConfigPanel());
+
+ },
+
+ getConfigPanel:function () {
+
+ return {
+ padding:'5px',
+ border:false,
+ height:496,
+ autoScroll:true,
+ items:[
+ this.getTableauFieldSet(),
+ this.getCalendrierFieldSet()
+ ]
+ };
+ },
+
+ getTableauFieldSet:function () {
+
+ return {
+ xtype:'fieldset',
+ cls:'fieldSet-container',
+ bodyStyle:'padding:0 0 0 5px',
+ title:this.ConfigServeur.libelle.tableau,
+ collapsible:true,
+ titleCollapse:true,
+ items:[
+ this.getAbsenteisme(),
+ this.getTableauAbsences()
+ ]
+ };
+ },
+
+ getAbsenteisme:function () {
+
+ this.absenteismeField = new Ext.form.DisplayField({
+ value:" ",
+ style:"margin-left:450px;font-size:11px;padding-top:0;"
+ });
+
+ return this.absenteismeField;
+ },
+
+ getTableauAbsences:function () {
+
+ this.tableauGrid = new Ext.grid.GridPanel({
+ baseCls:'eliot-patch-ie-wrap x-panel',
+ cls:'portal-default_table abs-tableau',
+ border:false,
+ store:this.Config.tableauStore,
+ enableColumnMove:false,
+ enableColumnResize:false,
+ columnLines:true,
+ autoHeight:true,
+ cm:this.getColumnModele({})
+ });
+
+ return this.tableauGrid;
+ },
+
+ getCalendrierFieldSet:function () {
+
+ return {
+ xtype:'fieldset',
+ bodyStyle:'padding:0 0 0 5px',
+ cls:'fieldSet-container',
+ title:this.ConfigServeur.libelle.calendrier,
+ collapsible:true,
+ titleCollapse:true,
+ height:325,
+ layout:'border',
+ defaults:{
+ border:false,
+ frame:false
+ },
+ items:[
+ this.getRegionCentre(),
+ this.getRegionSud()
+ ]
+ };
+ },
+
+ getRegionCentre:function () {
+
+ this.calendrierAbsences = new Ext.grid.GridPanel({
+ cls:'abs-calendrier',
+ store:this.Config.calendrierStore,
+ enableColumnMove:false,
+ enableColumnResize:false,
+ columnLines:true,
+ border:false,
+ autoExpandColumn:this.Constantes.calendrierColExpanded,
+ cm:this.getCalendrierColumnModele(),
+ sm:new Ext.grid.CellSelectionModel()
+ });
+
+ this.observeCalendrierAbsences();
+
+ return {
+ region:'center',
+ layout:'fit',
+ items:this.calendrierAbsences
+ }
+ },
+
+ getRegionSud:function () {
+
+ return {
+ region:'south',
+ height:70,
+ defaults:{
+ border:false
+ },
+ items:[
+ this.getDetailJour(),
+ this.getPlagesHorairesGrille()
+ ]
+ };
+ },
+
+ getDetailJour:function () {
+
+ this.detailDuJourField = new Ext.form.DisplayField({
+ value:'',
+ style:"color:#416AA3;margin-bottom:3px;"
+ });
+
+ return this.detailDuJourField;
+ },
+
+ getValueDetailDisplayField:function (date) {
+ return this.ConfigServeur.libelle.detailDu + ' ' + date;
+ },
+
+ getPlagesHorairesGrille:function () {
+
+ this.detailGrid = new Ext.grid.GridPanel({
+ store:this.Config.detailStore,
+ enableColumnMove:false,
+ enableColumnResize:false,
+ columnLines:true,
+ autoHeight:true,
+ cm:this.getColumnModele({})
+ });
+
+ return this.detailGrid;
+ },
+
+ getColumnModele:function (columns) {
+
+ return new Ext.grid.ColumnModel({
+ defaults:{
+ sortable:false,
+ menuDisabled:true
+ },
+ columns:columns
+ });
+ },
+
+ getdetailGridColumn:function (plagesHorairesInfo) {
+ var columns = [];
+ for (var key in plagesHorairesInfo) {
+ if (!plagesHorairesInfo.hasOwnProperty(key)) {
+ return;
+ }
+ columns.push({
+ header:plagesHorairesInfo[key],
+ dataIndex:key,
+ width:50,
+ renderer:this.getPlageHoraireRenderer.createDelegate(this)
+ });
+ }
+
+ return columns;
+ },
+
+
+ getCalendrierColumnModele:function () {
+ var columns = [];
+
+ // Ajoute la première colonne : libellé du mois
+ columns.push({
+ header:' ',
+ dataIndex:this.Constantes.dataIndex.mois,
+ id:this.Constantes.calendrierColExpanded,
+ width:30
+ });
+
+ // Ajoute les colonnes jours
+ for (var i = 1; i <= 31; i++) {
+ columns.push({
+ header:'<span style="font-weight:bold;">' + i + '</span>',
+ dataIndex:this.Constantes.dataIndex.jour + i,
+ width:20,
+ renderer:this.getJourRenderer.createDelegate(this)
+ });
+ }
+
+ return this.getColumnModele(columns);
+ },
+
+ getPlageHoraireRenderer:function (val, metaData) {
+ if (!val) {
+ return;
+ }
+ if (val.toolTip) {
+ metaData.attr = 'ext:qtip="' + val.toolTip + '"';
+ }
+
+ return this.getDetailCellDiv(val);
+ },
+
+ getDetailCellDiv:function (val) {
+ var div = '';
+
+ switch (val.ouvert) {
+ case false:
+ div = this.getDetailDivFermee();
+ break;
+ case true:
+ div = 'abs';
+ var absencesDiv = this.getDetailDivAbsences(val);
+ div = absencesDiv ? absencesDiv : '';
+ break;
+ }
+
+ return div;
+ },
+
+ getDetailDivFermee:function () {
+ return this.getDiv(this.Constantes.class.detailPlageFermee);
+ },
+
+ getDetailDivAbsences:function (val) {
+ if (!val.couleur && val.sansMotif == undefined) {
+ return '';
+ }
+ return '<div class="' + this.getDetailAbsenceMotifClass(val) +
+
+ '">' +
+
+ '<div class="' + this.getDetailAbsenceTypeClass(val) + '">' +
+
+ this.getDetailRetardDepartDiv(val) +
+
+ '</div>' +
+ '</div>';
+
+ },
+
+ getDetailAbsenceMotifClass:function (val) {
+ var classMotif = '';
+
+ // Avec sans motif
+ if (val.sansMotif) {
+ classMotif = this.Constantes.class.detailSansMotif;
+ }
+
+ return classMotif +
+ '" style="background-color:' +
+ val.couleur + ';height:15px;"'
+ },
+
+ getDetailAbsenceTypeClass:function (val) {
+ // Absence non valable
+ if (val.nonValable) {
+ return this.Constantes.class.absNonValable;
+ }
+
+ // Absence previsionnelle
+ if (val.previsionnel) {
+ return this.Constantes.class.absPrevisionnelle;
+ }
+ },
+
+ getDetailRetardDepartDiv:function (val) {
+ var divRetard = '';
+ var divDepart = '';
+
+ // Retard
+ if (val.retard) {
+ divRetard = this.getDiv(this.Constantes.class.retard);
+ }
+
+ // Depart anticipé
+ if (val.depart) {
+ divDepart = this.getDiv(this.Constantes.class.depart);
+ }
+ return divRetard + divDepart;
+ },
+
+ getJourRenderer:function (val, metaData) {
+ if (!val.matin || !val.apresMidi) {
+ return;
+ }
+
+ var matinDiv = this.getCalendrierMoitieCellDiv(val.matin);
+
+ var apresMidiDiv = this.getCalendrierMoitieCellDiv(val.apresMidi);
+
+ metaData.css += this.Constantes.class.grilleCellule;
+
+ return matinDiv + apresMidiDiv;
+ },
+
+ getCalendrierMoitieCellDiv:function (val) {
+ var div = this.getCalendrierDivOuverte();
+
+ switch (val.ouvert) {
+ case false:
+ div = this.getCalendrierDivFermee();
+ break;
+ case true:
+ var absencesDiv = this.getCalendrierDivAbsences(val);
+ div = absencesDiv ? absencesDiv : div;
+ break;
+ }
+
+ return div;
+ },
+
+ getCalendrierDivFermee:function () {
+
+ return this.getDiv(this.Constantes.class.calendrierPlageFermee);
+ },
+
+ getCalendrierDivOuverte:function () {
+
+ return this.getDiv(this.Constantes.class.calendrierPlageOuverte);
+ },
+
+
+ getCalendrierDivAbsences:function (val) {
+ if (val.sansMotif === undefined) {
+ return undefined;
+ }
+
+ var motifClass = val.sansMotif ?
+ this.Constantes.class.sansMotif :
+ this.Constantes.class.avecMotif;
+
+ return '<div class="' + motifClass +
+ '" style="background-color:' + val.couleur +
+ '"> </div>';
+ },
+
+ getDiv:function (classCss) {
+
+ return '<div class="' + classCss + '"> </div>';
+ },
+
+
+ detailDuJourChange:function (date) {
+ this.detailDuJourField.setValue(
+ this.getValueDetailDisplayField(date)
+ );
+ },
+
+ observeCalendrierAbsences:function () {
+ this.calendrierAbsences.getSelectionModel().addListener({
+ cellselect:{
+ fn:function (selModel, rowIndex, columnIndex) {
+ if (columnIndex == 0) {
+ return;
+ }
+
+ this.fireEvent(
+ this.Constantes.eventId.actionSelectionCalendrierJour,
+ rowIndex,
+ columnIndex,
+ this.eleveId
+ );
+ }
+ },
+ beforecellselect:{
+ fn:function (grid, rowIndex, columnIndex) {
+ if (columnIndex == 0) {
+ return false;
+ }
+ }
+ },
+ scope:this
+ })
+ },
+
+ observeAbsencesPanelController:function (absencesPanelController) {
+ absencesPanelController.addListener(
+ this.Constantes.eventId.ongletDataDisponible,
+ this.finaliseContructionView,
+ this
+ );
+
+ absencesPanelController.addListener(
+ this.Constantes.eventId.detailDuJourChange,
+ this.detailDuJourChange,
+ this
+ );
+ },
+
+ finaliseContructionView:function (donnees, detailStore, tableauStore) {
+ this.detailDuJourChange(donnees.date);
+ this.selectionneCalendrierJour(donnees.moisPosition - 1, donnees.jourPosition);
+ this.setTauxAbsenteisme(donnees.tauxAbsenteisme);
+ this.reconfigureDetailGrid(detailStore, donnees.plagesHorairesInfo);
+ this.reconfigureTableauGrid(tableauStore, donnees.tableauInfo);
+ this.panel.show();
+ },
+
+ selectionneCalendrierJour:function (rowIndex, columnIndex) {
+ if (this.calendrierAbsences.getStore().getTotalCount() >= rowIndex) {
+ this.calendrierAbsences.getSelectionModel().select(rowIndex, columnIndex);
+ }
+ },
+
+ setTauxAbsenteisme:function (tauxAbsenteisme) {
+ this.absenteismeField.setValue(
+ this.ConfigServeur.libelle.tauxAbsences + ' : ' + tauxAbsenteisme);
+ },
+
+ reconfigureDetailGrid:function (store, plagesHorairesInfo) {
+ var columnModele = this.getColumnModele(
+ this.getdetailGridColumn(plagesHorairesInfo)
+ );
+
+ var gridWidth = columnModele.getTotalWidth();
+
+ this.detailGrid.reconfigure(
+ store,
+ columnModele
+ );
+
+ this.detailGrid.setWidth(gridWidth + 2);
+ },
+
+ reconfigureTableauGrid:function (store, tableauInfo) {
+ var columnModele = this.getColumnModele(
+ this.getTableauGridColumn(tableauInfo)
+ );
+
+ var gridWidth = columnModele.getTotalWidth();
+
+ this.tableauGrid.reconfigure(
+ store,
+ columnModele
+ );
+
+ this.tableauGrid.setWidth(gridWidth + 2);
+
+ Ext.fly(this.tableauGrid.getView().getHeaderCell(0)).addClass(
+ 'tableau-header-1-column'
+ );
+ },
+
+ getTableauGridColumn:function (tableauInfo) {
+ var columns = [];
+ for (var i = 0; i < tableauInfo.ordres.length; i++) {
+ var key = tableauInfo.ordres[i];
+ columns.push({
+ header:tableauInfo.dataIndex[key],
+ dataIndex:key,
+ width:40,
+ align:'center',
+ renderer:this.getTableauAbsencesRenderer.createDelegate(this)
+ });
+ }
+
+ columns[0] = this.getTableauPremiereColonne(columns);
+
+ return columns;
+ },
+
+ getTableauPremiereColonne:function (columns) {
+ var premiereColonne = columns[0];
+ premiereColonne.width = 105;
+ premiereColonne.css = 'font-weight:bold;background-color:#D7DCE7;color:#3F61A0;';
+ premiereColonne.renderer = undefined;
+ premiereColonne.align = 'left';
+ premiereColonne.header = '<div class=tableau-header-1-column>' +
+ premiereColonne.header +
+ '</div>';
+
+ return premiereColonne;
+ },
+
+ getTableauAbsencesRenderer:function (val, metaData) {
+ if (val === 0) {
+ return '';
+ }
+
+ return val;
+ },
+
+ onShow:function () {
+ if (this.eleveId === this.Config.model.getValue().eleveId) {
+ return;
+ }
+
+ this.eleveId = this.Config.model.getValue().eleveId;
+
+ this.panel.hide();
+
+ this.fireEvent(
+ this.Constantes.eventId.ongletVisible,
+ this.eleveId
+ );
+ },
+
+ fermer:function () {
+ this.eleveId = null;
+ }
+
+
+
+});
\ No newline at end of file
Ext.ns('eliot.ficheeleve');
-eliot.ficheeleve.Application = function() {
+eliot.ficheeleve.Application = function () {
var Clazz = Ext.extend(Ext.util.Observable, {
- constructor: function(config) {
+ constructor:function (config) {
this.init(eliot.ficheeleve, config);
this.creeItems();
+ Ext.QuickTips.init();
},
- init: function (ns, config) {
+ init:function (ns, config) {
this.ns = ns;
this.Constantes = this.ns.Constantes;
this.ConfigServeur = this.ns.ConfigServeur;
},
- getInterface: function () {
+ getInterface:function () {
return {
- afficheFicheEleve: this.afficheFicheEleve.createDelegate(this)
+ afficheFicheEleve:this.afficheFicheEleve.createDelegate(this)
}
},
- creeItems: function() {
+ creeItems:function () {
var model = new this.ns.FicheEleveModel({
- eleveId: undefined,
- isPersonneId: undefined,
- ficheEleve: undefined,
- voirOngletCommentaire: undefined,
- classes: undefined,
- classeId: undefined,
- naturePeriode: undefined,
- periode: undefined
+ eleveId:undefined,
+ isPersonneId:undefined,
+ ficheEleve:undefined,
+ voirOngletCommentaire:undefined,
+ donneesOngletSanctions:undefined,
+ classes:undefined,
+ classeId:undefined,
+ naturePeriode:undefined,
+ periode:undefined
});
var controller = new this.ns.FicheEleveController({
- model: model
+ model:model
}).getInterface();
var views = this.creeViews(model, controller.getViewInterface());
this.controller = controller;
},
- creeViews: function(model, controller) {
+ creeViews:function (model, controller) {
var elevePanelView = new eliot.ficheeleve.ElevePanelView({
- model: model,
- controller: controller
+ model:model,
+ controller:controller
}).getInterface();
var responsablePanelView1 = new eliot.ficheeleve.ResponsablePanelView({
- model: model,
- controller: controller,
- id: this.Constantes.id.responsable_1,
- title: this.ConfigServeur.libelle.blocResponsable1Titre
+ model:model,
+ controller:controller,
+ id:this.Constantes.id.responsable_1,
+ title:this.ConfigServeur.libelle.blocResponsable1Titre
}).getInterface();
var responsablePanelView2 = new eliot.ficheeleve.ResponsablePanelView({
- model: model,
- controller: controller,
- id: this.Constantes.id.responsable_2,
- title: this.ConfigServeur.libelle.blocResponsable2Titre
+ model:model,
+ controller:controller,
+ id:this.Constantes.id.responsable_2,
+ title:this.ConfigServeur.libelle.blocResponsable2Titre
}).getInterface();
var identitePanelView = new eliot.ficheeleve.IdentitePanelView({
- model: model,
- controller: controller,
- elevePanelView: elevePanelView,
- responsablePanelView1: responsablePanelView1,
- responsablePanelView2: responsablePanelView2
+ model:model,
+ controller:controller,
+ elevePanelView:elevePanelView,
+ responsablePanelView1:responsablePanelView1,
+ responsablePanelView2:responsablePanelView2
}).getInterface();
var commentairePanelView = new eliot.ficheeleve.CommentairePanelView({
- model: model,
- controller: controller
+ model:model,
+ controller:controller
}).getInterface();
+ /*Onglet sanctions*/
+ var sanctionsPanelController = new eliot.ficheeleve.SanctionsPanelController({
+ model:model,
+ controller:controller
+ });
+ var sanctionsPanelView = new eliot.ficheeleve.SanctionsPanelView(
+ sanctionsPanelController,
+ model
+ );
+ sanctionsPanelController.observeView(sanctionsPanelView);
+ sanctionsPanelView.observeController(sanctionsPanelController);
+
+ /*Onglet absences*/
+ var absencesPanelController = new eliot.ficheeleve.AbsencesPanelController();
+ var absencesPanelView = new eliot.ficheeleve.AbsencesPanelView({
+ calendrierStore:absencesPanelController.calendrierStore,
+ detailStore:absencesPanelController.detailStore,
+ tableauStore:absencesPanelController.tableauStore,
+ model:model
+ });
+ absencesPanelController.observeAbsencesPanelView(absencesPanelView);
+ absencesPanelView.observeAbsencesPanelController(absencesPanelController);
+
+
var conseilPanelView = new eliot.ficheeleve.ConseilPanelView({
- model: model,
- controller: controller
+ model:model,
+ controller:controller
}).getInterface();
var notePanelView = new eliot.ficheeleve.NotePanelView({
- model: model,
- controller: controller
+ model:model,
+ controller:controller
}).getInterface();
var ficheEleveView = new this.ns.FicheEleveView({
- model: model,
- controller: controller,
- identitePanelView: identitePanelView,
- commentairePanelView: commentairePanelView,
- conseilPanelView: conseilPanelView,
- notePanelView: notePanelView
+ model:model,
+ controller:controller,
+ identitePanelView:identitePanelView,
+ commentairePanelView:commentairePanelView,
+ conseilPanelView:conseilPanelView,
+ notePanelView:notePanelView,
+ sanctionsPanelView:sanctionsPanelView,
+ absencesPanelView:absencesPanelView
}).getInterface();
return {
- ficheEleveView: ficheEleveView,
- identitePanelView: identitePanelView,
- elevePanelView: elevePanelView,
- responsablePanelView1: responsablePanelView1,
- responsablePanelView2: responsablePanelView2,
- commentairePanelView: commentairePanelView,
- conseilPanelView: conseilPanelView,
- notePanelView: notePanelView
+ ficheEleveView:ficheEleveView,
+ identitePanelView:identitePanelView,
+ elevePanelView:elevePanelView,
+ responsablePanelView1:responsablePanelView1,
+ responsablePanelView2:responsablePanelView2,
+ commentairePanelView:commentairePanelView,
+ conseilPanelView:conseilPanelView,
+ notePanelView:notePanelView,
+ sanctionsPanelView:sanctionsPanelView,
+ absencesPanelView:absencesPanelView
}
},
* @param isPersonneId : true si on passe l'id de la personne, false si
* c'est l'id de l'autorité
*/
- afficheFicheEleve: function(id, isPersonneId) {
+ afficheFicheEleve:function (id, isPersonneId) {
if (isPersonneId == true) {
this.controller.afficheFicheEleveByEleveId(id);
}
moyenneEleve: undefined,
moyenneClasse: undefined,
avisConseilClasse: undefined,
- avisOrientation: undefined
+ avisOrientation: undefined,
+ absences:undefined,
+ sanctions:undefined,
+ tableau:undefined,
+ calendrier:undefined,
+ detailDu:undefined,
+ punitions:undefined,
+ incidents:undefined,
+ dateDebut:undefined,
+ dateFin:undefined,
+ date:undefined,
+ type:undefined,
+ responsable:undefined,
+ statut:undefined,
+ dateHeure:undefined,
+ typeIncident:undefined,
+ lieu:undefined,
+ gravite:undefined,
+ partenaires:undefined,
+ protagonistes:undefined,
+ dateIncorrecteDebFin:undefined,
+ dateIncorrecteAnneeScolaire:undefined,
+ chercher:undefined,
+ tauxAbsences:undefined
},
url : {
getFicheEleveByIdAutorite: undefined,
border: false,
frame: false,
autoScroll: true,
+ cls: 'no-row-height',
items: [
{
border: false,
Ext.ns('eliot.ficheeleve');
eliot.ficheeleve.Constantes = {
+ id:{
+ tabIdentite:'idTabIdentite',
+ tabCommentaires:'idTabCommentaires',
+ idDivMessages:'messages',
+ responsable_1:'responsable1',
+ responsable_2:'responsable2',
+ responsable:'responsable'
+ },
+
+ calendrierColExpanded:'mois',
+
+ dataIndex:{
+ mois:'mois',
+ jour:'jour'
+ },
- eventId: {
- change: 'change'
+ class:{
+ calendrierPlageFermee:'abs-calendrier-plage-fermee',
+ grilleCellule:'abs-grid-cell',
+ calendrierPlageOuverte:'abs-calendrier-plage-ouverte',
+ sansMotif:'sans-motif',
+ avecMotif:'avec-motif',
+ detailPlageFermee:'abs-detail-plage-fermee',
+ detailSansMotif:'detail-sans-motif',
+ retard:'retard',
+ depart:'depart',
+ absNonValable:'abs-non-valable',
+ absPrevisionnelle:'abs-previsionnelle',
+ tableauValeur:'tableau-valeur'
},
- id : {
- tabIdentite: 'idTabIdentite',
- tabCommentaires: 'idTabCommentaires',
- idDivMessages : 'messages',
- responsable_1 : 'responsable1',
- responsable_2 : 'responsable2',
- responsable : 'responsable'
+ eventId:{
+ chercheSanctions:'chercheSanctions',
+ erreur:'erreurSurDates',
+ chargeSanctions:'chargeSanctions',
+ change:'change',
+ chargeDates:'chargeDates',
+ actionSelectionCalendrierJour:'actionSelectionCalendrierJour',
+ ongletVisible:'ongletVisible',
+ configureDetailGrid:'configureDetailGrid',
+ configureTableauGrid:'configureTableauGrid',
+ ongletDataDisponible:'ongletDataDisponible',
+ detailDuJourChange:'detailDuJourChange'
},
- naturePeriode: {
- notation: 'NOTATION',
- examen: 'EXAMEN'
+ naturePeriode:{
+ notation:'NOTATION',
+ examen:'EXAMEN'
}
-};
\ No newline at end of file
+};
creeConfig:function () {
this.config = {
- model: undefined
+ model:undefined
};
return this.config;
},
getInterface:function () {
return {
- observeViews: this.observeViews.createDelegate(this),
+ observeViews:this.observeViews.createDelegate(this),
- afficheFicheEleveByEleveId: this.afficheFicheEleveByEleveId.createDelegate(this),
- afficheFicheEleveByAutoriteId: this.afficheFicheEleveByAutoriteId.createDelegate(this),
+ afficheFicheEleveByEleveId:this.afficheFicheEleveByEleveId.createDelegate(this),
+ afficheFicheEleveByAutoriteId:this.afficheFicheEleveByAutoriteId.createDelegate(this),
- getViewInterface: this.getViewInterface.createDelegate(this)
+ getViewInterface:this.getViewInterface.createDelegate(this)
}
},
- getViewInterface: function() {
+ getViewInterface:function () {
return {
- fermer: this.fermer.createDelegate(this),
+ fermer:this.fermer.createDelegate(this),
- showErreur: this.showErreur.createDelegate(this),
- resetMessages: this.resetMessages.createDelegate(this),
+ showErreur:this.showErreur.createDelegate(this),
+ resetMessages:this.resetMessages.createDelegate(this),
- enregistreCommentaires: this.enregistreCommentaires.createDelegate(this),
+ enregistreCommentaires:this.enregistreCommentaires.createDelegate(this),
- loadNotes: this.loadNotes.createDelegate(this),
+ loadNotes:this.loadNotes.createDelegate(this),
- getClasseConseilStore: this.getClasseConseilStore.createDelegate(this),
- getNaturePeriodeStore: this.getNaturePeriodeStore.createDelegate(this),
+ getClasseConseilStore:this.getClasseConseilStore.createDelegate(this),
+ getNaturePeriodeStore:this.getNaturePeriodeStore.createDelegate(this),
- getClasseNoteStore: this.getClasseNoteStore.createDelegate(this),
- getPeriodeStore: this.getPeriodeStore.createDelegate(this),
+ getClasseNoteStore:this.getClasseNoteStore.createDelegate(this),
+ getPeriodeStore:this.getPeriodeStore.createDelegate(this),
- getAppreciationStore: this.getAppreciationStore.createDelegate(this),
- loadConseil: this.loadConseil.createDelegate(this)
+ getAppreciationStore:this.getAppreciationStore.createDelegate(this),
+ loadConseil:this.loadConseil.createDelegate(this)
}
},
- observeViews: function(views) {
+ observeViews:function (views) {
this.views = Ext.apply({
- ficheEleveView: undefined,
- identitePanelView: undefined,
- elevePanelView: undefined,
- responsablePanelView1: undefined,
- responsablePanelView2: undefined,
- commentairePanelView: undefined,
- conseilPanelView: undefined,
- notePanelView: undefined
+ ficheEleveView:undefined,
+ identitePanelView:undefined,
+ elevePanelView:undefined,
+ responsablePanelView1:undefined,
+ responsablePanelView2:undefined,
+ commentairePanelView:undefined,
+ conseilPanelView:undefined,
+ notePanelView:undefined,
+ sanctionsPanelView:undefined,
+ absencesPanelView:undefined
}, views);
},
- afficheFicheEleveByEleveId: function(eleveId) {
+ afficheFicheEleveByEleveId:function (eleveId) {
this.afficheFicheEleve(this.ConfigServeur.url.getFicheEleveByIdPersonne,
eleveId);
},
- afficheFicheEleveByAutoriteId: function(autoriteId) {
+ afficheFicheEleveByAutoriteId:function (autoriteId) {
this.afficheFicheEleve(this.ConfigServeur.url.getFicheEleveByIdAutorite,
autoriteId);
},
- afficheFicheEleve: function(url, id) {
+ afficheFicheEleve:function (url, id) {
this.resetMessages();
-
Ext.Ajax.request({
- scope : this,
- url: url,
+ scope:this,
+ url:url,
- params : {
- eleveId: id
+ params:{
+ eleveId:id
},
- success : function(response) {
+ success:function (response) {
var resultats = Ext.decode(response.responseText);
if (resultats.success) {
this.views.ficheEleveView.afficheFenetre();
this.config.model.applyValue({
- eleveId: resultats.ficheEleve.eleve.id,
- ficheEleve: resultats.ficheEleve,
- voirOngletCommentaire: resultats.voirOngletCommentaire,
-
- classeNotesId: resultats.donneesNotes.classeId,
- classesNotes: resultats.donneesNotes.classesNotes,
-
- periode: this.getPeriode(
+ eleveId:resultats.ficheEleve.eleve.id,
+ ficheEleve:resultats.ficheEleve,
+ voirOngletCommentaire:resultats.voirOngletCommentaire,
+ donneesOngletSanctions:resultats.donneesOngletSanctions,
+ classeNotesId:resultats.donneesNotes.classeId,
+ classesNotes:resultats.donneesNotes.classesNotes,
+
+ periode:this.getPeriode(
resultats.donneesNotes.classesNotes,
resultats.donneesNotes.classeId),
- classeConseilId: resultats.donneesNotes.classeId,
- classesConseil: resultats.donneesNotes.classesConseil,
- naturePeriode: this.Constantes.naturePeriode.notation,
- typesAvis: resultats.donneesNotes.typesAvis
+ classeConseilId:resultats.donneesNotes.classeId,
+ classesConseil:resultats.donneesNotes.classesConseil,
+ naturePeriode:this.Constantes.naturePeriode.notation,
+ typesAvis:resultats.donneesNotes.typesAvis
});
}
else {
- this.showErreur(this.Modele.libelle.erreurInattendue);
+ this.showErreur(this.ConfigServeur.libelle.erreurInattendue);
}
},
- failure : function() {
- this.showErreur(this.Modele.libelle.erreurInattendue);
+ failure:function () {
+ this.showErreur(this.ConfigServeur.libelle.erreurInattendue);
}
});
/**
* Gère l'appel Ajax pour l'enregistrement des commentaires
*/
- enregistreCommentaires : function(commentaire){
+ enregistreCommentaires:function (commentaire) {
var value = this.config.model.getValue();
var params = {
- eleveId: value.eleveId,
- commentaire: commentaire
+ eleveId:value.eleveId,
+ commentaire:commentaire
};
Ext.Ajax.request({
- scope : this,
- url: this.ConfigServeur.url.saveCommentaire,
- params : params,
+ scope:this,
+ url:this.ConfigServeur.url.saveCommentaire,
+ params:params,
- success : function(response, request) {
+ success:function (response, request) {
var resultats = Ext.decode(response.responseText);
if (resultats.success) {
.afficheErreur(this.ConfigServeur.libelle.messageErreur)
}
},
- failure : function() {
+ failure:function () {
this.views.commentairePanelView
.afficheErreur(this.ConfigServeur.libelle.messageErreur)
}
},
- showErreur: function(message) {
+ showErreur:function (message) {
var messageErreur = message ? '<ul><li class="error">' + message +
'</li></ul>' : '';
Ext.get('messages').update(messageErreur);
},
- resetMessages: function() {
+ resetMessages:function () {
Ext.get('messages').update('');
},
- creeClasseConseilStore: function() {
+ creeClasseConseilStore:function () {
var store = new Ext.data.Store({
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- idProperty: 'id',
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ idProperty:'id',
fields:[
{name:'id', type:'string'},
{name:'libelle', type:'string'}
});
var value = this.config.model.getValue();
- if ((value.classesConseil != null) && (value.classesConseil != store.classes)){
+ if ((value.classesConseil != null) && (value.classesConseil != store.classes)) {
store.loadData(value.classesConseil);
store.classes = value.classesConseil;
}
this.config.model.addListener(this.Constantes.eventId.change,
- function(value) {
- if ((value.classesConseil != null) && (value.classesConseil != store.classes)){
+ function (value) {
+ if ((value.classesConseil != null) && (value.classesConseil != store.classes)) {
store.loadData(value.classesConseil);
store.classes = value.classesConseil;
}
return store;
},
- getClasseConseilStore: function() {
+ getClasseConseilStore:function () {
if (this.classeConseilStore == null) {
this.classeConseilStore = this.creeClasseConseilStore();
}
return this.classeConseilStore;
},
- creeNaturePeriodeStore: function() {
+ creeNaturePeriodeStore:function () {
var store = new Ext.data.Store({
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- idProperty: 'id',
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ idProperty:'id',
fields:[
{name:'id', type:'string'},
{name:'libelle', type:'string'}
});
var value = this.config.model.getValue();
- if ((value.classeConseilId != null) && (value.classeConseilId != store.classeId)){
+ if ((value.classeConseilId != null) && (value.classeConseilId != store.classeId)) {
store.loadData(this.getNaturePeriodeData(value.classesConseil, value.classeConseilId));
store.classeId = value.classeConseilId;
}
this.config.model.addListener(this.Constantes.eventId.change,
- function(value) {
- if ((value.classeConseilId != null) && (value.classeConseilId != store.classeId)){
+ function (value) {
+ if ((value.classeConseilId != null) && (value.classeConseilId != store.classeId)) {
store.loadData(this.getNaturePeriodeData(value.classesConseil, value.classeConseilId));
store.classeId = value.classeConseilId;
}
return store;
},
- getNaturePeriodeData: function(classes, classeId) {
+ getNaturePeriodeData:function (classes, classeId) {
for (var i = 0; i < classes.length; i++) {
var classe = classes[i];
if (classe.id == classeId) {
return [];
},
- getNaturePeriodeStore: function() {
+ getNaturePeriodeStore:function () {
if (this.naturePeriodeStore == null) {
this.naturePeriodeStore = this.creeNaturePeriodeStore();
}
return this.naturePeriodeStore;
},
- creeClasseNoteStore: function() {
+ creeClasseNoteStore:function () {
var store = new Ext.data.Store({
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- idProperty: 'id',
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ idProperty:'id',
fields:[
- {name: 'id', type: 'string'},
- {name: 'libelle', type: 'string'},
- {name: 'periodes'},
- {name: 'periodeEnCoursId', type: 'integer'}
+ {name:'id', type:'string'},
+ {name:'libelle', type:'string'},
+ {name:'periodes'},
+ {name:'periodeEnCoursId', type:'integer'}
]
})
});
var value = this.config.model.getValue();
- if ((value.classesNotes != null) && (value.classesNotes != store.classes)){
+ if ((value.classesNotes != null) && (value.classesNotes != store.classes)) {
store.loadData(value.classesNotes);
store.classes = value.classesNotes;
}
this.config.model.addListener(this.Constantes.eventId.change,
- function(value) {
- if ((value.classesNotes != null) && (value.classesNotes != store.classes)){
+ function (value) {
+ if ((value.classesNotes != null) && (value.classesNotes != store.classes)) {
store.loadData(value.classesNotes);
store.classes = value.classesNotes;
}
return store;
},
- getClasseNoteStore: function() {
+ getClasseNoteStore:function () {
if (this.classeNoteStore == null) {
this.classeNoteStore = this.creeClasseNoteStore();
}
return this.classeNoteStore;
},
- creePeriodeStore: function() {
+ creePeriodeStore:function () {
var store = new Ext.data.Store({
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- idProperty: 'id',
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ idProperty:'id',
fields:[
{name:'id', type:'string'},
{name:'libelle', type:'string'}
});
var value = this.config.model.getValue();
- if ((value.classeNotesId != null) && (value.classeNotesId != store.classeId)){
+ if ((value.classeNotesId != null) && (value.classeNotesId != store.classeId)) {
store.loadData(this.getPeriodeData(value.classesNotes, value.classeNotesId));
store.classeId = value.classeNotesId;
}
this.config.model.addListener(this.Constantes.eventId.change,
- function(value) {
- if ((value.classeNotesId != null) && (value.classeNotesId != store.classeId)){
+ function (value) {
+ if ((value.classeNotesId != null) && (value.classeNotesId != store.classeId)) {
store.loadData(this.getPeriodeData(value.classesNotes, value.classeNotesId));
store.classeId = value.classeNotesId;
}
return store;
},
- getPeriodeData: function(classes, classeId) {
+ getPeriodeData:function (classes, classeId) {
for (var i = 0; i < classes.length; i++) {
var classe = classes[i];
if (classe.id == classeId) {
return [];
},
- getPeriode: function(classes, classeId) {
+ getPeriode:function (classes, classeId) {
for (var i = 0; i < classes.length; i++) {
var classe = classes[i];
if (classe.id == classeId) {
return null;
},
- getPeriodeStore: function() {
+ getPeriodeStore:function () {
if (this.periodeStore == null) {
this.periodeStore = this.creePeriodeStore();
}
return this.periodeStore;
},
- fermer: function() {
+ fermer:function () {
this.bulletinParams = null;
this.conseilParams = null;
this.views.notePanelView.fermer();
this.views.conseilPanelView.fermer();
+ this.views.absencesPanelView.fermer();
+ this.views.sanctionsPanelView.fermer();
},
- loadNotes: function() {
+ loadNotes:function () {
var value = this.config.model.getValue();
}
this.bulletinParams = {
- eleveId: value.eleveId,
- periodeId: value.periode
+ eleveId:value.eleveId,
+ periodeId:value.periode
};
this.resetMessages();
eliot.commun.AjaxHelper.request({
- url: this.ConfigServeur.url.construisInfoBulletin,
+ url:this.ConfigServeur.url.construisInfoBulletin,
- params: this.bulletinParams,
+ params:this.bulletinParams,
- success: function(reponse) {
+ success:function (reponse) {
this.views.notePanelView.afficheBulletin({
- periodesPrecedentes: reponse.periodesPrecedentes,
- moyenneEleveGeneral: reponse.moyenneEleveGeneral,
- moyenneClasseGeneral: reponse.moyenneClasseGeneral,
- moyennesServices: reponse.moyennesServices,
- moyennesAjour: reponse.moyennesAjour,
- messageMoyennesNonAJour: reponse.messageMoyennesNonAJour
+ periodesPrecedentes:reponse.periodesPrecedentes,
+ moyenneEleveGeneral:reponse.moyenneEleveGeneral,
+ moyenneClasseGeneral:reponse.moyenneClasseGeneral,
+ moyennesServices:reponse.moyennesServices,
+ moyennesAjour:reponse.moyennesAjour,
+ messageMoyennesNonAJour:reponse.messageMoyennesNonAJour
});
},
- failure: function(reponse) {
+ failure:function (reponse) {
if ((reponse.message !== undefined) && (reponse.message !== '')) {
this.showErreur(reponse.message);
}
},
- maskText: this.ConfigServeur.message.loading,
- scope: this
+ maskText:this.ConfigServeur.message.loading,
+ scope:this
});
},
- loadConseil: function() {
+ loadConseil:function () {
var value = this.config.model.getValue();
if ((this.conseilParams != null)
- && (this.conseilParams.eleveId == value.eleveId)
- && (this.conseilParams.classeId == value.classeConseilId)
- && (this.conseilParams.naturePeriode == value.naturePeriode)) {
+ && (this.conseilParams.eleveId == value.eleveId)
+ && (this.conseilParams.classeId == value.classeConseilId)
+ && (this.conseilParams.naturePeriode == value.naturePeriode)) {
return;
}
this.conseilParams = {
- eleveId: value.eleveId,
- classeId: value.classeConseilId,
- naturePeriode: value.naturePeriode
+ eleveId:value.eleveId,
+ classeId:value.classeConseilId,
+ naturePeriode:value.naturePeriode
};
this.resetMessages();
eliot.commun.AjaxHelper.request({
- url: this.ConfigServeur.url.construisInfoConseil,
+ url:this.ConfigServeur.url.construisInfoConseil,
- params: this.conseilParams,
+ params:this.conseilParams,
- success: function(reponse) {
+ success:function (reponse) {
this.views.conseilPanelView.afficheRecapitulatif({
- tableauRecap: reponse.tableauRecap,
- moyennesAjour: reponse.moyennesAjour,
- messageMoyennesNonAJour: reponse.messageMoyennesNonAJour
+ tableauRecap:reponse.tableauRecap,
+ moyennesAjour:reponse.moyennesAjour,
+ messageMoyennesNonAJour:reponse.messageMoyennesNonAJour
});
this.getAppreciationStore().loadData(reponse.tableauRecap);
},
- failure: function(reponse) {
+ failure:function (reponse) {
if ((reponse.message !== undefined) && (reponse.message !== '')) {
this.showErreur(reponse.message);
}
},
- maskText: this.ConfigServeur.message.loading,
- scope: this
+ maskText:this.ConfigServeur.message.loading,
+ scope:this
});
},
- creeAppreciationStore: function() {
+ creeAppreciationStore:function () {
return new Ext.data.Store({
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- idProperty: 'periodeId',
- fields: [
- {name: 'periodeId', type: 'integer'},
- {name: 'periode', type: 'string'},
- {name: 'appreciation', type: 'string'}
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ idProperty:'periodeId',
+ fields:[
+ {name:'periodeId', type:'integer'},
+ {name:'periode', type:'string'},
+ {name:'appreciation', type:'string'}
]
})
});
},
- getAppreciationStore: function() {
+ getAppreciationStore:function () {
if (this.appreciationStore == null) {
this.appreciationStore = this.creeAppreciationStore();
}
applyValue: function(value) {
this.value = Ext.apply(this.value, value);
- this.fireEvent(this.Constantes.eventId.change, this.value);
+ this.fireEvent(this.Constantes.eventId.change, value);
},
setValue: function(value) {
eliot.ficheeleve.FicheEleveView = Ext.extend(Ext.util.Observable, {
- constructor: function(config) {
+ constructor:function (config) {
this.init(eliot.ficheeleve, config);
this.creeItems();
this.observeModel();
creeConfig:function () {
this.config = {
- model: undefined,
- controller: undefined,
- identitePanelView: undefined,
- commentairePanelView: undefined,
- conseilPanelView: undefined,
- notePanelView: undefined
+ model:undefined,
+ controller:undefined,
+ identitePanelView:undefined,
+ commentairePanelView:undefined,
+ conseilPanelView:undefined,
+ notePanelView:undefined,
+ absencesPanelView:undefined,
+ sanctionsPanelView:undefined
};
return this.config;
},
getInterface:function () {
return {
- afficheFenetre: this.afficheFenetre.createDelegate(this)
+ afficheFenetre:this.afficheFenetre.createDelegate(this)
}
},
- creeItems: function() {
+ creeItems:function () {
this.fermetureValidee = false;
this.btnFermer = new Ext.Button({
- text: this.ConfigServeur.libelle.fermer
+ text:this.ConfigServeur.libelle.fermer
});
this.tabCommentaire = new Ext.Panel({
- id: this.Constantes.id.tabCommentaires,
- title: this.ConfigServeur.libelle.ongletCommentaires,
- layout : 'fit',
- items : this.config.commentairePanelView.getItem()
+ id:this.Constantes.id.tabCommentaires,
+ title:this.ConfigServeur.libelle.ongletCommentaires,
+ layout:'fit',
+ items:this.config.commentairePanelView.getItem()
});
this.tabPnl = new Ext.TabPanel({
- activeTab: 0,
- border: false,
- items: [
+ activeTab:0,
+ border:false,
+ items:[
{
- id: this.Constantes.id.tabIdentite,
- title: this.ConfigServeur.libelle.ongletIdentite,
- layout: 'fit',
- items: this.config.identitePanelView.getItem(),
- view: this.config.identitePanelView
+ id:this.Constantes.id.tabIdentite,
+ title:this.ConfigServeur.libelle.ongletIdentite,
+ layout:'fit',
+ items:this.config.identitePanelView.getItem(),
+ view:this.config.identitePanelView
},
this.tabCommentaire,
+
+ {
+ title:this.ConfigServeur.libelle.absences,
+ items:this.config.absencesPanelView.panel,
+ view:this.config.absencesPanelView
+ },
+ {
+ title: this.ConfigServeur.libelle.sanctions,
+ layout: 'fit',
+ items: this.config.sanctionsPanelView.panel,
+ view: this.config.sanctionsPanelView
+ },
{
- title: this.ConfigServeur.libelle.ongletNote,
- layout : 'fit',
- items: this.config.notePanelView.getItem(),
- view: this.config.notePanelView
+ title:this.ConfigServeur.libelle.ongletNote,
+ layout:'fit',
+ items:this.config.notePanelView.getItem(),
+ view:this.config.notePanelView
},
{
- title: this.ConfigServeur.libelle.ongletConseil,
- layout : 'fit',
- items: this.config.conseilPanelView.getItem(),
- view: this.config.conseilPanelView
+ title:this.ConfigServeur.libelle.ongletConseil,
+ layout:'fit',
+ items:this.config.conseilPanelView.getItem(),
+ view:this.config.conseilPanelView
}
],
- listeners: {
- beforetabchange: function(tabPanel, tab) {
+ listeners:{
+ beforetabchange:function (tabPanel, tab) {
+
if ((tab.view != null) && (tab.view.onShow != null)) {
tab.view.onShow();
}
},
- scope: this
+ scope:this
}
});
this.fenetre = new Ext.Window({
- modal : true,
- width: 780,
- height : 570,
- resizable : false,
- draggable: true,
- monitorResize : true,
- layout : 'fit',
- labelWidth: 120,
- closeAction: 'hide',
- border : true,
- padding: 0,
- listeners: {
- beforehide : function() {
+ modal:true,
+ width:780,
+ height:590,
+ resizable:false,
+ draggable:true,
+ monitorResize:true,
+ layout:'fit',
+ labelWidth:120,
+ closeAction:'hide',
+ border:true,
+ padding:0,
+ listeners:{
+ beforehide:function () {
this.config.controller.resetMessages();
if (this.fermetureValidee) {
return true;
return false
}
},
- show : function() {
+ show:function () {
this.fermetureValidee = false;
},
- scope : this
+ scope:this
},
- defaults: {
- border: false
+ defaults:{
+ border:false
},
- items : this.tabPnl,
- buttons: [
+ items:this.tabPnl,
+ buttons:[
this.btnFermer
]
});
this.observeComposants();
},
- observeComposants : function() {
+ observeComposants:function () {
this.btnFermer.addListener("click",
- this.fermeFenetre,
- this
- );
+ this.fermeFenetre,
+ this
+ );
this.tabPnl.addListener("tabchange",
- this.actionChangeOnglet,
- this
- );
+ this.actionChangeOnglet,
+ this
+ );
},
/**
* Méthode à appeler pour fermer la fenêre
*/
- fermeFenetre : function() {
+ fermeFenetre:function () {
this.actionFermerFenetre();
this.config.controller.resetMessages();
},
/**
* Méthode interne de fermeture de la fenêtre
*/
- actionFermerFenetre : function () {
+ actionFermerFenetre:function () {
this.fenetre.hide();
this.config.controller.fermer();
},
* Affiche la fenêtre dans un état correspondant aux données à afficher
* doit être visible
*/
- afficheFenetre : function() {
+ afficheFenetre:function () {
this.tabPnl.setActiveTab(0);
this.fenetre.show();
},
- observeModel: function() {
+ observeModel:function () {
this.config.model.addListener(
this.Constantes.eventId.change,
- function(value) {
+ function (value) {
if ((value != null)
&& (value.ficheEleve != null)
&& (value.voirOngletCommentaire != null)) {
* @param voirOngletCommentaire : flag indiquant si l'onglet Commentaire
* doit être visible
*/
- initialiseDatas: function(ficheEleve, voirOngletCommentaire) {
+ initialiseDatas:function (ficheEleve, voirOngletCommentaire) {
this.fenetre.setTitle(this.ConfigServeur.libelle.ficheEleve + ' - ' +
- ficheEleve.eleve.nom + ' ' + ficheEleve.eleve.prenom + ' - ' +
- ficheEleve.eleve.classe);
+ ficheEleve.eleve.nom + ' ' + ficheEleve.eleve.prenom + ' - ' +
+ ficheEleve.eleve.classe);
if (!voirOngletCommentaire) {
this.tabPnl.remove(this.tabCommentaire);
}
-
- if (ficheEleve.responsable1 && ficheEleve.responsable2) {
- this.fenetre.setHeight(570);
- }
- else {
- this.fenetre.setHeight(420);
- }
-
},
/**
* @param tabpanel
* @param tab
*/
- actionChangeOnglet: function(tabpanel, tab) {
+ actionChangeOnglet:function (tabpanel, tab) {
if (tab.id === this.Constantes.id.tabCommentaires) {
this.config.commentairePanelView.effaceMessage();
}
* Gère le message de confirmation en cas de fermeture avec
* des modifications en cours
*/
- gereFermeture: function() {
+ gereFermeture:function () {
if (!this.config.commentairePanelView.changePending()) {
this.fermetureValidee = true;
this.actionFermerFenetre();
} else {
Ext.MessageBox.confirm(this.ConfigServeur.message.confirmationFermetureTitre,
- this.ConfigServeur.message.confirmationFermetureMessage,
- this.retourConfirmationFermeture,
- this
- )
+ this.ConfigServeur.message.confirmationFermetureMessage,
+ this.retourConfirmationFermeture,
+ this
+ )
}
},
* Retour de la confirmation de fermeture
* @param button
*/
- retourConfirmationFermeture: function(button) {
+ retourConfirmationFermeture:function (button) {
if (button === 'yes') {
this.fermetureValidee = true;
this.actionFermerFenetre();
border: false,
frame: false,
autoScroll: true,
+ cls: 'no-row-height',
items: [
{
border: 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>.
+ */
+
+/**
+ * controller "Onglet Sanctions" de la fiche élève
+ * @author jcok
+ */
+
+Ext.ns('eliot.ficheeleve');
+
+eliot.ficheeleve.SanctionsPanelController = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+
+ this.config = Ext.apply(this.creeConfig(), config);
+
+ this.ns = eliot.ficheeleve;
+
+ this.ConfigServeur = this.ns.Modele;
+ this.Constantes = this.ns.Constantes;
+
+ this.dateDebut = undefined;
+ this.dateFin = undefined;
+ this.dateDebutAnneeScolaire = undefined;
+ this.dateFinAnneeScolaire = undefined;
+
+ this.sanctionsStore = new Ext.data.JsonStore({
+ fields:[
+ {name:'date', type:'date', dateFormat:'m/d/Y'},
+ {name:'type', type:'string'},
+ {name:'responsable', type:'string'},
+ {name:'statut', type:'string'}
+ ]
+ });
+
+ this.punitionsStore = new Ext.data.JsonStore({
+ fields:[
+ {name:'date', type:'date', dateFormat:'m/d/Y'},
+ {name:'type', type:'string'},
+ {name:'responsable', type:'string'},
+ {name:'statut', type:'string'}
+ ]
+ });
+
+ this.incidentsStore = new Ext.data.JsonStore({
+ fields:[
+ {name:'dateHeure', type:'string'},
+ {name:'typeIncident', type:'string'},
+ {name:'lieu', type:'string'},
+ {name:'gravite', type:'integer'},
+ {name:'partenaires', type:'string'},
+ {name:'protagonistes', type:'string'}
+ ]
+ });
+
+ this.addEvents(
+ this.Constantes.eventId.erreur,
+ this.Constantes.eventId.chargeSanctions,
+ this.Constantes.eventId.chargeDates
+ );
+
+ },
+
+ observeView:function (sanctionsPanelView) {
+ sanctionsPanelView.addListener(
+ this.Constantes.eventId.chercheSanctions,
+ function (dateDebut, dateFin) {
+ var erreurMessage = null;
+
+ if (dateDebut && dateFin) {
+ erreurMessage = this.verifieDates(dateDebut, dateFin);
+ }
+
+ if (erreurMessage != null) {
+ this.fireEvent(
+ this.Constantes.eventId.erreur,
+ erreurMessage
+ );
+ return;
+ }
+
+ var params = {
+ eleveId:this.config.model.value.eleveId
+ };
+
+ if (dateDebut && dateFin) {
+ params.dateDebut = dateDebut;
+ params.dateFin = dateFin;
+ }
+
+ eliot.commun.AjaxHelper.request({
+
+ url:this.ConfigServeur.url.getSanctionsByEleveId,
+ params:params,
+
+ success:function (reponse) {
+ this.chargeDatas(reponse.donneesOngletSanctions);
+ },
+
+ failure:function (reponse) {
+ erreurMessage = this.ConfigServeur.libelle.erreurInattendue;
+ this.fireEvent(
+ this.Constantes.eventId.erreur,
+ erreurMessage
+ )
+ },
+
+ maskText:this.ConfigServeur.message.loading,
+ scope:this
+ });
+ },
+ this
+ )
+ },
+
+ verifieDates:function (dateDebut, dateFin) {
+ var erreurMessage = null;
+
+ if (dateDebut > dateFin) {
+ erreurMessage = this.ConfigServeur.libelle.dateIncorrecteDebFin
+ }
+ if (dateDebut < this.dateDebutAnneeScolaire || dateFin > this.dateFinAnneeScolaire) {
+ erreurMessage = this.ConfigServeur.libelle.dateIncorrecteAnneeScolaire
+ }
+
+ return erreurMessage
+ },
+
+ /**
+ * Affecte les données reçues aux stores
+ * @param donneesOngletSanctions
+ */
+ chargeDatas:function (donneesOngletSanctions) {
+ this.sanctionsStore.loadData(donneesOngletSanctions.sanctions);
+ this.punitionsStore.loadData(donneesOngletSanctions.punitions);
+ this.incidentsStore.loadData(donneesOngletSanctions.incidents);
+
+ this.dateDebut = new Date(donneesOngletSanctions.dateDebut);
+ this.dateFin = new Date(donneesOngletSanctions.dateFin);
+ this.dateDebutAnneeScolaire = new Date(donneesOngletSanctions.dateDebutAnneeScolaire);
+ this.dateFinAnneeScolaire = new Date(donneesOngletSanctions.dateFinAnneeScolaire);
+
+ this.nombreSanctions = this.sanctionsStore.getCount();
+ this.nombrePunitions = this.punitionsStore.getCount();
+ this.nombreIncidents = this.incidentsStore.getCount();
+
+ //Envoi des données nécessaires à la vue
+ this.fireEvent(
+ this.Constantes.eventId.chargeDates,
+ this.dateDebut,
+ this.dateFin,
+ this.nombreSanctions,
+ this.nombrePunitions,
+ this.nombreIncidents
+ );
+ },
+
+ creeConfig:function () {
+ this.config = {
+ model:undefined,
+ controller:undefined
+ };
+ return this.config;
+ }
+
+});
--- /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>.
+ */
+
+/**
+ * Panel "Onglet Sanctions" de la fiche élève
+ * @author jcok
+ */
+
+Ext.ns('eliot.ficheeleve');
+
+eliot.ficheeleve.SanctionsPanelView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (sanctionPanelController, model) {
+ this.ns = eliot.ficheeleve;
+ this.ConfigServeur = this.ns.Modele;
+ this.Constantes = this.ns.Constantes;
+
+ this.addEvents(
+ this.Constantes.eventId.chercheSanctions
+ );
+
+ this.model = model;
+ this.eleveId = undefined;
+ this.sanctionsStore = sanctionPanelController.sanctionsStore;
+ this.punitionsStore = sanctionPanelController.punitionsStore;
+ this.incidentsStore = sanctionPanelController.incidentsStore;
+
+ this.panel = new Ext.Panel(this.getConfigPanel());
+
+ this.observeComposants();
+ },
+
+ getConfigPanel:function () {
+ return {
+ title:this.ConfigServeur.libelle.sanctions,
+ layout:'border',
+ height:496,
+ border:false,
+ defaults:{
+ border:false
+ },
+ autoScroll:true,
+ items:[
+ {
+ region:'north',
+ height:65,
+ border:true,
+ items:[
+ this.getMessagePanel(),
+ this.getConfigDatePanel()
+ ]
+ },
+ {
+ region:'center',
+ height:200,
+ border:false,
+ frame:false,
+ padding:'5px',
+ items:this.getConfigTableaux()
+ }
+ ],
+ scope:this
+ };
+ },
+
+ getMessagePanel:function () {
+
+ this.messagePanel = new Ext.Panel({
+ height:30,
+ border:false,
+ frame:false,
+ html:'',
+ scope:this
+ });
+
+ return this.messagePanel;
+ },
+
+
+ getConfigDatePanel:function () {
+
+ this.dateDebut = new Ext.form.DateField(
+ this.getDateFieldConfig(this.ConfigServeur.libelle.dateDebut)
+ );
+ this.dateFin = new Ext.form.DateField(
+ this.getDateFieldConfig(this.ConfigServeur.libelle.dateFin)
+ );
+ this.boutonChercher = new Ext.Button({
+ text:this.ConfigServeur.libelle.chercher
+ });
+
+ return {
+ layout:'column',
+ padding:'0 10 0 20',
+ frame:true,
+ border:false,
+ height:30,
+ defaults:{
+ border:false,
+ layout:'form',
+ labelSeparator:' : '
+ },
+ items:[
+ {
+ width:250,
+ labelWidth:90,
+ items:this.dateDebut
+ },
+ {
+ width:350,
+ labelWidth:70,
+ items:this.dateFin
+ },
+ {
+ width:100,
+ items:this.boutonChercher
+ }
+ ],
+ scope:this
+ };
+ },
+
+ getDateFieldConfig:function (libelle) {
+
+ return {
+ fieldLabel:libelle,
+ width:90,
+ format:'d/m/Y'
+ }
+ },
+
+ getConfigTableaux:function () {
+ return [
+ this.getSanctionsFieldSet(),
+ this.getPunitionsFieldSet(),
+ this.getIncidentsFieldSet()
+ ]
+ },
+
+ getSanctionsFieldSet:function () {
+
+ this.sanctionsFieldSet = new Ext.form.FieldSet({
+ title:' ',
+ cls:'fieldSet-container',
+ collapsible:true,
+ titleCollapse:true,
+ collapsed:true, // fermé par défaut voir affichePanel()
+ items:this.getSanctionsTableau()
+ });
+
+ return this.sanctionsFieldSet;
+ },
+
+ getPunitionsFieldSet:function () {
+
+ this.punitionsFieldSet = new Ext.form.FieldSet({
+ title:' ',
+ cls:'fieldSet-container',
+ collapsible:true,
+ titleCollapse:true,
+ collapsed:true,
+ items:this.getPunitionsTableau()
+ });
+
+ return this.punitionsFieldSet;
+ },
+
+ getIncidentsFieldSet:function () {
+ this.incidentsFieldSet = new Ext.form.FieldSet({
+ title:' ',
+ cls:'fieldSet-container',
+ collapsible:true,
+ titleCollapse:true,
+ collapsed:true,
+ items:this.getIncidentsTableau()
+ });
+
+ return this.incidentsFieldSet;
+ },
+
+ getSanctionsTableau:function () {
+
+ var columnModele = new Ext.grid.ColumnModel({
+ defaults:{
+ sortable:false,
+ menuDisabled:true
+ },
+ columns:[
+ {
+ header:this.ConfigServeur.libelle.date,
+ width:85,
+ fixed:true,
+ sortable:false,
+ renderer:Ext.util.Format.dateRenderer('d/m/Y'),
+ dataIndex:'date'
+ },
+ {
+ header:this.ConfigServeur.libelle.type,
+ width:240,
+ sortable:false,
+ dataIndex:'type'
+ },
+ {
+ header:this.ConfigServeur.libelle.responsable,
+ width:150,
+ sortable:false,
+ dataIndex:'responsable'
+ },
+ {
+ header:this.ConfigServeur.libelle.statut,
+ width:150,
+ sortable:false,
+ dataIndex:'statut'
+ }
+ ]
+ });
+
+ return new Ext.grid.GridPanel({
+ cls:'onglet-sanctions',
+ border:false,
+ store:this.sanctionsStore,
+ cm:columnModele,
+ stripeRows:true,
+ height:102,
+ width:652
+ });
+ },
+
+
+ getPunitionsTableau:function () {
+
+ var columnModele = new Ext.grid.ColumnModel({
+ defaults:{
+ sortable:false,
+ menuDisabled:true
+ },
+ columns:[
+ {
+ header:this.ConfigServeur.libelle.date,
+ width:85,
+ sortable:false,
+ renderer:Ext.util.Format.dateRenderer('d/m/Y'),
+ dataIndex:'date'
+ },
+ {
+ header:this.ConfigServeur.libelle.type,
+ width:240,
+ sortable:false,
+ dataIndex:'type'
+ },
+ {
+ header:this.ConfigServeur.libelle.responsable,
+ width:150,
+ sortable:false,
+ dataIndex:'responsable'
+ },
+ {
+ header:this.ConfigServeur.libelle.statut,
+ width:150,
+ sortable:false,
+ dataIndex:'statut'
+ }
+ ]
+ });
+
+ return new Ext.grid.GridPanel({
+ cls:'onglet-sanctions',
+ border:false,
+ store:this.punitionsStore,
+ cm:columnModele,
+ stripeRows:true,
+ height:102,
+ width:652
+ });
+ },
+
+ getIncidentsTableau:function () {
+
+ var columnModele = new Ext.grid.ColumnModel({
+ defaults:{
+ sortable:false,
+ menuDisabled:true
+ },
+ columns:[
+ {
+ header:this.ConfigServeur.libelle.dateHeure,
+ width:100,
+ sortable:false,
+ dataIndex:'dateHeure'
+ },
+ {
+ header:this.ConfigServeur.libelle.typeIncident,
+ width:125,
+ sortable:false,
+ dataIndex:'typeIncident'
+ },
+ {
+ header:this.ConfigServeur.libelle.lieu,
+ width:150,
+ sortable:false,
+ dataIndex:'lieu'
+ },
+ {
+ header:this.ConfigServeur.libelle.gravite,
+ width:50,
+ sortable:false,
+ dataIndex:'gravite'
+ },
+ {
+ header:this.ConfigServeur.libelle.partenaires,
+ width:125,
+ sortable:false,
+ dataIndex:'partenaires',
+ renderer:this.getPartenaireRenderer.createDelegate(this)
+ },
+ {
+ header:this.ConfigServeur.libelle.protagonistes,
+ width:125,
+ sortable:true,
+ dataIndex:'protagonistes',
+ renderer:this.getProtagonisteRenderer.createDelegate(this)
+ }
+ ]
+ });
+
+ return new Ext.grid.GridPanel({
+ cls:'onglet-sanctions',
+ border:false,
+ store:this.incidentsStore,
+ cm:columnModele,
+ stripeRows:true,
+ height:102,
+ width:700
+ });
+ },
+
+ actionChercher:function () {
+ this.fireEvent(
+ this.Constantes.eventId.chercheSanctions,
+ this.dateDebut.getValue(),
+ this.dateFin.getValue()
+ )
+ },
+
+ observeComposants:function () {
+ this.boutonChercher.addListener(
+ "click",
+ this.actionChercher,
+ this
+ );
+ },
+
+ observeController:function (sanctionsPanelController) {
+ sanctionsPanelController.addListener(
+ this.Constantes.eventId.erreur,
+ function (erreurMessage) {
+
+ this.afficheErreur(erreurMessage);
+
+ this.affichePanel();
+ },
+ this
+ );
+ sanctionsPanelController.addListener(
+ this.Constantes.eventId.chargeDates,
+ function (dateDebut, dateFin, nombreSanctions, nombrePunitions, nombreIncidents) {
+ this.dateDebut.setValue(dateDebut);
+ this.dateFin.setValue(dateFin);
+ this.sanctionsFieldSet.setTitle(
+ this.ConfigServeur.libelle.sanctions +
+ ' (' + nombreSanctions + ')'
+ );
+ this.punitionsFieldSet.setTitle(
+ this.ConfigServeur.libelle.punitions +
+ ' (' + nombrePunitions + ')'
+ );
+ this.incidentsFieldSet.setTitle(
+ this.ConfigServeur.libelle.incidents +
+ ' (' + nombreIncidents + ')'
+ );
+ this.effaceMessage();
+
+ this.affichePanel();
+ },
+ this
+ );
+ },
+
+ afficheErreur:function (message) {
+ this.messagePanel.update('<div class="portal-messages"><ul><li class="error">'
+ + message + '</li></ul></div>');
+ },
+
+ effaceMessage:function () {
+ this.messagePanel.update(
+ '<div class="portal-messages"><ul><li> </li></ul></div>'
+ );
+ },
+
+ onShow:function () {
+ if (this.eleveId === this.model.getValue().eleveId) {
+ return;
+ }
+
+ this.eleveId = this.model.getValue().eleveId;
+
+ this.panel.hide();
+
+ this.fireEvent(
+ this.Constantes.eventId.chercheSanctions
+ );
+
+ },
+
+ getPartenaireRenderer:function (val, metaData) {
+ if (!val) {
+ return;
+ }
+
+ metaData.attr = 'ext:qtip="' + val + '"';
+
+ return val;
+ },
+
+ getProtagonisteRenderer:function (val, metaData) {
+ if (!val) {
+ return;
+ }
+
+ metaData.attr = 'ext:qtip="' + val + '"';
+
+ return val;
+ },
+
+ fermer:function () {
+ this.eleveId = null;
+ },
+
+ /*Affiche le panel,
+ * patch doLayout : permet de rafficher les éléments de formulaire (les dates, bouton chercher)
+ * patch sanctionsFieldSet.expand : permet d'avoir le scroll dans la grille des sanctions
+ */
+ affichePanel:function () {
+ this.panel.show();
+ this.panel.doLayout();
+ this.sanctionsFieldSet.expand();
+ }
+
+});
}
function cocherCheckBox() {
- console.log('passage fonction');
if (document.getElementById("checkAll").checked) {
this.toutCocher(true);
} else {
import org.lilie.services.eliot.absences.menu.MenuService
import org.lilie.services.eliot.AbstractEliotController
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.LieuIncidentService
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.PartenaireAPrevenirService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.QualiteProtagonisteService
import org.lilie.services.eliot.absences.fonctionnalites.AbsencesFonctionnalite
import org.lilie.services.eliot.securite.AutorisationException
import java.text.SimpleDateFormat
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypePunitionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
import org.lilie.services.eliot.parametrages.motifs.MotifService
import org.lilie.services.eliot.absences.consultation.ConsultationService
import org.lilie.services.eliot.scolarite.Personne
DroitsSessionService droitsSessionService
AnneeScolaireService anneeScolaireService
LieuIncidentService lieuIncidentService
- TypeIncidentService typeIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
PartenaireAPrevenirService partenaireAPrevenirService
QualiteProtagonisteService qualiteProtagonisteService
- TypePunitionService typePunitionService
- TypeSanctionService typeSanctionService
+ AbsencesTypePunitionService absencesTypePunitionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
MotifService motifService
ConsultationService consultationService
LocalPersonneService localPersonneService
protected List<Map> getAllTypesIncident() {
PreferencesEtablissementAbsences pref = getPreferencesEtablissementCourant()
List<Map> resultats = parseDataForJSON(
- typeIncidentService.getTypesIncident(pref)
+ absencesTypeIncidentService.getTypesIncident(pref)
)
return resultats
protected List<Map> getAllTypesPunition() {
PreferencesEtablissementAbsences pref = getPreferencesEtablissementCourant()
List<Map> resultats = parseDataForJSON(
- typePunitionService.getTypesPunition(pref)
+ absencesTypePunitionService.getTypesPunition(pref)
)
return resultats
}
protected List<Map> getAllTypesSanction() {
PreferencesEtablissementAbsences pref = getPreferencesEtablissementCourant()
List<Map> resultats = parseDataForJSON(
- typeSanctionService.getTypesSanction(pref)
+ absencesTypeSanctionService.getTypesSanction(pref)
)
return resultats
}
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentForEleveInfo
import java.text.SimpleDateFormat
import grails.converters.JSON
-import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
+import org.lilie.services.eliot.absences.saisie.discipline.incident.AbsencesIncidentService
import org.lilie.services.eliot.absences.Sanction
/**
*/
class JsonDisciplineController {
- IncidentService incidentService
+ AbsencesIncidentService absencesIncidentService
private final static NB_INCIDENT_PAR_PAGE = 5
def getIncidentsForEleveAndPunition = {
start--
}
- GrilleIncidentsForEleveInfo grilleInfo = incidentService.findIncidentByEleve(
+ GrilleIncidentsForEleveInfo grilleInfo = absencesIncidentService.findIncidentByEleve(
eleve,
incidentLie,
start,
*/
class ParametrageGeneralController extends AbstractAbsencesController {
- GeneralService generalService
+ AbsencesGeneralService absencesGeneralService
def index = {
verificationDroitFonctionnalite(AbsencesFonctionnalite.PARAMETRAGE_GENERAL)
// on complète le modèle
modele.preferencesEtablissement = pref
- modele.autoriseSaisie = generalService.getAutorisationSaisie(
+ modele.autoriseSaisie = absencesGeneralService.getAutorisationSaisie(
getSecuriteSession(),
pref
)
- modele.affichageEdt = generalService.getAffichageEdt(
+ modele.affichageEdt = absencesGeneralService.getAffichageEdt(
getSecuriteSession(),
pref
)
- modele.codePasDeDecompte = generalService.getPasDeDecompte(
+ modele.codePasDeDecompte = absencesGeneralService.getPasDeDecompte(
getSecuriteSession(),
pref
).code
]
] as JSON
- modele.tauxAbsencesModeCalculSelectionne = generalService.getTauxAbsencesModeCalcul(pref)
+ modele.tauxAbsencesModeCalculSelectionne = absencesGeneralService.getTauxAbsencesModeCalcul(pref)
def listeTypePlageHoraire = [
[
- id: generalService.CODE_LONGUEUR_PLAGE_HEURE,
+ id: absencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE,
libelle: message(code: 'absences.parametrage.general.libelle.longueur.heure')
],
[
- id: generalService.CODE_LONGUEUR_PLAGE_DEMI_HEURE,
+ id: absencesGeneralService.CODE_LONGUEUR_PLAGE_DEMI_HEURE,
libelle: message(code: 'absences.parametrage.general.libelle.longueur.demiheure')
]
] as JSON
modele.listeTypePlageHoraire = listeTypePlageHoraire
- modele.typePlageHoraire = generalService.getCodeLongueurPlage(pref)
+ modele.typePlageHoraire = absencesGeneralService.getCodeLongueurPlage(pref)
render(
view: '/parametrage/general/index',
String tauxAbsencesCalculMode = params.tauxAbsencesModeCalcul
// mis à jour l'autorisation de saisie hors emploi du temps
- generalService.setAutorisationSaisie(
+ absencesGeneralService.setAutorisationSaisie(
getSecuriteSession(),
pref,
autorisationSaisie
)
// mis à jour le pas de décompte
- generalService.setPasDeDecompte(
+ absencesGeneralService.setPasDeDecompte(
getSecuriteSession(),
pref,
codePasDeDecompte
)
//mis à jour de la durée des plages
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
getSecuriteSession(),
pref,
codeDureePlage
)
// mise à jour de la visibilité de l'emploi du temps dans la saisie absences
- generalService.setAffichageEdt(
+ absencesGeneralService.setAffichageEdt(
getSecuriteSession(),
pref,
afficherEdt
)
//mis à jour du mode de calcul du taux d'absences
- generalService.setTauxAbsencesCalculMode(
+ absencesGeneralService.setTauxAbsencesCalculMode(
getSecuriteSession(),
pref,
tauxAbsencesCalculMode
*/
class SaisieIncidentController extends AbstractAbsencesController {
- IncidentService incidentService
+ AbsencesIncidentService absencesIncidentService
CalendrierService calendrierService
AbsencesPreparationExportCSVService absencesPreparationExportCSVService
AffichageIncidentService affichageIncidentService
def sortInfo = JSON.parse(params.sortInfo)
int start = params.start ? Integer.parseInt(params.start) : 0
int limit = params.limit ? Integer.parseInt(params.limit) : nbLigneParPage
- ListeIncidentsInfo listeIncidents = incidentService.findIncidents(
+ ListeIncidentsInfo listeIncidents = absencesIncidentService.findIncidents(
securiteSession,
securiteSession.personne,
getPreferencesEtablissementCourant().etablissement,
Incident incident = Incident.get(Long.parseLong(params.id))
- resultats.isIncidentSupprimable = incidentService.
+ resultats.isIncidentSupprimable = absencesIncidentService.
internalIsIncidentReference(incident)
render resultats as JSON
Incident incident = null
try {
- incident = incidentService.creeIncident(getSecuriteSession(),
+ incident = absencesIncidentService.creeIncident(getSecuriteSession(),
incidentACreerParams
)
Incident incident = Incident.get(idIncident)
if (incident) {
try {
- incidentService.modifieIncident(getSecuriteSession(),
+ absencesIncidentService.modifieIncident(getSecuriteSession(),
incident,
incidentAModifierDto
)
Map resultats
if (incident) {
try {
- incidentService.supprimeIncident(
+ absencesIncidentService.supprimeIncident(
securiteSession,
incident
)
import org.lilie.services.eliot.absences.fonctionnalites.AbsencesFonctionnalite
import org.lilie.services.eliot.absences.page.Page
import org.lilie.services.eliot.absences.statistiques.Type
-import org.lilie.services.eliot.absences.statistiques.hebdomadaire.Jour
+
import org.lilie.services.eliot.absences.statistiques.hebdomadaire.StatsHebdos
import org.lilie.services.eliot.absences.statistiques.hebdomadaire.StatsHebdosService
import org.lilie.services.eliot.absences.statistiques.mensuelle.ModeCalcul
import org.lilie.services.eliot.absences.statistiques.mensuelle.*
import org.lilie.services.eliot.absences.statistiques.StatsMarshallerService
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
/**
* @author bahj
CalendrierService calendrierService
LocalStructureEnseignementService localStructureEnseignementService
- StatsMensuellesService statsMensuellesService
+ AbsencesStatsMensuellesService absencesStatsMensuellesService
AbsencesPreparationExportCSVService absencesPreparationExportCSVService
StatsMarshallerService statsMarshallerService
StatistiqueParserService statistiqueParserService
}
StatsMensuellesFiltresContenu statsMensuellesFiltresContenu =
- statsMensuellesService.getStatsMensuellesFiltresContenu(
+ absencesStatsMensuellesService.getStatsMensuellesFiltresContenu(
securiteSession,
pref,
classes,
private Map construitDatasTempsReel(
StatsMensuellesParams statsMensuellesParams) {
- StatsMensuelles statsMensuelles = statsMensuellesService.
+ StatsMensuelles statsMensuelles = absencesStatsMensuellesService.
calculeStatsMensuelles(
getSecuriteSession(),
statsMensuellesParams,
return criteria
}
-/**
- * Contruit et exécute la requête de sélection des lignes d'appel
- * @param criteres : les critères de sélection
- * @return une liste dont chaque élément contient pour chaque absence
- * - l'Appel
- * - l'AppelLigne
- * - la StructureEnseignement
- * - la Personne élève
- * - l'absenceJournee
- */
- BilanAbsencesParPersonneInfo findAbsencesDatas(BasicCriteresRecherche criteres) {
- if ((criteres.structIds.size() > 0) || (criteres.eleveIds)) {
- if (criteres.eleveIds?.contains((Long)-1)) {
- List<Autorite> autoriteEleves = localStructureEnseignementService.
- findAllAutoritesElevesForAllStructures(
- (Set<StructureEnseignement>) criteres.structIds.
- collect {StructureEnseignement.get(it)}
- )
- criteres.eleveIds = autoriteEleves*.id
- }
- return getAbsencesOrRetards(criteres)
- } else {
- return new BilanAbsencesParPersonneInfo()
- }
- }
}
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordLigne
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.AbsencesIncidentService
import org.lilie.services.eliot.absences.saisie.discipline.incident.ListeIncidentsInfo
import org.lilie.services.eliot.annuaire.FonctionEnum
import org.lilie.services.eliot.securite.Autorite
AbsencesSanctionService absencesSanctionService
AbsencesPunitionService absencesPunitionService
- IncidentService incidentService
+ AbsencesIncidentService absencesIncidentService
EleveRecupService eleveRecupService
AffichageIncidentService affichageIncidentService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.absences.TauxAbsencesCalculMode
-class GeneralService {
+class AbsencesGeneralService extends GeneralService{
static transactional = true
DroitsService droitsService
- static final Byte CODE_LONGUEUR_PLAGE_HEURE = 1
- static final Byte CODE_LONGUEUR_PLAGE_DEMI_HEURE = 2
- static final Float FACTEUR_LONGUEUR_PLAGE_HEURE = 1.0
- static final Float FACTEUR_LONGUEUR_PLAGE_DEMI_HEURE = 0.5
-
/**
* Retourne l'autorisation de saisir en dehors de l'emploi du temps
* @param securiteSesion la session courante
preferences.autoriseSaisieHorsEdt = autoriseSaisieHorsEdt
}
- /**
- * Retourne le pas de décompte
- * @param securiteSesion la session courante
- * @param preferences les préférences de la session courante
- * @return pasDeDecompte
- */
- PasDeDecompteEnum getPasDeDecompte(SecuriteSession securiteSession,
- PreferencesEtablissementAbsences preferences
- ) {
- // Vérifie les droits de consultation
- droitsService.verifieDroitsModificationParametragesGeneral(
- securiteSession,
- preferences
- )
-
- return PasDeDecompteEnum.parseByLibelle(
- preferences.pasDecompte
- )
- }
-
/**
* Modifie l'autorisation de saisir en dehors de l'emploi du temps
* @param securiteSesion la session courante
preferences.save(failOnError: true)
}
- /**
- * Retourne le code correspondant au paramètre de longueur de plage
- * @param preferences
- * @return 1 pour une heure, 2 pour une demi-heure
- */
- Byte getCodeLongueurPlage(preferences) {
- if (preferences.longueurPlage == FACTEUR_LONGUEUR_PLAGE_DEMI_HEURE) {
- return CODE_LONGUEUR_PLAGE_DEMI_HEURE
- } else {
- return CODE_LONGUEUR_PLAGE_HEURE
- }
- }
-
/**
* Retourne le mode de calcul du taux d'absences
* @param preferences
* @author bahj
*/
-public class TypeIncidentService {
+public class AbsencesTypeIncidentService extends TypeIncidentService {
static transactional = true
DroitsService droitsService
- def messageSource
-
- public final static String ELEMENT = "type d'incident"
/**
* Permet de créer un type d'incident
return internalCreeTypeIncident(pref, libelle)
}
- /**
- * Permet de créer un type d'incident
- * @param pref : la préfénerence de l'établissement
- * @param libelle : le libellé du type d'incident
- * @return type : type d'incident
- * @throws LibelleLongException
- * @throws CreationContraintException
- */
- private TypeIncident internalCreeTypeIncident(PreferencesEtablissementAbsences pref,
- String libelle
- ) throws LibelleLongException,
- CreationContraintException {
-
- TypeIncident type = new TypeIncident(
- preferencesEtablissement: pref,
- libelle: libelle
- )
-
- save(type)
-
- return type
- }
-
/**
* Permet de supprimer un type d'incident
* Vérifie les droits de suppression
return type
}
- /**
- * vérifie les propriétés du type
- * - le nombre de caractères mpax
- * - l'unicité
- * @param type
- * @param libelle
- * @throws LibelleLongException
- * @throws CreationContraintException
- */
- void save(TypeIncident type)
- throws LibelleLongException,
- CreationContraintException {
-
- // Validation du nombre de caractères [max 30]
- if (!type.validate(["libelle"])) {
- // Lève une exception
- throw new LibelleLongException(ELEMENT, type.libelle)
- }
-
- // Validation de la contrainte d'intégrité portée
- // sur le libellé et la préférence de l'établissement
- try {
- type.save(flush: true)
- }
- catch (DataIntegrityViolationException e) {
- throw new CreationContraintException(ELEMENT, type.libelle, e)
- }
- }
-
-/**
- * Récupère les types d'incidents
- * Si aucun types d'incidents n'est crées, il crée les types par défauts
- * @param pref
- * @return typeIncidents : la liste des types d'incidents
- */
- List<TypeIncident> getTypesIncident(PreferencesEtablissementAbsences pref) {
-
- List<TypeIncident> typesIncident = TypeIncident.withCriteria {
- eq('preferencesEtablissement.id', pref.id)
- order "libelle", "asc"
- }
- if (typesIncident.size() == 0) {
- typesIncident = creeTypesIncidentParDefaut(pref)
- }
-
- return typesIncident
- }
-
- private List<TypeIncident> creeTypesIncidentParDefaut(PreferencesEtablissementAbsences pref) {
-
- List<TypeIncident> typeIncidents = []
- for (DefaultsTypeIncident typeEnum: DefaultsTypeIncident.values()) {
- typeIncidents.add(getTypeIncident(pref,
- messageSource.getMessage(typeEnum.libelle, null, null))
- )
-
- }
-
- // Classement
- typeIncidents.sort {it.libelle}
-
- return typeIncidents
- }
-
- private TypeIncident getTypeIncident(PreferencesEtablissementAbsences pref,
- String libelle) {
-
- TypeIncident type = TypeIncident.
- findByLibelleAndPreferencesEtablissement(libelle, pref)
- if(type != null) {
- return type
- }
-
- Closure action = {
- return internalCreeTypeIncident(pref, libelle)
- }
-
- Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
- return TypeIncident.findByLibelleAndPreferencesEtablissement(libelle, pref)
- }
-
- return GormUtils.withSavepoint(action, onDataIntegrityViolation)
- }
-
-
}
* @author bahj
*/
-public class TypePunitionService {
+public class AbsencesTypePunitionService extends TypePunitionService {
static transactional = true
DroitsService droitsService
- def messageSource
- public final static String ELEMENT = "type de punition"
/**
* Permet de créer un type de punition
return internalCreeTypePunition(pref, libelle)
}
- private TypePunition internalCreeTypePunition(PreferencesEtablissementAbsences pref,
- String libelle
- ) throws LibelleLongException,
- CreationContraintException {
-
- TypePunition type = new TypePunition(
- preferencesEtablissement: pref,
- libelle: libelle
- )
-
- save(type)
-
- return type
- }
-
/**
* Permet de supprimer un type de punition
* Vérifie les droits de suppression
return type
}
-
-/**
- * vérifie les propriétés du type
- * - le nombre de caractères mpax
- * - l'unicité
- * @param type
- * @param libelle
- * @throws LibelleLongException
- * @throws CreationContraintException
- */
- void save(TypePunition type)
- throws LibelleLongException,
- CreationContraintException {
-
- // Validation du nombre de caractères [max 30]
- if (!type.validate(["libelle"])) {
- // Lève une exception
- throw new LibelleLongException(ELEMENT, type.libelle)
- }
-
- // Validation de la contrainte d'intégrité portée
- // sur le libellé et la préférence de l'établissement
- try {
- type.save(flush: true)
- }
- catch (DataIntegrityViolationException e) {
- throw new CreationContraintException(ELEMENT, type.libelle, e)
- }
-
- }
-
-/**
- * Récupère les types de punition
- * Si aucun types de punition n'est crées, il crée les types par défauts
- * @param pref
- * @return typePunition : la liste des types de punition
- */
- List<TypePunition> getTypesPunition(PreferencesEtablissementAbsences pref)
- throws LibelleLongException,
- CreationContraintException {
-
- List<TypePunition> typesPunition = TypePunition.withCriteria {
- eq('preferencesEtablissement.id', pref.id)
- order "libelle", "asc"
- }
- if (typesPunition.size() == 0) {
- typesPunition = creeTypesPunitionParDefaut(pref)
- }
-
- return typesPunition
- }
-
- private List<TypePunition> creeTypesPunitionParDefaut(
- PreferencesEtablissementAbsences pref
- ) throws LibelleLongException,
- CreationContraintException {
-
- List<TypePunition> typesPunition = []
- for (DefaultsTypePunition typeEnum: DefaultsTypePunition.values()) {
- typesPunition.add(getTypePunition(pref,
- messageSource.getMessage(typeEnum.libelle, null, null))
- )
- }
- // Classement
- typesPunition.sort {it.libelle}
-
- return typesPunition
- }
-
- private TypePunition getTypePunition(PreferencesEtablissementAbsences pref,
- String libelle
- ) throws LibelleLongException,
- CreationContraintException {
-
- TypePunition type = TypePunition.
- findByLibelleAndPreferencesEtablissement(libelle, pref)
- if(type != null) {
- return type
- }
-
- Closure action = {
- return internalCreeTypePunition(pref, libelle)
- }
-
- Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
- return TypePunition.findByLibelleAndPreferencesEtablissement(libelle, pref)
- }
-
- return GormUtils.withSavepoint(action, onDataIntegrityViolation)
- }
-
-
}
import org.lilie.services.eliot.absences.TypeSanction
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.SuppressionContraintException
import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.GormUtils
/**
* Classe sui contient les fonctions de manipulation de type de sanction
* @author bahj
*/
-public class TypeSanctionService {
+public class AbsencesTypeSanctionService extends TypeSanctionService {
static transactional = true
DroitsService droitsService
- def messageSource
-
- public final static String ELEMENT = "type de sanction"
/**
* Permet de créer un type de sanction
return internalCreeTypeSanction(pref, libelle)
}
- private TypeSanction internalCreeTypeSanction(PreferencesEtablissementAbsences pref,
- String libelle
- ) throws LibelleLongException,
- CreationContraintException {
-
- TypeSanction type = new TypeSanction(
- preferencesEtablissement: pref,
- libelle: libelle
- )
-
- save(type)
-
- return type
- }
-
/**
* Permet de supprimer un type de sanction
* Vérifie les droits de suppression
return type
}
- /**
- * vérifie les propriétés du type
- * - le nombre de caractères mpax
- * - l'unicité
- * @param type
- * @param libelle
- * @throws LibelleLongException
- * @throws CreationContraintException
- */
- void save(TypeSanction type)
- throws LibelleLongException,
- CreationContraintException {
-
- // Validation du nombre de caractères [max 30]
- if (!type.validate(["libelle"])) {
- // Lève une exception
- throw new LibelleLongException(ELEMENT, type.libelle)
- }
-
- // Validation de la contrainte d'intégrité portée
- // sur le libellé et la préférence de l'établissement
- try {
- type.save(flush: true)
- }
- catch (DataIntegrityViolationException e) {
- throw new CreationContraintException(ELEMENT, type.libelle, e)
- }
- }
-
-/**
- * Récupère les types de sanctions
- * Si aucun types de sanction n'est crées, il crée les types par défauts
- * @param pref
- * @return TypesSanction : la liste des types de sanction
- */
- List<TypeSanction> getTypesSanction(PreferencesEtablissementAbsences pref)
- throws LibelleLongException,
- CreationContraintException {
-
- List<TypeSanction> typesSanction = TypeSanction.withCriteria {
- eq('preferencesEtablissement.id', pref.id)
- order "libelle", "asc"
- }
- if (typesSanction.size() == 0) {
- typesSanction = creeTypesSanctionParDefaut(pref)
- }
-
- return typesSanction
- }
-
- private List<TypeSanction> creeTypesSanctionParDefaut(
- PreferencesEtablissementAbsences pref
- ) throws LibelleLongException,
- CreationContraintException {
-
- List<TypeSanction> typesSanction = []
- for (DefaultsTypeSanction typeEnum: DefaultsTypeSanction.values()) {
- typesSanction.add(getTypeSanction(pref,
- messageSource.getMessage(typeEnum.libelle, null, null))
- )
- }
-
- // Classement
- typesSanction.sort {it.libelle}
-
- return typesSanction
- }
-
- private TypeSanction getTypeSanction(PreferencesEtablissementAbsences pref,
- String libelle
- ) throws LibelleLongException,
- CreationContraintException {
-
- TypeSanction type = TypeSanction.
- findByLibelleAndPreferencesEtablissement(libelle, pref)
- if(type != null) {
- return type
- }
-
- Closure action = {
- return internalCreeTypeSanction(pref, libelle)
- }
-
- Closure onDataIntegrityViolation = { DataIntegrityViolationException e ->
- return TypeSanction.findByLibelleAndPreferencesEtablissement(libelle, pref)
- }
-
- return GormUtils.withSavepoint(action, onDataIntegrityViolation)
- }
-
-
}
publipostageCommand.modeleId
)
- List<EleveImpressionInfo> donneesEleve =
- (List<EleveImpressionInfo>)impressionRequetageAbsencesService.
+ List<EleveImpressionInfo> donneesEleve =(List<EleveImpressionInfo>)impressionRequetageAbsencesService.
lectureDonneesEleve(
publipostageCommand,
impressionSelectionRequeteService.findAllSelectionRequete(templateDocument),
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
+import org.lilie.services.eliot.applications.absences.IncidentService
/**
* Service de gestion des incidents
* @author bahj
*/
-class IncidentService {
+class AbsencesIncidentService extends IncidentService{
static transactional = true
DroitsService droitsService
* <http://www.cecill.info/licences.fr.html>.
*/
-
-
-
-
-
-
package org.lilie.services.eliot.absences.saisie.discipline.incident
/**
int nbIncidents
List<IncidentForEleveInfo> incidents
}
+
* <http://www.cecill.info/licences.fr.html>.
*/
-
-
-
-
-
-
package org.lilie.services.eliot.absences.saisie.discipline.incident
import java.text.SimpleDateFormat
Map getInfo(SimpleDateFormat sdf) {
return [
- id: this.id,
- selection: this.selectionne,
- date: sdf.format(this.dateIncident),
- type: this.typeIncident,
- gravite: this.gravite,
- qualite: this.libelleQualite
+ id: this.id,
+ selection: this.selectionne,
+ date: sdf.format(this.dateIncident),
+ type: this.typeIncident,
+ gravite: this.gravite,
+ qualite: this.libelleQualite
]
}
}
package org.lilie.services.eliot.absences.statistiques
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.parametrages.calendrier.CalendrierHebdoInfo
-import org.lilie.services.eliot.parametrages.calendrier.PlageHoraireInfo
-import org.lilie.services.eliot.absences.parametrage.general.GeneralService
-import org.lilie.services.eliot.absences.parametrage.general.PasDeDecompteEnum
+
import org.lilie.services.eliot.parametrages.calendrier.JourFerieInfo
import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
class CalendrierAbsencesService extends CalendrierService {
CalendrierService calendrierService
- GeneralService generalService
-
- /**
- * Compte les pas de decompte ouvert et non feriés) sur la période
- * @param securiteSession
- * @param dateDebut
- * @param dateFin
- * @return nbPasDeDecompteOuvert
- */
- Float countPasDeDecompteOuvertSurPeriode(SecuriteSession securiteSession,
- Date dateDebut,
- Date dateFin,
- PreferencesEtablissementAbsences preferencesEtablissementAbsences
- ) {
-
- ListeJoursAEvaluer listeJoursAEvaluer = findJoursAEvaluerSurPeriode(
- securiteSession,
- dateDebut,
- dateFin,
- preferencesEtablissementAbsences
- )
-
- List<JourFerieInfo> allJourFerieInfo =
- getJourFeriesInfoForPreferenceEtablissementAndDates(
- preferencesEtablissementAbsences,
- dateDebut,
- dateFin
- )
-
- allJourFerieInfo.each { JourFerieInfo jourFerieInfo ->
- JourAEvaluer jourAEvaluer = listeJoursAEvaluer.getJourAEvaluer(jourFerieInfo.date)
- if(!jourFerieInfo.etat.isOuvertMatin()){
- jourAEvaluer.nbPasDeDecompteMatin = 0
- }
- if(!jourFerieInfo.etat.isOuvertApresMidi()){
- jourAEvaluer.nbPasDeDecompteApresMidi = 0
- }
- }
-
- return listeJoursAEvaluer.countPasDeDecompte(
- preferencesEtablissementAbsences.pasDecompte
- )
- }
-
- /**
- * Retourne tous les jours à évaluer sur la période
- * (avec leur nombre de pas de decompte matin et aprem)
- * @param securiteSession
- * @param dateDebut
- * @param dateFin
- * @param preferencesEtablissementAbsences
- * @return listeJourAEvaluer
- */
- ListeJoursAEvaluer findJoursAEvaluerSurPeriode(
- SecuriteSession securiteSession,
- Date dateDebut,
- Date dateFin,
- PreferencesEtablissementAbsences preferencesEtablissementAbsences
- ) {
-
- String nomDuJour
- ListeJoursAEvaluer listeJoursAEvaluer = new ListeJoursAEvaluer()
-
- PasDeDecompteEnum pasDeDecompte = generalService.getPasDeDecompte(
- securiteSession,
- preferencesEtablissementAbsences
- )
- Byte longueurPlage = generalService.getCodeLongueurPlage(
- preferencesEtablissementAbsences
- ) // 2: Demiheure 1: heure
-
- CalendrierHebdoInfo calendrierHebdoInfo = calendrierService.getCalendrierHebdoInfo(preferencesEtablissementAbsences)
-
- for (date in dateDebut..dateFin) {
-
- nomDuJour = getNomDuJour(date)
- Float nbPasDeDecompteMatin
- Float nbPasDeDecompteApresMidi
-
- List<PlageHoraireInfo> plagesHorairesOuvertes = getPlagesHorairesOuvertesJour(
- nomDuJour,
- calendrierHebdoInfo
- )
-
- nbPasDeDecompteMatin = calculeNbPasDeDecompteOuverts(
- pasDeDecompte,
- longueurPlage,
- plagesHorairesOuvertes,
- true
- )
- nbPasDeDecompteApresMidi = calculeNbPasDeDecompteOuverts(
- pasDeDecompte,
- longueurPlage,
- plagesHorairesOuvertes,
- false
- )
-
- listeJoursAEvaluer.addJourAEvaluer(
- date,
- nbPasDeDecompteMatin,
- nbPasDeDecompteApresMidi
- )
-
- }
-
- return listeJoursAEvaluer
- }
-
- /**
- * Retourne un nombre de pas de decompte ouvert suivant le pas de decompte,
- * la longueur plage, et pour le matin ou l'après-midi,
- * ceci pour des plages horaires données
- * @param pasDeDecompte
- * @param longueurPlage
- * @param plagesHorairesOuvertes
- * @param matin
- * @return nbPasDeDecompteOuvert
- */
- private float calculeNbPasDeDecompteOuverts(
- PasDeDecompteEnum pasDeDecompte,
- byte longueurPlage,
- List<PlageHoraireInfo> plagesHorairesOuvertes,
- Boolean matin
- ) {
- Float nbPasDeDecompteOuvert = 0
- switch (pasDeDecompte) {
- case PasDeDecompteEnum.HEURE:
-
- switch (longueurPlage) {
- case GeneralService.CODE_LONGUEUR_PLAGE_DEMI_HEURE:
- nbPasDeDecompteOuvert = (Float) plagesHorairesOuvertes.findAll{
- it.matin == matin
- }.size() / 2
- break
- case GeneralService.CODE_LONGUEUR_PLAGE_HEURE:
- nbPasDeDecompteOuvert = plagesHorairesOuvertes.findAll{
- it.matin == matin
- }.size()
- break
- }
- break
- case PasDeDecompteEnum.DEMI_JOUR:
-
- Boolean matinOuvert = false
- Boolean apremOuvert = false
-
- plagesHorairesOuvertes.each {
- if (it.matin) {
- matinOuvert = true
- }
- if (!it.matin) {
- apremOuvert = true
- }
- }
-
- if (matinOuvert && matin) {
- nbPasDeDecompteOuvert += 1
- }
- if (apremOuvert && !matin) {
- nbPasDeDecompteOuvert += 1
- }
-
- break
- case PasDeDecompteEnum.JOUR:
- if (plagesHorairesOuvertes.size() > 0) {
- nbPasDeDecompteOuvert = 1
- }
- break
- }
- return nbPasDeDecompteOuvert
- }
-
- /**
- * Retourne le nom du jour pour une PlageHoraireInfo
- * en fonction du jour de la semaine
- * @param date
- * @return nomDuJour
- */
- private String getNomDuJour(Date date) {
- String nomDuJour = ''
-
- switch (date[Calendar.DAY_OF_WEEK]) {
- case 1:
- nomDuJour = 'jour7'
- break
- case 2:
- nomDuJour = 'jour1'
- break
- case 3:
- nomDuJour = 'jour2'
- break
- case 4:
- nomDuJour = 'jour3'
- break
- case 5:
- nomDuJour = 'jour4'
- break
- case 6:
- nomDuJour = 'jour5'
- break
- case 7:
- nomDuJour = 'jour6'
- break
- }
-
- return nomDuJour
- }
-
- /**
- * Retourne la liste des plagesHorairesInfo qui sont ouvertes (0)
- * pour un jour donné
- * @param nomDuJour
- * @param preferencesEtablissementAbsences
- * @param calendrierHebdoInfo
- * @return plagesHorairesOuvertes
- */
- private List<PlageHoraireInfo> getPlagesHorairesOuvertesJour(
- String nomDuJour,
- CalendrierHebdoInfo calendrierHebdoInfo
- ) {
- List<PlageHoraireInfo> plagesHorairesOuvertes =
- calendrierHebdoInfo.plageHoraires.findAll {it.getAt(nomDuJour) == 0}
-
- return plagesHorairesOuvertes
- }
/**
* Calcule les statistiques sur les plages horaires
import org.lilie.services.eliot.absences.statistiques.mensuelle.ModeCalcul
import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuelles
import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesParams
-import org.lilie.services.eliot.absences.statistiques.mensuelle.NiveauDetail
+import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesNiveau
import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesEleve
import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesStructure
--- /dev/null
+package org.lilie.services.eliot.absences.statistiques.mensuelle
+
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.absences.ScolariteService
+import org.lilie.services.eliot.annuaire.SecuriteSession
+
+/**
+ * Calcul des stats mensuelles.
+ * @author jbui
+ */
+class AbsencesStatsMensuellesService extends StatsMensuellesService {
+ ScolariteService scolariteService
+
+ StatsMensuellesFiltresContenu getStatsMensuellesFiltresContenu(
+ SecuriteSession securiteSession,
+ PreferencesEtablissementAbsences preferencesEtablissementAbsences,
+ String dataClasse,
+ SimpleDateFormat sdf,
+ Locale locale
+ ) {
+
+ return new StatsMensuellesFiltresContenu(
+ calendrier: calendrierService.getCalendrierForEtablissement(
+ preferencesEtablissementAbsences.etablissement
+ ),
+ classes: localStructureEnseignementService.findAllClasseByEtablissement(
+ preferencesEtablissementAbsences.etablissement
+ ),
+ eleves: scolariteService.findAllPersonneEleveForStructure(securiteSession, dataClasse),
+ groupeMotifs: preferencesEtablissementAbsences.groupeMotifs.toList(),
+ typeSanctions: typeSanctionService.getTypesSanction(
+ preferencesEtablissementAbsences
+ ),
+ typeIncidents: typeIncidentService.getTypesIncident(
+ preferencesEtablissementAbsences
+ ),
+ typePunitions: typePunitionService.getTypesPunition(
+ preferencesEtablissementAbsences
+ )
+ )
+ }
+}
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordParams
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordService
import org.lilie.services.eliot.annuaire.SecuriteSession
-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.parametrage.incidentpunitionsanction.PartenaireAPrevenirService
-import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
-
-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.appel.AppelTemporaire
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import java.text.SimpleDateFormat
import org.lilie.services.eliot.absences.saisie.discipline.punition.AbsencesPunitionService
import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
+import org.lilie.services.eliot.absences.saisie.discipline.incident.AbsencesIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypePunitionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
/**
* Donnees pour les tests d'integration specifiques a Absence
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
AppelService appelService
AbsenceJourneeService absenceJourneeService
- TypeIncidentService typeIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
PartenaireAPrevenirService partenaireAPrevenirService
- IncidentService incidentService
+ AbsencesIncidentService absencesIncidentService
AbsencesSanctionService absencesSanctionService
- TypeSanctionService typeSanctionService
- TypePunitionService typePunitionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
+ AbsencesTypePunitionService absencesTypePunitionService
AbsencesPunitionService absencesPunitionService
InitDonneesCommunesTestPreferencesAbsencesService initDonneesCommunesTestPreferencesAbsencesService
import org.lilie.services.eliot.absences.saisie.discipline.incident.PartenaireAPrevenirIncidentParams
import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
-import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
import org.lilie.services.eliot.absences.TypeIncident
import org.lilie.services.eliot.absences.LieuIncident
import org.lilie.services.eliot.absences.PartenaireAPrevenir
-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.parametrage.incidentpunitionsanction.PartenaireAPrevenirService
import org.lilie.services.eliot.absences.Punition
import org.lilie.services.eliot.absences.saisie.discipline.punition.PunitionParams
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
-
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
+import org.lilie.services.eliot.absences.saisie.discipline.incident.AbsencesIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypePunitionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
class InitDonneesCommunesTestDisciplineService extends InitDonneesCommunesTestAbsenceService {
org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
- IncidentService incidentService
- TypeIncidentService typeIncidentService
+ AbsencesIncidentService absencesIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
PartenaireAPrevenirService partenaireAPrevenirService
AbsencesSanctionService absencesSanctionService
- TypeSanctionService typeSanctionService
- TypePunitionService typePunitionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
+ AbsencesTypePunitionService absencesTypePunitionService
AbsencesPunitionService absencesPunitionService
InitDonneesCommunesTestPreferencesAbsencesService initDonneesCommunesTestPreferencesAbsencesService
partenaireAPrevenir: getPartenaireAPrevenir1(securiteSession, pref)
)
- return incidentService.creeIncident(
+ return absencesIncidentService.creeIncident(
securiteSession,
incidentParams
)
partenaireAPrevenir: getPartenaireAPrevenir1(securiteSession, pref)
)
- return incidentService.creeIncident(
+ return absencesIncidentService.creeIncident(
securiteSession,
incidentParams
)
Integer indice) {
TypeIncident result = TypeIncident.findByLibelleAndPreferencesEtablissement(PREFIXE_TYPE_INCIDENT_TEST + indice.toString(), pref)
if (!result) {
- result = typeIncidentService.creeTypeIncident(
+ result = absencesTypeIncidentService.creeTypeIncident(
securiteSession,
pref,
PREFIXE_TYPE_INCIDENT_TEST + indice.toString()
PREFIXE_TYPE_SANCTION_TEST + indice.toString(), pref
)
if (!result) {
- result = typeSanctionService.creeTypeSanction(
+ result = absencesTypeSanctionService.creeTypeSanction(
securiteSession,
pref,
PREFIXE_TYPE_SANCTION_TEST + indice.toString()
PREFIXE_TYPE_PUNITION_TEST + indice.toString(), pref
)
if (!result) {
- result = typePunitionService.creeTypePunition(
+ result = absencesTypePunitionService.creeTypePunition(
securiteSession,
pref,
PREFIXE_TYPE_PUNITION_TEST + indice.toString()
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.scolarite.etablissement.PreferencesEtablissementAbsencesService
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.parametrages.motifs.GroupeMotifService
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.test.InitDonneesCommunesTestPreferencesAbsencesService
import org.lilie.services.eliot.absences.saisie.discipline.sanction.AbsencesSanctionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
class AbsenceJourneeServiceIntegrationTests extends GrailsUnitTestCase {
AbsenceJourneeService absenceJourneeService
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
AbsencesSanctionService absencesSanctionService
- TypeSanctionService typeSanctionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
GroupeMotifService groupeMotifService
MotifService motifService
)
PreferencesEtablissementAbsences pref = preferencesEtablissementAbsencesService.
getPreferencesEtablissementForEtablissement(etablissement)
- typeSanction = typeSanctionService.creeTypeSanction(
+ typeSanction = absencesTypeSanctionService.creeTypeSanction(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import org.lilie.services.eliot.test.PopulationTestActeur
import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.absences.parametrage.general.GeneralService
+
import grails.test.GrailsUnitTestCase
import org.lilie.services.eliot.test.InitDonneesCommunesTestAbsenceService
+import org.lilie.services.eliot.absences.parametrage.general.AbsencesGeneralService
-class GeneralServiceTests extends GrailsUnitTestCase {
+class AbsencesGeneralServiceTests extends GrailsUnitTestCase {
- GeneralService generalService
+ AbsencesGeneralService absencesGeneralService
EtablissementService etablissementService
private String idExterneEtablissement = '440000000000002'
private PreferencesEtablissementAbsences preferenceEtab
void testSetTauxAbsencesCalculMode() {
- generalService.setTauxAbsencesCalculMode(securiteSession,
+ absencesGeneralService.setTauxAbsencesCalculMode(securiteSession,
preferenceEtab,
'NB_COURS_REEL_EDT')
package org.lilie.services.eliot.absences
import grails.test.GrailsUnitTestCase
-import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
+import org.lilie.services.eliot.absences.saisie.discipline.incident.AbsencesIncidentService
import org.lilie.services.eliot.test.PopulationTestActeur
import org.lilie.services.eliot.test.InitDonneesCommunesTestAbsenceService
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.test.PopulationTestEtablissement
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentParams
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeIncidentService
+
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.LieuIncidentService
import org.lilie.services.eliot.absences.saisie.discipline.incident.ProtagonisteIncidentParams
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.QualiteProtagonisteService
import org.lilie.services.eliot.test.InitDonneesCommunesTestDisciplineService
import org.lilie.services.eliot.absences.saisie.discipline.sanction.SanctionParams
-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
+import org.lilie.services.eliot.applications.absences.DisciplineCriteresRecherche
+import org.lilie.services.eliot.applications.absences.IncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypePunitionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
-class IncidentServiceIntegrationTests extends GrailsUnitTestCase {
+class AbsencesIncidentServiceIntegrationTests extends GrailsUnitTestCase {
- IncidentService incidentService
+ AbsencesIncidentService absencesIncidentService
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
InitDonneesCommunesTestDisciplineService initDonneesCommunesTestDisciplineService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
- TypeIncidentService typeIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
PartenaireAPrevenirService partenaireAPrevenirService
AbsencesSanctionService absencesSanctionService
AbsencesPunitionService absencesPunitionService
- TypeSanctionService typeSanctionService
- TypePunitionService typePunitionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
+ AbsencesTypePunitionService absencesTypePunitionService
GroupeMotifService groupeMotifService
+ IncidentService incidentService
SecuriteSession sessionDirecteur
)
//Création d'un incident simple
- Incident incident = incidentService.creeIncident(
+ Incident incident = absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams
)
//Tentative de création par un enseignant
Boolean exceptionLevee = false
try {
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionEnseignant,
incidentParams
)
//Tentative de création sur un autre établissement
exceptionLevee = false
try {
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur2,
incidentParams
)
exceptionLevee = false
try {
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParamsSansProtagoniste
)
exceptionLevee = false
try {
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParamsDescriptionTropLongue
)
Boolean exceptionLevee = false
try {
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams
)
Boolean exceptionLevee = false
try {
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams
)
incidentParamsAModifier1.date = nouvelleDate
incidentParamsAModifier1.description = nouvelleDescription
- Incident incidentModifie1 = incidentService.modifieIncident(
+ Incident incidentModifie1 = absencesIncidentService.modifieIncident(
sessionDirecteur,
incident,
incidentParamsAModifier1
IncidentParams incidentParamsAModifier2 = copieIncidentDansParams(incidentModifie1)
incidentParamsAModifier2.protagonistesParams[0].aSupprimer = true
- Incident incidentModifie2 = incidentService.modifieIncident(
+ Incident incidentModifie2 = absencesIncidentService.modifieIncident(
sessionDirecteur,
incidentModifie1,
incidentParamsAModifier2
),
qualiteProtagoniste: qualite1
)
- Incident incidentModifie3 = incidentService.modifieIncident(
+ Incident incidentModifie3 = absencesIncidentService.modifieIncident(
sessionDirecteur,
incidentModifie2,
incidentParamsAModifier3
IncidentParams incidentParamsAModifier4 = copieIncidentDansParams(incidentModifie3)
Boolean exceptionLevee = false
try {
- incidentModifie4 = incidentService.modifieIncident(
+ incidentModifie4 = absencesIncidentService.modifieIncident(
sessionEnseignant,
incidentModifie3,
incidentParamsAModifier4
incidentParamsAModifier5.protagonistesParams.clear()
exceptionLevee = false
try {
- incidentService.modifieIncident(
+ absencesIncidentService.modifieIncident(
sessionDirecteur,
incidentModifie4,
incidentParamsAModifier5
exceptionLevee = false
try {
- incidentService.modifieIncident(
+ absencesIncidentService.modifieIncident(
sessionDirecteur,
incidentModifie3,
incidentParamsAModifier6
id: null,
partenaireAPrevenir: partenaire4
)
- Incident incidentModifie = incidentService.modifieIncident(
+ Incident incidentModifie = absencesIncidentService.modifieIncident(
sessionDirecteur,
incident,
incidentParams
IncidentParams incidentParams2 = copieIncidentDansParams(incidentModifie)
incidentParams2.partenairesParams.clear()
- Incident incidentModifie2 = incidentService.modifieIncident(
+ Incident incidentModifie2 = absencesIncidentService.modifieIncident(
sessionDirecteur,
incidentModifie,
incidentParams2
Long absenceId = absence.id
- incidentService.supprimeIncident(sessionDirecteur, incident)
+ absencesIncidentService.supprimeIncident(sessionDirecteur, incident)
assertNull("Incident n'est pas supprime", Incident.findById(incidentId))
assertNull("Sanction n'est pas supprimee", Sanction.findById(sanctionId))
void testFindIncidents() {
creeListeIncidents()
- incidentService.findIncidents(
+ absencesIncidentService.findIncidents(
sessionDirecteur,
directeur,
pref.etablissement,
qualiteProtagoniste: qualite3
)
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams1
)
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams2
)
- incidentService.creeIncident(
+ absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams3
)
void testFindIncidentByEleve() {
videTableIncidents()
creeListeIncidents()
- GrilleIncidentsForEleveInfo result = incidentService.findIncidentByEleve(
+ GrilleIncidentsForEleveInfo result = absencesIncidentService.findIncidentByEleve(
initDonneesCommunesTestAbsenceService.getAutorite(
PopulationTestActeur.ELEVE_2_CLASSE_1
),
result.incidents.size(), 2
)
- GrilleIncidentsForEleveInfo result2 = incidentService.findIncidentByEleve(
+ GrilleIncidentsForEleveInfo result2 = absencesIncidentService.findIncidentByEleve(
initDonneesCommunesTestAbsenceService.getAutorite(
PopulationTestActeur.ELEVE_2_CLASSE_1
),
1,
result2.incidents.size()
)
- GrilleIncidentsForEleveInfo result3 = incidentService.findIncidentByEleve(
+ GrilleIncidentsForEleveInfo result3 = absencesIncidentService.findIncidentByEleve(
initDonneesCommunesTestAbsenceService.getAutorite(
PopulationTestActeur.ELEVE_2_CLASSE_1
),
partenaireAPrevenir: partenaire3
)
- Incident incident = incidentService.creeIncident(
+ Incident incident = absencesIncidentService.creeIncident(
sessionDirecteur,
incidentParams
)
private Sanction creeSanction(Incident incident) {
- TypeSanction typeSanction = typeSanctionService.creeTypeSanction(
+ TypeSanction typeSanction = absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
'Test-Sanction-Type1'
private Punition creePunition(Incident incident) {
- TypePunition typePunition1 = typePunitionService.creeTypePunition(
+ TypePunition typePunition1 = absencesTypePunitionService.creeTypePunition(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
return motif
}
+ void testFindIncidentForCriteres(){
+
+ Date date = new Date()
+
+ Incident incident = creeIncident()
+
+ DisciplineCriteresRecherche disciplineCriteresRecherche =
+ new DisciplineCriteresRecherche(
+ elevePersonneIds: [
+ Personne.findByAutorite(ProtagonisteIncident.findByIncident(incident).autorite).id
+ ],
+ dateDebut: date - 1,
+ dateFin: date + 1
+ )
+
+ List<Incident> allIncident =
+ incidentService.findIncidentsForCriteres(disciplineCriteresRecherche)
+
+ assertTrue('Un incident devrait être trouvée',allIncident.size() == 1)
+
+ }
+
}
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import org.lilie.services.eliot.securite.impl.Autorite
import grails.test.GrailsUnitTestCase
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypePunitionService
import org.lilie.services.eliot.test.PopulationTestActeur
-import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentService
+import org.lilie.services.eliot.absences.saisie.discipline.incident.AbsencesIncidentService
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.parametrage.incidentpunitionsanction.TypeIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
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.AbsencesPunitionService
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.scolarite.Calendrier
import org.lilie.services.eliot.absences.saisie.discipline.punition.exceptions.PunitionException
+import org.lilie.services.eliot.applications.absences.DisciplineCriteresRecherche
+import org.lilie.services.eliot.applications.absences.PunitionService
class AbsencesPunitionServiceTests extends GrailsUnitTestCase {
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
CalendrierService calendrierService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
- TypePunitionService typePunitionService
- IncidentService incidentService
- TypeIncidentService typeIncidentService
+ AbsencesTypePunitionService absencesTypePunitionService
+ AbsencesIncidentService absencesIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
AbsencesPunitionService absencesPunitionService
+ PunitionService punitionService
Etablissement etablissement
PreferencesEtablissementAbsences pref
calendrier = calendrierService.
getCalendrierForEtablissement(etablissement)
datePunition = calendrier.premierJour
- typePunition1 = typePunitionService.creeTypePunition(
+ typePunition1 = absencesTypePunitionService.creeTypePunition(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
'test--type punition 1'
)
- typePunition2 = typePunitionService.creeTypePunition(
+ typePunition2 = absencesTypePunitionService.creeTypePunition(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
securiteSessionEnseignant = initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.ENSEIGNANT_1
)
- typePunition3 = typePunitionService.creeTypePunition(
+ typePunition3 = absencesTypePunitionService.creeTypePunition(
securiteSessionDirecteur,
pref,
'test--type punition 3'
PopulationTestActeur.DIRECTION_1
)
- typeIncident1 = typeIncidentService.creeTypeIncident(
+ typeIncident1 = absencesTypeIncidentService.creeTypeIncident(
securiteSessionDirecteur,
pref,
'test--type incident 1'
Punition.get(idPunitionSupprimee)
)
}
+
+ void testFindPunitionForCriteres(){
+
+ Date date = new Date()
+
+ PunitionParams punitionParams = new PunitionParams(
+ date: date,
+ type: typePunition1,
+ isPunitionEffectuee: false,
+ eleve: personneEleve1,
+ censeur: personneCenseur1,
+ description: 'test--description punition 1',
+ incident: incident,
+ etablissement: etablissement,
+ preferences: pref
+ )
+
+ Punition punition = absencesPunitionService.creePunition(
+ securiteSessionDirecteur,
+ punitionParams
+ )
+
+ DisciplineCriteresRecherche disciplineCriteresRecherche =
+ new DisciplineCriteresRecherche(
+ elevePersonneIds: [personneEleve1.id],
+ dateDebut: date - 1,
+ dateFin: date + 1
+ )
+
+ List<Punition> allPunition =
+ punitionService.findPunitionsForCriteres(disciplineCriteresRecherche)
+
+ assertTrue('Une punition devrait être trouvée',allPunition.size() == 1)
+
+ }
+
}
\ No newline at end of file
import org.lilie.services.eliot.test.InitDonneesCommunesTestAbsenceService
import org.lilie.services.eliot.test.PopulationTestEtablissement
import org.lilie.services.eliot.test.PopulationTestActeur
-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.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.parametrage.incidentpunitionsanction.LieuIncidentService
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.QualiteProtagonisteService
import org.lilie.services.eliot.scolarite.Personne
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeIncidentService
+
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
+import org.lilie.services.eliot.absences.saisie.discipline.incident.AbsencesIncidentService
+import org.lilie.services.eliot.applications.absences.DisciplineCriteresRecherche
+import org.lilie.services.eliot.applications.absences.SanctionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
class AbsencesSanctionServiceTests extends GroovyTestCase {
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
- TypeSanctionService typeSanctionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
AbsencesSanctionService absencesSanctionService
- IncidentService incidentService
+ AbsencesIncidentService absencesIncidentService
LieuIncidentService lieuIncidentService
QualiteProtagonisteService qualiteProtagonisteService
LocalPersonneService localPersonneService
- TypeIncidentService typeIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
+ SanctionService sanctionService
Etablissement etablissement
PreferencesEtablissementAbsences preferences
)
)
- typeSanction = typeSanctionService.creeTypeSanction(
+ typeSanction = absencesTypeSanctionService.creeTypeSanction(
securiteSessionDirecteur,
preferences,
'Test-Sanction-Type1'
'Test--Sanction lieuInci'
)
- typeIncident = typeIncidentService.creeTypeIncident(
+ typeIncident = absencesTypeIncidentService.creeTypeIncident(
securiteSessionDirecteur,
preferences,
'Test--sanction Tyincident'
qualiteProtagoniste: qualiteProtagoniste
)
- incident = incidentService.creeIncident(
+ incident = absencesIncidentService.creeIncident(
securiteSessionDirecteur,
incidentParams
)
}
+ void testFindSanctionForCriteres(){
+
+ Date date = new Date()
+
+ SanctionParams sanctionParams = new SanctionParams(
+ etablissement: etablissement,
+ date: date,
+ typeSanction: typeSanction,
+ effectue: true,
+ eleve: eleve,
+ censeur: censeur,
+ description: "Test-Sanction-Supp",
+ incident: incident,
+ absenceLiee: false,
+ preferences: preferences
+ )
+
+ Sanction sanction = absencesSanctionService.creeSanction(
+ securiteSessionDirecteur,
+ sanctionParams
+ )
+
+ DisciplineCriteresRecherche disciplineCriteresRecherche =
+ new DisciplineCriteresRecherche(
+ elevePersonneIds: [eleve.id],
+ dateDebut: date - 1,
+ dateFin: date + 1
+ )
+
+ List<Sanction> allSanction =
+ sanctionService.findSanctionsForCriteres(disciplineCriteresRecherche)
+
+ assertTrue('Une sanction devrait être trouvée',allSanction.size() == 1)
+
+ }
+
+
+
+
}
import grails.test.*
import org.lilie.services.eliot.test.PopulationTestEtablissement
-import org.lilie.services.eliot.absences.parametrage.general.GeneralService
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.test.InitDonneesCommunesTestPreferencesAbsencesService
import org.lilie.services.eliot.test.PopulationTestClasse
+import org.lilie.services.eliot.absences.parametrage.general.AbsencesGeneralService
class BilanServiceTests extends GrailsUnitTestCase {
InitDonneesCommunesTestPreferencesAbsencesService initDonneesCommunesTestPreferencesAbsencesService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
- GeneralService generalService
+ AbsencesGeneralService absencesGeneralService
ImpressionRequetageAbsencesService impressionRequetageAbsencesService
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
// positionne motifs
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
package org.lilie.services.eliot.absences
-import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelService
import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelCommand
import org.lilie.services.eliot.test.InitDonneesCommunesTestAbsenceService
import org.lilie.services.eliot.test.PopulationTestActeur
import org.lilie.services.eliot.test.PopulationTestClasse
import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreLigneInfo
import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreJourInfo
-import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourCommand
-import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+
import org.lilie.services.eliot.test.InitDonneesCommunesTestPreferencesAbsencesService
import org.lilie.services.eliot.applications.absences.AbsencesType
+import org.lilie.services.eliot.absences.consultation.registremensuel.RegistreMensuelService
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourInfo
+import org.lilie.services.eliot.absences.consultation.registremensuel.DetailJourCommand
/**
* @author jbui
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.absences.statistiques.hebdomadaire.StatsHebdosService
-import org.lilie.services.eliot.absences.parametrage.general.GeneralService
+
import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesParams
import org.lilie.services.eliot.absences.statistiques.Type
import org.lilie.services.eliot.absences.statistiques.mensuelle.ModeCalcul
import org.lilie.services.eliot.AutoriteTypeEliot
import org.lilie.services.eliot.scolarite.personne.eleve.EleveAnnuaireService
import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
+import org.lilie.services.eliot.absences.parametrage.general.AbsencesGeneralService
/**
* @author bper
LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
- GeneralService generalService
+ AbsencesGeneralService absencesGeneralService
LocalStructureEnseignementService localStructureEnseignementService
TempsAgendaService tempsAgendaService
sessionDirecteur = initDonneesCommunesTestAbsenceService.
getSecuriteSession(PopulationTestActeur.DIRECTION_1)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
sessionDirecteur,
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
criteres = new StatsMensuellesParams(
import org.lilie.services.eliot.temps.Mois
import org.lilie.services.eliot.test.PopulationTestActeur
-import org.lilie.services.eliot.absences.parametrage.general.GeneralService
+import org.lilie.services.eliot.absences.parametrage.general.AbsencesGeneralService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.test.InitDonneesCommunesTestDisciplineService
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
InitDonneesCommunesTestDisciplineService initDonneesCommunesTestDisciplineService
- GeneralService generalService
+ AbsencesGeneralService absencesGeneralService
LocalStructureEnseignementService localStructureEnseignementService
private static String STRUCT_1_SEPT = 'STRUCT_1_SEPT'
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
StatsMensuellesParams criteresAbsencesSansMotif = new StatsMensuellesParams(
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
)
)
- generalService.setLongueurPlage(
+ absencesGeneralService.setLongueurPlage(
initDonneesCommunesTestAbsenceService.getSecuriteSession(
PopulationTestActeur.DIRECTION_1
),
pref,
- GeneralService.CODE_LONGUEUR_PLAGE_HEURE
+ AbsencesGeneralService.CODE_LONGUEUR_PLAGE_HEURE
)
import org.lilie.services.eliot.scolarite.anneescolaire.AnneeScolaireService
import org.lilie.services.eliot.test.PopulationTestActeur
import org.lilie.services.eliot.test.PopulationTestEtablissement
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeIncidentService
+
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.LibelleLongException
import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.exceptions.CreationContraintException
import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeIncidentService
class TypeIncidentIntegrationTests extends GrailsUnitTestCase {
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
AnneeScolaireService anneeScolaireService
LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
- TypeIncidentService typeIncidentService
+ AbsencesTypeIncidentService absencesTypeIncidentService
Etablissement etablissement
PreferencesEtablissementAbsences pref
// Crée un type d'incident
String libelle = 'Dispute'
- TypeIncident type = typeIncidentService.creeTypeIncident(
+ TypeIncident type = absencesTypeIncidentService.creeTypeIncident(
sessionDirecteur,
pref,
libelle
// Crée un type avec une session qui n'a pas le droit
Boolean exceptionDroitsLevee = false
try {
- typeIncidentService.creeTypeIncident(
+ absencesTypeIncidentService.creeTypeIncident(
sessionProfesseur,
pref,
libelle
String libelleLong = 'azertyuiopqsdfghjklmwxcvbnazert'
Boolean exceptionLibelleLevee = false
try {
- typeIncidentService.creeTypeIncident(
+ absencesTypeIncidentService.creeTypeIncident(
sessionDirecteur,
pref,
libelleLong
// Crée un doublon
Boolean exceptionDoublonLevee = false
try {
- typeIncidentService.creeTypeIncident(
+ absencesTypeIncidentService.creeTypeIncident(
sessionDirecteur,
pref,
libelle
String libelle = 'Dispute 2'
String libelle2 = 'Dispute 3'
String libelle3 = 'Dispute 3'
- TypeIncident type = typeIncidentService.creeTypeIncident(
+ TypeIncident type = absencesTypeIncidentService.creeTypeIncident(
sessionDirecteur,
pref,
libelle
)
// Modifie les propriétés
- typeIncidentService.modifieTypeIncident(sessionDirecteur, type, libelle2)
+ absencesTypeIncidentService.modifieTypeIncident(sessionDirecteur, type, libelle2)
TypeIncident typeMisAJour = TypeIncident.get(type.id)
assertEquals(typeMisAJour.libelle, libelle2)
// Modifie les propriétés avec une session qui n'a pas le droit
Boolean exceptionLevee = false
try {
- typeIncidentService.modifieTypeIncident(sessionProfesseur, type, libelle3)
+ absencesTypeIncidentService.modifieTypeIncident(sessionProfesseur, type, libelle3)
}
catch (AutorisationException e) {
exceptionLevee = true
void testSupprimeTypeIncident() {
// Crée un type
String libelle = 'Suppression'
- TypeIncident type = typeIncidentService.creeTypeIncident(
+ TypeIncident type = absencesTypeIncidentService.creeTypeIncident(
sessionDirecteur,
pref,
libelle
// Supprime le type avec une autorité qui n'a pas le droits
Boolean exceptionLevee = false
try {
- typeIncidentService.supprimeTypeIncident(sessionProfesseur, type)
+ absencesTypeIncidentService.supprimeTypeIncident(sessionProfesseur, type)
} catch (AutorisationException e) {
exceptionLevee = true
}
assertTrue exceptionLevee
// Supprime le type
- typeIncidentService.supprimeTypeIncident(sessionDirecteur, type)
+ absencesTypeIncidentService.supprimeTypeIncident(sessionDirecteur, type)
TypeIncident typeSupprime = TypeIncident.findByLibelle(libelle)
assertNull(typeSupprime)
}
void testGetTypesIncident() {
// récupère la liste des types, vérifie qu'elle contient les types par défaut
- List<String> libellesTypesIncidents = typeIncidentService.
+ List<String> libellesTypesIncidents = absencesTypeIncidentService.
getTypesIncident(pref)*.libelle
assertTrue("La liste doit contenir les 4 types par défaut", libellesTypesIncidents.size() >= 4)
// ajoute un type et vérife qu'il est dans la liste
String libelle = '123456'
- typeIncidentService.creeTypeIncident(
+ absencesTypeIncidentService.creeTypeIncident(
sessionDirecteur,
pref,
libelle
)
- List<String> libellesTypesIncidents2 = typeIncidentService.
+ List<String> libellesTypesIncidents2 = absencesTypeIncidentService.
getTypesIncident(pref)*.libelle
assertTrue(libellesTypesIncidents2.contains(libelle))
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.test.PopulationTestActeur
import org.lilie.services.eliot.test.PopulationTestEtablissement
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypePunitionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypePunitionService
import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
import org.lilie.services.eliot.annuaire.SecuriteSession
org.lilie.services.eliot.scolarite.etablissement.PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
AnneeScolaireService anneeScolaireService
LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
- TypePunitionService typePunitionService
+ AbsencesTypePunitionService absencesTypePunitionService
Etablissement etablissement
PreferencesEtablissementAbsences pref
// Crée un type de punition
String libelle = 'Punition'
- TypePunition type = typePunitionService.creeTypePunition(
+ TypePunition type = absencesTypePunitionService.creeTypePunition(
sessionDirecteur,
pref,
libelle
// Crée un type avec une session qui n'a pas le droit
Boolean exceptionDroitsLevee = false
try {
- typePunitionService.creeTypePunition(
+ absencesTypePunitionService.creeTypePunition(
sessionProfesseur,
pref,
libelle
String libelleLong = 'azertyuiopqsdfghjklmwxcvbnazert'
Boolean exceptionLibelleLevee = false
try {
- typePunitionService.creeTypePunition(
+ absencesTypePunitionService.creeTypePunition(
sessionDirecteur,
pref,
libelleLong
// Crée un doublon
Boolean exceptionDoublonLevee = false
try {
- typePunitionService.creeTypePunition(
+ absencesTypePunitionService.creeTypePunition(
sessionDirecteur,
pref,
libelle
String libelle = 'Punition 2'
String libelle2 = 'Punition 3'
String libelle3 = 'Punition 3'
- TypePunition type = typePunitionService.creeTypePunition(
+ TypePunition type = absencesTypePunitionService.creeTypePunition(
sessionDirecteur,
pref,
libelle
)
// Modifie les propriétés
- typePunitionService.modifieTypePunition(sessionDirecteur, type, libelle2)
+ absencesTypePunitionService.modifieTypePunition(sessionDirecteur, type, libelle2)
TypePunition typeMisAJour = TypePunition.get(type.id)
assertEquals(typeMisAJour.libelle, libelle2)
// Modifie les propriétés avec une session qui n'a pas le droit
Boolean exceptionLevee = false
try {
- typePunitionService.modifieTypePunition(sessionProfesseur, type, libelle3)
+ absencesTypePunitionService.modifieTypePunition(sessionProfesseur, type, libelle3)
}
catch (AutorisationException e) {
exceptionLevee = true
void testSupprimeTypePunition () {
// Crée un type
String libelle = 'Punition Suppression'
- TypePunition type = typePunitionService.creeTypePunition(
+ TypePunition type = absencesTypePunitionService.creeTypePunition(
sessionDirecteur,
pref,
libelle
// Supprime le type avec une autorité qui n'a pas le droits
Boolean exceptionLevee = false
try {
- typePunitionService.supprimeTypePunition(sessionProfesseur, type)
+ absencesTypePunitionService.supprimeTypePunition(sessionProfesseur, type)
} catch (AutorisationException e) {
exceptionLevee = true
}
assertTrue exceptionLevee
// Supprime le type
- typePunitionService.supprimeTypePunition(sessionDirecteur, type)
+ absencesTypePunitionService.supprimeTypePunition(sessionDirecteur, type)
TypePunition typeSupprime = TypePunition.findByLibelle(libelle)
assertNull(typeSupprime)
}
void testGetTypesPunition() {
// récupère la liste des types, vérifie qu'elle contient les types par défaut
- List<String> libellesTypesPunition = typePunitionService.
+ List<String> libellesTypesPunition = absencesTypePunitionService.
getTypesPunition(pref)*.libelle
assertTrue("La liste doit contenir les 2 éléments par défaut", libellesTypesPunition.size() >= 2)
// ajoute un type et vérife qu'il est dans la liste
String libelle = 'Punition ajoutée'
- typePunitionService.creeTypePunition(
+ absencesTypePunitionService.creeTypePunition(
sessionDirecteur,
pref,
libelle
)
- List<String> libellesTypesPunition2 = typePunitionService.
+ List<String> libellesTypesPunition2 = absencesTypePunitionService.
getTypesPunition(pref)*.libelle
assertTrue(libellesTypesPunition2.contains(libelle))
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.test.PopulationTestActeur
import org.lilie.services.eliot.test.PopulationTestEtablissement
-import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.TypeSanctionService
+import org.lilie.services.eliot.absences.parametrage.incidentpunitionsanction.AbsencesTypeSanctionService
import org.lilie.services.eliot.test.LocalInitDonneesCommunesTestService
import org.lilie.services.eliot.annuaire.SecuriteSession
PreferencesEtablissementAbsencesService preferencesEtablissementAbsencesService
AnneeScolaireService anneeScolaireService
LocalInitDonneesCommunesTestService localInitDonneesCommunesTestService
- TypeSanctionService typeSanctionService
+ AbsencesTypeSanctionService absencesTypeSanctionService
Etablissement etablissement
PreferencesEtablissementAbsences pref
// Crée un type de sanction
String libelle = 'Exclusion'
- TypeSanction type = typeSanctionService.creeTypeSanction(
+ TypeSanction type = absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
libelle
// Crée un type avec une session qui n'a pas le droit
Boolean exceptionDroitsLevee = false
try {
- typeSanctionService.creeTypeSanction(
+ absencesTypeSanctionService.creeTypeSanction(
sessionProfesseur,
pref,
libelle
String libelleLong = 'azertyuiopqsdfghjklmwxcvbnazert'
Boolean exceptionLibelleLevee = false
try {
- typeSanctionService.creeTypeSanction(
+ absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
libelleLong
// Crée un doublon
Boolean exceptionDoublonLevee = false
try {
- typeSanctionService.creeTypeSanction(
+ absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
libelle
String libelle = 'Exclusion 2'
String libelle2 = 'Exclusion 3'
String libelle3 = 'Exclusion 3'
- TypeSanction type = typeSanctionService.creeTypeSanction(
+ TypeSanction type = absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
libelle
)
// Modifie les propriétés
- typeSanctionService.modifieTypeSanction(sessionDirecteur, type, libelle2)
+ absencesTypeSanctionService.modifieTypeSanction(sessionDirecteur, type, libelle2)
TypeSanction typeMisAJour = TypeSanction.get(type.id)
assertEquals(typeMisAJour.libelle, libelle2)
// Modifie les propriétés avec une session qui n'a pas le droit
Boolean exceptionLevee = false
try {
- typeSanctionService.modifieTypeSanction(sessionProfesseur, type, libelle3)
+ absencesTypeSanctionService.modifieTypeSanction(sessionProfesseur, type, libelle3)
}
catch (AutorisationException e) {
exceptionLevee = true
void testSupprimeTypeSanction() {
// Crée un type
String libelle = 'Suppression'
- TypeSanction type = typeSanctionService.creeTypeSanction(
+ TypeSanction type = absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
libelle
// Supprime le type avec une autorité qui n'a pas le droits
Boolean exceptionLevee = false
try {
- typeSanctionService.supprimeTypeSanction(sessionProfesseur, type)
+ absencesTypeSanctionService.supprimeTypeSanction(sessionProfesseur, type)
} catch (AutorisationException e) {
exceptionLevee = true
}
assertTrue exceptionLevee
// Supprime le type
- typeSanctionService.supprimeTypeSanction(sessionDirecteur, type)
+ absencesTypeSanctionService.supprimeTypeSanction(sessionDirecteur, type)
TypeSanction typeSupprime = TypeSanction.findByLibelle(libelle)
assertNull(typeSupprime)
}
void testGetTypesSanction() {
// récupère la liste des types, vérifie qu'elle contient les types par défaut
- List<String> libellesTypesSanction = typeSanctionService.
+ List<String> libellesTypesSanction = absencesTypeSanctionService.
getTypesSanction(pref)*.libelle
assertTrue(
"La liste doit contenir les deux éléments par défaut",
// ajoute un type et vérife qu'il est dans la liste
String libelle = '123456'
- typeSanctionService.creeTypeSanction(
+ absencesTypeSanctionService.creeTypeSanction(
sessionDirecteur,
pref,
libelle
)
- List<String> libellesTypesSanction2 = typeSanctionService.
+ List<String> libellesTypesSanction2 = absencesTypeSanctionService.
getTypesSanction(pref)*.libelle
assertTrue(libellesTypesSanction2.contains(libelle))
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
import grails.plugin.spock.UnitSpec
-import org.lilie.services.eliot.parametrages.calendrier.JourFerieInfo
+
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import org.lilie.services.eliot.absences.parametrage.general.GeneralService
+import org.lilie.services.eliot.absences.parametrage.general.AbsencesGeneralService
import org.lilie.services.eliot.absences.statistiques.CalendrierAbsencesService
-import org.lilie.services.eliot.absences.statistiques.ListeJoursAEvaluer
+
import org.lilie.services.eliot.parametrages.calendrier.PlageHoraireInfo
import org.lilie.services.eliot.parametrages.calendrier.CalendrierHebdoInfo
import org.lilie.services.eliot.absences.parametrage.general.PasDeDecompteEnum
class CalendrierAbsencesServiceSpec extends UnitSpec{
CalendrierAbsencesService calendrierAbsencesService
- GeneralService generalService
+ AbsencesGeneralService absencesGeneralService
CalendrierService calendrierService
EvenementCalendrierService evenementCalendrierService
def setup() {
- generalService = Mock(GeneralService)
+ absencesGeneralService = Mock(AbsencesGeneralService)
calendrierService = Mock(CalendrierService)
evenementCalendrierService = Mock(EvenementCalendrierService)
calendrierAbsencesService = new CalendrierAbsencesService(
- generalService: generalService,
+ generalService: absencesGeneralService,
calendrierService: calendrierService,
evenementCalendrierService: evenementCalendrierService
)
then:
1* calendrierService.getCalendrierHebdoInfo(pref) >> calendrierHebdoInfo
- 1* generalService.getPasDeDecompte(securiteSession, pref) >> pasDeDecompte
- 1* generalService.getCodeLongueurPlage(pref) >> longueurPlage
+ 1* absencesGeneralService.getPasDeDecompte(securiteSession, pref) >> pasDeDecompte
+ 1* absencesGeneralService.getCodeLongueurPlage(pref) >> longueurPlage
1* evenementCalendrierService.getListeEvenementsForPreferencesEtablissementAndDates(
pref,
dateDebut,
height: 22px;
}
+.no-row-height .x-grid3-row {
+ height: auto;
+}
+
.txtSaisieArrivDep {
font-size: 12px;
}