--- /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
+
+class EleveArchiveAffiche {
+
+ Long id
+ Personne eleve
+ Periode periode
+
+ static mapping = {
+ table 'ent.eleve_archive_affiche'
+ id column: 'id', generator: 'sequence', params: [sequence: 'ent.eleve_archive_affiche_id_seq']
+ eleve column: 'personne_id'
+ periode column: 'periode_id'
+ }
+
+ static constraints = {
+ eleve(nullable: false)
+ periode(nullable: false)
+ }
+
+ public String toString() {
+ return "EleveArchiveAffiche {id=$id, eleveId=${eleve.id}, periodeId=${periode.id}"
+ }
+}
* Sinon elle contient les classes liées (pour le groupe local et le regroupement).
* @author msan
*/
- List<StructureEnseignement> getClassesFinales () {
+ List<StructureEnseignement> getClassesFinales() {
// TOREFACT : trouver un nom plus parlant
if (this.isClasse()) {
return [this]
NaturePeriode nature
static transients = [
- 'isAnnee',
- 'isNotation',
- 'ordre',
- 'typeIntervalle'
+ 'isAnnee',
+ 'isNotation',
+ 'ordre',
+ 'typeIntervalle',
+ 'typePeriodeEquivalent'
]
static constraints = {
if (obj.nature == NaturePeriode.NOTATION) {
return (val != null)
} else {
- return (val == null)
+ return (val == null)
}
}
}
/**
- * TypePeriode est Trimestre ou Semestre
- * @return true/false
- * @author msan
- */
+ * TypePeriode est Trimestre ou Semestre
+ * @return true/false
+ * @author msan
+ */
Boolean isXmestre() {
if (this.intervalle != null) {
return (this.intervalle.isXmestre())
return this.libelle
}
+ TypePeriode getTypePeriodeEquivalent() {
+ IntervalleEnum intevalleEquiv = this.intervalle?.intevalleEquivalent
+ if (intevalleEquiv != null) {
+ return TypePeriode.findByIntervalle(intevalleEquiv, [cache:true])
+ } else {
+ return null
+ }
+ }
}
// Récupère les informations sur les élèves (actifs & inactifs)
StructureEnseignementElevesListes elevesListes =
- eleveAnnuaireService.findStructureEnseignementElevesListes(classe, false)
+ eleveAnnuaireService.findStructureEnseignementElevesListes(classe, periode.typePeriode)
List<Periode> periodes = [periode]
}
elevesListes.elevesInactifs.each {Personne eleve ->
- SyntheseEleve syntheseEleve = creeSyntheseEleve(
+ syntheseEleves << creeSyntheseEleve(
eleve,
false,
creationParametres
)
- // Evol. cycle de vie des élèves : on n'affiche que les élèves sortis qui ont
- // des données
- boolean hasResultatElevePeriode = syntheseEleve.resultatElevePeriode?.getValeurAffichage() != null
- String appreciation = syntheseEleve.appreciationElevePeriode?.appreciation
- boolean hasAppreciationElevePeriode = appreciation != null && !"".equalsIgnoreCase(appreciation)
- boolean hasResultatEleveEnseignementPeriode =
- syntheseEleve.resultatEleveEnseignementPeriodes.find{it.getValeurAffichage() != null} != null
-
- if (hasResultatElevePeriode ||
- hasAppreciationElevePeriode ||
- hasResultatEleveEnseignementPeriode){
- syntheseEleves << syntheseEleve
- }
}
return syntheseEleves.sort {it.eleve.nomAffichage()}
import org.lilie.services.eliot.notes.Note
import org.lilie.services.eliot.constantes.ConstFonct
import org.hibernate.Query
+import org.lilie.services.eliot.scolarite.TypePeriode
+import org.lilie.services.eliot.scolarite.Periode
/**
* Ce service fournis des informations concernant les élèves à partir de
class EleveAnnuaireService {
static transactional = true
+
static final String HQL_ELEVES_BY_STRUCTURE_ENSEIGNEMENT_FETCH = """
select distinct p
from PersonneProprietesScolarite pps
ps.structureEnseignement = :structureEnseignement
and f.code = :codeFonction
"""
+
static final String HQL_ELEVES_BY_STRUCTURE_ENSEIGNEMENT_FETCH_AUTORITE = """
select distinct p
from PersonneProprietesScolarite pps
ps.structureEnseignement = :structureEnseignement
and f.code = :codeFonction
"""
+
static final String HQL_ELEVES_INACTIFS_BY_STRUCTURE = """
- SELECT p FROM PersonneProprietesScolarite pps
- INNER JOIN pps.personne p
- WHERE pps.proprietesScolarite.structureEnseignement.id = :structureId
- AND pps.proprietesScolarite.fonction.code = :fonctionCode
- AND NOT EXISTS (SELECT pps2.id FROM PersonneProprietesScolarite pps2
- WHERE pps2.personne.id = pps.personne.id
- AND pps2.proprietesScolarite.structureEnseignement.id = :structureId
- AND pps2.estActive = true)
- GROUP BY p.id
- """
- static final String HQL_ELEVES_INACTIFS_BY_STRUCTURE_WITH_NOTES = """
- SELECT p FROM PersonneProprietesScolarite pps
- INNER JOIN pps.personne p
- WHERE pps.proprietesScolarite.structureEnseignement.id = :structureId
- AND pps.proprietesScolarite.fonction.code = :fonctionCode
- AND pps.personne.autorite.id IN (:eleveAutoriteAyantNotesIds)
- AND NOT EXISTS (SELECT pps2.id FROM PersonneProprietesScolarite pps2
- WHERE pps2.personne.id = pps.personne.id
- AND pps2.proprietesScolarite.structureEnseignement.id = :structureId
- AND pps2.estActive = true)
- GROUP BY p.id
- """
+ SELECT p FROM PersonneProprietesScolarite pps
+ INNER JOIN pps.personne p
+ WHERE pps.proprietesScolarite.structureEnseignement.id = :structureId
+ AND pps.proprietesScolarite.fonction.code = :fonctionCode
+ AND NOT EXISTS (SELECT pps2.id FROM PersonneProprietesScolarite pps2
+ WHERE pps2.personne.id = pps.personne.id
+ AND pps2.proprietesScolarite.structureEnseignement.id = :structureId
+ AND pps2.estActive = true)
+ GROUP BY p.id
+ """
AnneeScolaireService anneeScolaireService
]
String queryPPS = """
- select distinct pps.personne
- from PersonneProprietesScolarite as pps
- left join fetch pps.personne.autorite,
- Service as service
- where pps.estActive = :actif
- and service.id in (:serviceIds)
- and pps.proprietesScolarite.structureEnseignement.id in (service.structureEnseignement.id)
- and pps.proprietesScolarite.fonction = :fonction
- order by pps.personne.nom, pps.personne.prenom
+ select distinct pps.personne
+ from PersonneProprietesScolarite as pps
+ left join fetch pps.personne.autorite,
+ Service as service
+ where pps.estActive = :actif
+ and service.id in (:serviceIds)
+ and pps.proprietesScolarite.structureEnseignement.id in (service.structureEnseignement.id)
+ and pps.proprietesScolarite.fonction = :fonction
+ order by pps.personne.nom, pps.personne.prenom
"""
if (serviceIds.size() > 0) {
debutNom: debutNom + '%'
]
String hql = """
- select distinct pps.personne
- from PersonneProprietesScolarite as pps
- where pps.personne.autorite.estActive = :actif
- and pps.estActive = :actif
- and pps.proprietesScolarite.fonction = :fonction
- and pps.proprietesScolarite.structureEnseignement.etablissement = :etablissement
- and upper(pps.personne.nom) like upper(:debutNom)
- order by pps.personne.nom, pps.personne.prenom
+ select distinct pps.personne
+ from PersonneProprietesScolarite as pps
+ where pps.personne.autorite.estActive = :actif
+ and pps.estActive = :actif
+ and pps.proprietesScolarite.fonction = :fonction
+ and pps.proprietesScolarite.structureEnseignement.etablissement = :etablissement
+ and upper(pps.personne.nom) like upper(:debutNom)
+ order by pps.personne.nom, pps.personne.prenom
"""
return Personne.executeQuery(hql, params)
}
}
/**
- * Retourne les élèves de la structure d'enseignement divisés en 2 sous-emsembles:
- * 1. Les élèves actifs dans la structure
- * 2. Les élève inactifs mais ayant des notes dans la structure
- * @author bper
- */
- StructureEnseignementElevesListes findStructureEnseignementElevesListes(StructureEnseignement structureEnseignement) {
- return findStructureEnseignementElevesListes(structureEnseignement, true)
- }
-
- /**
- * Retourne les élèves de la structure d'enseignement divisés en 2 sous-emsembles:
+ * Retourne les élèves de la structure d'enseignement divisés en 2 sous-ensembles:
* 1. Les élèves actifs dans la structure
- * 2. Tous les élève inactifs dans la structure ou si le parametre
- * "eleveNonActifAyantNotes" et true seulement les élève inactifs ayant
- * des notes dans la structure
+ * 2. Tous les élève inactifs dans la structure ou si le paramètre
+ *
+ * Si le paramètre typePeriode n'est pas null, les élèves inactifs sans
+ * données saisies pour ce type de période et non configurés pour etre affichés
+ * ne sont pas remontés. Sinon tous les élèves inactifs sont remontés.
+ *
* @author bper
*/
StructureEnseignementElevesListes findStructureEnseignementElevesListes(
StructureEnseignement structureEnseignement,
- Boolean eleveNonActifAyantNotes) {
+ TypePeriode typePeriode = null) {
// Récupère les élèves actuels (actifs) de la structure d'enseignement
List<Personne> eleveActifs = findAllEleveByStructureEnseignementFetchAutorite(
// Récupère les élèves ayant quitté (non actifs) la structure d'enseignement
// et ayant obtenu des notes dans cette structure
- List<Personne> eleveNonActifs = eleveNonActifAyantNotes == true ?
- findAllEleveNonActifAyantNotesByStructure(structureEnseignement) :
- findAllEleveNonActifByStructure(structureEnseignement)
+ List<Personne> eleveNonActifs = typePeriode ?
+ findAllEleveInactifAAficherPourTypePeriode(structureEnseignement, typePeriode) :
+ findAllEleveInactifByStructure(structureEnseignement)
// Tous les élèves (actifs et non actifs)
List<Personne> eleves = []
* Retourne les élève de la structure d'enseignement désactivés
* @author bper
*/
- List<Personne> findAllEleveNonActifByStructure(StructureEnseignement structureEnseignement) {
+ List<Personne> findAllEleveInactifByStructure(StructureEnseignement structureEnseignement) {
List<Personne> eleves =
(List<Personne>)Personne.executeQuery(HQL_ELEVES_INACTIFS_BY_STRUCTURE,
return eleves
}
+ private static final FIND_ALL_ELEVE_INACTIFS_A_AFFICHER_HQL = """
+ select distinct eleve
+ from PersonneProprietesScolarite pps
+ inner join pps.personne eleve
+ inner join fetch eleve.autorite autoriteEleve
+ inner join pps.proprietesScolarite ps
+ where pps.estActive = false
+ and ps.structureEnseignement.id = :structuretId
+ and ps.fonction.id = :fonctionId
+ and (
+ exists (
+ select 1 from EleveArchiveAffiche eaa
+ where eaa.eleve = eleve
+ and eaa.periode.id in (:periodeIds)
+ )
+ or
+ exists (
+ select 1 from AppreciationElevePeriode app
+ where app.eleve = autoriteEleve
+ and app.periode.id in (:periodeIds)
+ )
+ or
+ exists (
+ select 1 from AppreciationEleveEnseignementPeriode app
+ where app.eleve = autoriteEleve
+ and app.periode.id in (:periodeIds)
+ )
+ or
+ exists (
+ select 1 from Note note
+ inner join note.evaluation eval
+ inner join eval.periodes p
+ where note.eleve = autoriteEleve
+ and p.id in (:periodeIds)
+ )
+ )
+ """
+
/**
- * Retourne les élève de la structure d'enseignement désactivés mais qui ont
- * des notes dans cette structure.
+ * Retourne les élèves de la structure d'enseignement désactivés mais qui ont
+ * au moins une données (appréciation d'enseignant, appréciation générale, note)
+ * saisie pour le type de période et la structure ou qui sont paramétrés à etre
+ * affichés.
* @author bper
*/
- List<Personne> findAllEleveNonActifAyantNotesByStructure(StructureEnseignement structureEnseignement) {
+ List<Personne> findAllEleveInactifAAficherPourTypePeriode(StructureEnseignement structureEnseignement,
+ TypePeriode typePeriode) {
- List<Long> eleveAutoriteAyantNotesIds = (List<Long>) Note.createCriteria().list {
- evaluation {
- enseignement {
- service {
- eq(ConstFonct.STRUCTURE_ENSEIGNEMENT, structureEnseignement)
- }
- }
- }
+ List<TypePeriode> typePeriodes = [typePeriode]
- projections {
- groupProperty('eleve.id')
- }
- }
+ TypePeriode typePeriodeEquivalent = typePeriode.typePeriodeEquivalent
- if (eleveAutoriteAyantNotesIds.isEmpty()) {
- return []
+ if (typePeriodeEquivalent) {
+ typePeriodes << typePeriodeEquivalent
}
+ List<StructureEnseignement> classes = structureEnseignement.getClassesFinales()
+
+ Fonction fonction = Fonction.findByCode(FonctionEnum.ELEVE.code, [cache: true])
- PersonneProprietesScolarite.withSession { session ->
- Query query = session.createQuery(HQL_ELEVES_INACTIFS_BY_STRUCTURE_WITH_NOTES)
- query.setParameter('structureId', structureEnseignement.id)
- query.setParameter('fonctionCode', FonctionEnum.ELEVE.getCode())
- query.setParameterList('eleveAutoriteAyantNotesIds', eleveAutoriteAyantNotesIds)
- return (List<Personne>)query.list();
+ List<Long> periodeIds = (List<Long>) Periode.withCriteria{
+ 'in'('typePeriode', typePeriodes)
+ 'in'('classe', classes)
+ projections {
+ property('id')
+ }
}
+
+ List<Personne> eleves = Personne.executeQuery(
+ FIND_ALL_ELEVE_INACTIFS_A_AFFICHER_HQL,
+ [
+ structuretId: structureEnseignement.id,
+ fonctionId: fonction.id,
+ periodeIds: periodeIds
+ ]
+ )
+
+ return eleves
}
/**
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ ~ This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ ~
+ ~ Lilie is free software. You can redistribute it and/or modify since
+ ~ you respect the terms of either (at least one of the both license) :
+ ~ - under the terms of the GNU Affero General Public License as
+ ~ published by the Free Software Foundation, either version 3 of the
+ ~ License, or (at your option) any later version.
+ ~ - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ ~ License, or any later version
+ ~
+ ~ There are special exceptions to the terms and conditions of the
+ ~ licenses as they are applied to this software. View the full text of
+ ~ the exception in file LICENSE.txt in the directory of this software
+ ~ distribution.
+ ~
+ ~ Lilie is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ Licenses for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ and the CeCILL-C along with Lilie. If not, see :
+ ~ <http://www.gnu.org/licenses/> and
+ ~ <http://www.cecill.info/licences.fr.html>.
+ -->
+
+<databaseChangeLog
+ xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
+
+ <changeSet id="1" author="agia/bper">
+ <comment>
+ Ajout de la table des élèves n'ayant pas de données (notes, appréciations)
+ mais à afficher dans les tableaux de notes et synthèses
+ </comment>
+
+ <createTable schemaName="ent" tableName="eleve_archive_affiche" >
+ <column name="id" type="bigint">
+ <constraints primaryKey="true"/>
+ </column>
+ <column name="version" type="integer">
+ <constraints nullable="false"/>
+ </column>
+ <column name="personne_id" type="bigint">
+ <constraints nullable="false" />
+ </column>
+ <column name="periode_id" type="bigint">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableSchemaName="ent"
+ baseTableName="eleve_archive_affiche"
+ baseColumnNames="personne_id"
+ constraintName="fk_eleve_archive_affiche_personne"
+ referencedTableSchemaName="ent"
+ referencedTableName="personne"
+ referencedColumnNames="id" />
+
+ <addForeignKeyConstraint baseTableSchemaName="ent"
+ baseTableName="eleve_archive_affiche"
+ baseColumnNames="periode_id"
+ constraintName="fk_eleve_archive_affiche_periode"
+ referencedTableSchemaName="ent"
+ referencedTableName="periode"
+ referencedColumnNames="id" />
+
+ <addUniqueConstraint tableName="eleve_archive_affiche"
+ columnNames="personne_id, periode_id"
+ constraintName="uk_eleve_archive_affiche_personne_id_periode_id"
+ schemaName="ent"/>
+
+ <createSequence schemaName="ent" sequenceName="eleve_archive_affiche_id_seq" />
+
+ </changeSet>
+
+</databaseChangeLog>
\ No newline at end of file
<include file="changelogs/scolarite/annuaire_interface/2014-04-24-0036235.xml"/>
<include file="changelogs/scolarite/annuaire_interface/2014-05-14-0036391.xml"/>
<include file="changelogs/securite/2014-05-19-0036715.xml"/>
+ <include file="changelogs/scolarite/2014-05-19-0036717.xml"/>
</databaseChangeLog>
// Récupère les élèves de la classe auxqulles l'utilisateur a l'accès
eleves = notesPersonneService.findAllEleveByClasseForUtilisateur(
securiteSession,
- classe,
- false
+ classe
)
// Liste de période de la classe sélectionnée
private List<Personne> listeEleves(StructureEnseignement classe) {
// Récupère les élèves de la classe auxqulles l'utilisateur a l'accès
- return notesPersonneService.findAllEleveByClasseForUtilisateur(securiteSession, classe, false)
+ return notesPersonneService.findAllEleveByClasseForUtilisateur(securiteSession, classe)
}
Long classeId = Long.valueOf(params.classeId)
StructureEnseignement classe = StructureEnseignement.get(classeId)
- // Récupère les élèves de la classe auxqulles l'utilisateur a l'accès
+ // Récupère les élèves de la classe auxquels l'utilisateur a l'accès
List<Personne> eleves = notesPersonneService.findAllEleveByClasseForUtilisateur(
securiteSession,
- classe,
- params.eleveNonActifAyantNotes != null ?
- Boolean.parseBoolean(params.eleveNonActifAyantNotes) : true)
+ classe)
List<Periode> periodes = classe.periodes.toList().sort()
Periode periode = periodes.find {it.isPeriodeEnCours() && it.isPeriodeXmestre()}
}
List<Long> eleveInactifIds = eleveAnnuaireService.
- findAllEleveNonActifByStructure(classe).collect {it.id}
+ findAllEleveInactifByStructure(classe).collect {it.id}
List eleveInfos = eleves.collect { Personne personne ->
[
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.notes.saisie
+
+import grails.converters.JSON
+import org.lilie.services.eliot.scolarite.Periode
+import org.lilie.services.eliot.notes.archive.EleveArchiveService
+import org.lilie.services.eliot.notes.archive.EleveArchive
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.notes.AbstractNotesController
+import org.lilie.services.eliot.notes.NotesFonctionnalite
+
+/*
+ * Gère les élèves qui n'ont pas de notes ni d'appréciations et qui ont changé de
+ * classe ou qui sont sortis de l'établissement
+ */
+class EleveArchiveController extends AbstractNotesController {
+
+ EleveArchiveService eleveArchiveService
+
+ def getElevesSortisSansDonnees = {
+ Map resultats = tryCatch{
+ Periode periode = Periode.get(params.periodeId)
+
+ verifieDroitFonctionnalite(NotesFonctionnalite.NOTES_SAISIE_SYNTH)
+ verifieDroitAccesObjetDomaine(periode.classe)
+
+ List<EleveArchive> eleveArchives =
+ eleveArchiveService.findAllEleveArchiveSansDonnees(periode)
+
+ SimpleDateFormat sdf = new SimpleDateFormat('dd/MM/yyyy')
+
+ List eleveArchiveMaps = eleveArchives.collect {
+ [
+ id: it.eleve.id,
+ nomPrenom: it.eleve.nomAffichage(),
+ classe: it.actif ? it.classe.code : "(${it.classe.code})",
+ dateSortie: sdf.format(it.dateSortie),
+ affiche: it.affiche
+ ]
+ }
+
+ [eleveArchives: eleveArchiveMaps]
+ }
+
+ render resultats as JSON
+ }
+
+
+ def modifieAffichageElevesSortisSansDonnees = {
+ Map resultats = tryCatch{
+ Periode periode = Periode.get(params.periodeId)
+
+ verifieDroitFonctionnalite(NotesFonctionnalite.NOTES_SAISIE_SYNTH)
+ verifieDroitAccesObjetDomaine(periode.classe)
+
+ Map mapEleveIdAffiche = [:]
+
+ JSON.parse((String) params.elevesModifies).each {
+ Long eleveId = (Long) it.id.toLong()
+ Boolean affiche = Boolean.valueOf((String)it.affiche)
+ mapEleveIdAffiche.put(eleveId, affiche)
+ }
+
+ eleveArchiveService.modifieAffichageEleves(periode, mapEleveIdAffiche)
+ }
+
+ render resultats as JSON
+ }
+}
import org.lilie.services.eliot.notes.NotesFonctionnalite
import org.lilie.services.eliot.securite.perimetre.PerimetreEtablissement
import org.lilie.services.eliot.securite.perimetre.PerimetreClasseEnseignantPrincipal
+import org.lilie.services.eliot.securite.impl.Autorite
/**
* Appréciations saisie par l'enseignant pour les élèves d'un service
List<Personne> eleves = service ?
eleveAnnuaireService.findStructureEnseignementElevesListes(
- service.structureEnseignement
+ service.structureEnseignement,
+ typePeriode
).eleves : []
excludeElevesEnSemestre(typePeriode, service, eleves)
tableauDeNotesService,
eleve,
service,
- securiteSession.defaultAutorite
+ (Autorite) securiteSession.defaultAutorite
)
// Récap correspondant au type de période sélectionné
StructureEnseignement classe = classes.find {it.id == classeId}
if (classe) {
+
+ // Les périodes de la classe
+ List<Periode> periodes = classe.periodes.toList().sort()
+
+ periodeInfos = periodes.collect {
+ new PeriodeInfo(idPeriode: it.id, libelle: getTypePeriodeLibelle(it.typePeriode))
+ }
+ // Période sélectionnée
+ periode = periodeId != null ? periodes.find {it.id == periodeId} :
+ periodes.find {it.isPeriodeEnCours() && it.isPeriodeXmestre()}
+
// Les élèves de la classe
StructureEnseignementElevesListes structureEnseignementElevesListes = eleveAnnuaireService.
- findStructureEnseignementElevesListes(classe, false)
+ findStructureEnseignementElevesListes(classe, periode.typePeriode)
eleves = structureEnseignementElevesListes.eleves
elevesActifs = structureEnseignementElevesListes.elevesActifs
if ((eleve == null) && (eleves != null) && (eleves.size() > 0)) {
eleve = eleves.first()
}
-
- // Les périodes de la classe
- List<Periode> periodes = classe.periodes.toList().sort()
-
- periodeInfos = periodes.collect {
- new PeriodeInfo(idPeriode: it.id, libelle: getTypePeriodeLibelle(it.typePeriode))
- }
- // Période sélectionnée
- periode = periodeId != null ? periodes.find {it.id == periodeId} :
- periodes.find {it.isPeriodeEnCours() && it.isPeriodeXmestre()}
-
}
Map result = prepareBaseModele(Page.SAISIE_CONSEIL_DE_CLASSE)
notes.menu.saisie.conseilDeClasse.auditNoteAppreciation.titrePrincipal=Audit notes et appréciations
notes.menu.saisie.conseilDeClasse.vueEleve.titrePrincipal=Vue par élève
notes.menu.saisie.appreciations.titrePrincipal=Appréciations
+notes.menu.saisie.elevesArchives=Eleves archivés
notes.menu.consultation.titrePrincipal=Consultation
notes.menu.consultation.bulletin.titrePrincipal=Bulletin
notes.menu.consultation.releve.titrePrincipal=Relevé de notes
#################### libellé #########################
eliot.notes.libelle.attention=Attention
eliot.notes.libelle.comboClasse=Classe
+eliot.notes.libelle.valider=Valider
eliot.notes.libelle.lovComboclasse=Classes
eliot.notes.libelle.lovComboTous=Tous
eliot.notes.libelle.comboSerie=Série
notes.parametrage.service.selectionSousMatieres=Sélection et paramétrage des sous-matières
notes.parametrage.service.selectionMatieres=Sélection des matières
-menu.etablissement.titre=Etablissements
\ No newline at end of file
+menu.etablissement.titre=Etablissements
+eliot.notes.libelle.classes=Classes
+
+
+
+# Cycle élève
+eliot.notes.libelle.cycleEleve.elevesArchives=Élèves archivés de
+eliot.notes.libelle.cycleEleve.dateSortie=Date de sortie
+eliot.notes.libelle.cycleEleve.affiche=Affiché
+eliot.notes.libelle.cycleEleve.aucunEleveArchive=Aucun élève archivé.
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.notes.archive
+
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.Periode
+
+/**
+ * @author bper
+ */
+class EleveArchive {
+ Personne eleve
+ // La classe actuelle ou la dernière classe quittée
+ StructureEnseignement classe
+ // true - la "classe" est la classe actuelle, false - la "classe" est la dernière classe quittée
+ Boolean actif
+
+ // La période par rapport à laquelle élève doit ou pas etre affiché
+ Periode periode
+ // La date des sortie de la classe qui correspond à la période.
+ Date dateSortie
+ Boolean affiche
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.notes.archive
+
+import org.lilie.services.eliot.scolarite.Periode
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.annuaire.Fonction
+import org.lilie.services.eliot.annuaire.FonctionEnum
+import org.hibernate.SessionFactory
+import org.hibernate.SQLQuery
+import org.hibernate.Session
+import org.lilie.services.eliot.scolarite.Personne
+import org.hibernate.Hibernate
+import org.lilie.services.eliot.GormUtils
+import org.hibernate.FlushMode
+import org.lilie.services.eliot.scolarite.EleveArchiveAffiche
+
+class EleveArchiveService {
+
+ static transactional = true
+
+ SessionFactory sessionFactory
+
+
+ private static final FIND_ALL_ELEVE_ARCHIVE_SANS_DONNEES = """
+ WITH eleve_inactif AS (
+ SELECT personne_id AS eleve_id, max(pps.date_desactivation) AS date_desactivation
+ FROM ent.personne_propriete_scolarite AS pps
+ INNER JOIN ent.propriete_scolarite AS ps ON pps.propriete_scolarite_id = ps.id
+ WHERE pps.est_active = false
+ AND ps.fonction_id = :fonction_id
+ AND ps.structure_enseignement_id = :classe_id
+ GROUP BY personne_id
+ )
+ SELECT
+ DISTINCT ON (eleve.*) {eleve.*},
+ {classe.*},
+ eleve_inactif.date_desactivation,
+ pps.est_active,
+ CASE
+ WHEN EXISTS (
+ SELECT * FROM ent.eleve_archive_affiche
+ WHERE personne_id = eleve.id
+ AND periode_id = :periode_id
+ )
+ THEN true
+ ELSE false
+ END AS afficher,
+ CASE WHEN pps.est_active = true THEN now() ELSE pps.date_desactivation END AS date_filtre
+ FROM ent.personne_propriete_scolarite AS pps
+ INNER JOIN ent.personne AS eleve ON pps.personne_id = eleve.id
+ INNER JOIN ent.propriete_scolarite AS ps ON pps.propriete_scolarite_id = ps.id
+ INNER JOIN ent.structure_enseignement AS classe ON ps.structure_enseignement_id = classe.id AND classe.type = 'CLASSE'
+ INNER JOIN eleve_inactif ON eleve_inactif.eleve_id = eleve.id
+ WHERE ps.fonction_id = :fonction_id
+ AND NOT EXISTS (
+ SELECT * FROM entnotes.note
+ INNER JOIN entnotes.evaluation AS eval ON evaluation_id = eval.id
+ INNER JOIN entnotes.rel_evaluation_periode AS rel ON rel.evaluation_id = eval.id
+ WHERE eleve_id = eleve.autorite_id
+ AND rel.periode_id = :periode_id
+ )
+ AND NOT EXISTS (
+ SELECT * FROM entnotes.appreciation_eleve_enseignement_periode
+ WHERE eleve_id = eleve.autorite_id
+ AND periode_id = :periode_id
+ )
+ AND NOT EXISTS (
+ SELECT * FROM entnotes.appreciation_eleve_periode
+ WHERE eleve_id = eleve.autorite_id
+ AND periode_id = :periode_id
+ )
+ ORDER BY eleve.*, date_filtre DESC;
+ """
+
+ List<EleveArchive> findAllEleveArchiveSansDonnees(Periode periode) {
+
+ Fonction fonction = Fonction.findByCode(FonctionEnum.ELEVE.code, [cache: true])
+
+ Session session = sessionFactory.currentSession
+ SQLQuery sqlQuery = session.createSQLQuery(FIND_ALL_ELEVE_ARCHIVE_SANS_DONNEES)
+
+ sqlQuery.addEntity('eleve', Personne)
+ sqlQuery.addEntity('classe', StructureEnseignement)
+ sqlQuery.addScalar('date_desactivation', Hibernate.DATE)
+ sqlQuery.addScalar('est_active', Hibernate.BOOLEAN)
+ sqlQuery.addScalar('afficher', Hibernate.BOOLEAN)
+
+ sqlQuery.setLong('fonction_id', fonction.id)
+ sqlQuery.setLong('classe_id', periode.classeId)
+ sqlQuery.setLong('periode_id', periode.id)
+
+ List res = sqlQuery.list()
+
+ List<EleveArchive> eleveArchives = (List<EleveArchive>) res.collect {
+ new EleveArchive(
+ eleve: (Personne) it[0],
+ classe: (StructureEnseignement) it[1],
+ dateSortie: (Date) it[2],
+ actif: (Boolean) it[3],
+ affiche: (Boolean) it[4],
+ periode: periode
+ )
+ }
+
+ return eleveArchives
+ }
+
+ void modifieAffichageEleves(Periode periode, Map<Long,Boolean> mapEleveIdAffiche) {
+
+ GormUtils.withFlushModeAndSession(FlushMode.MANUAL) {Session session ->
+
+ List<Personne> eleves = Personne.getAll(mapEleveIdAffiche.keySet().toList())
+
+ List<EleveArchiveAffiche> eleveArchiveAfficheACrees = []
+ List<EleveArchiveAffiche> eleveArchiveAfficheASupprimer = []
+
+ mapEleveIdAffiche.each {Long eleveId, Boolean affiche ->
+ Personne eleve = eleves.find {it.id == eleveId}
+ if (affiche) {
+ eleveArchiveAfficheACrees << new EleveArchiveAffiche(eleve: eleve, periode: periode)
+ } else {
+ eleveArchiveAfficheASupprimer << EleveArchiveAffiche.findByEleveAndPeriode(eleve, periode)
+ }
+ }
+
+ eleveArchiveAfficheASupprimer*.delete()
+ session.flush()
+
+ eleveArchiveAfficheACrees*.save(failOnError: true)
+ session.flush()
+ }
+ }
+}
StructureEnseignementElevesListes elevesListes =
eleveAnnuaireService.findStructureEnseignementElevesListes(
enseignement.service.structureEnseignement,
- consultation == true ? false : true
+ typePeriode
)
// Périodes utilisées pour le tableau de notes
// Crée les lignes du tableau de notes qui correspondant aux élèves ayant
// quitté la Structure d'Enseignement
elevesListes.elevesInactifs.collect {Personne eleve ->
- // Evol. cycle de vie des élèves : l'élève ayant changé de classe et étant
- // sorti de l'établissement ne doit pas apparaître dans le tableau
- // s'il n'a pas de note ni d'appréciation
- boolean hasDonneesPeriodeNormaleOuExam = donneesEleves.getNotesForEleve(eleve).size() > 0 ||
- donneesEleves.getAppreciationsForEleve(eleve).size() > 0
- boolean hasDonneesAnnee = donneesEleves.getResultatsForEleve(eleve).size() > 0
- if ((!typePeriode.isAnnee() && hasDonneesPeriodeNormaleOuExam) ||
- (typePeriode.isAnnee() && hasDonneesAnnee)){
- TableauDeNotesLigne ligne = creeTableauDeNotesLigne(
- eleve,
- false,
- enseignement,
- typePeriode,
- donneesEleves
- )
- if (ligne) {lignes << ligne}
- }
+ TableauDeNotesLigne ligne = creeTableauDeNotesLigne(
+ eleve,
+ false,
+ enseignement,
+ typePeriode,
+ donneesEleves
+ )
+ if (ligne) {lignes << ligne}
}
// Trie les lignes (élèves) par nom d'affichage
StructureEnseignementElevesListes elevesListes =
eleveAnnuaireService.findStructureEnseignementElevesListes(
enseignement.service.structureEnseignement,
- false
+ typePeriode
)
Map<Personne,StructureEnseignement> mapEleveClasse = [:]
static transactional = true
- List<Personne> findAllEleveByClasseForUtilisateur(SecuriteSession securiteSession,
- StructureEnseignement classe) {
- return findAllEleveByClasseForUtilisateur(securiteSession, classe, true)
- }
-
/**
* Retourne tous l'élèves dont les infos utilisateur a le droit de consulter.
* @author bper
*/
List<Personne> findAllEleveByClasseForUtilisateur(SecuriteSession securiteSession,
- StructureEnseignement classe,
- Boolean eleveNonActifAyantNotes) {
+ StructureEnseignement classe) {
List<Personne> eleves = []
notesDroitService.hasDroitAccesClasseEntiere(securiteSession, classe)
if (hasDroitSurClasseEntiere){
- eleves = eleveAnnuaireService.findStructureEnseignementElevesListes(
- classe,
- eleveNonActifAyantNotes
- ).eleves
+ eleves = eleveAnnuaireService.findStructureEnseignementElevesListes(classe).eleves
}
else if (notesDroitService.hasPerimetre(securiteSession, PerimetreEleve)) {
List<Personne> enfants =
* @author bper
* @author msan
*/
-class NotesTypePeriodeService extends TypePeriodeService implements ApplicationContextAware {
+class NotesTypePeriodeService extends TypePeriodeService {
static transactional = true
- // ApplicationContext est aussi un service singleton
- @SuppressWarnings('GrailsStatelessService')
- ApplicationContext applicationContext
-
/**
* Retourne les TypePeriode de nature EXAMENT d'un établissement
* @param classe structure d'enseignement de type CLASSE
* @author bper
*/
TypePeriode getTypePeriodeEquivalent(TypePeriode typePeriode) {
- IntervalleEnum intevalleEquiv = typePeriode?.intervalle?.intevalleEquivalent
- if (intevalleEquiv != null) {
- return TypePeriode.findByIntervalle(intevalleEquiv, [cache:true])
- } else {
- null
- }
+ typePeriode?.getTypePeriodeEquivalent()
}
/**
--- /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>.
+ --}%
+
+
+%{--@autor bahj --}%
+
+<g:javascript library="src/views/elevesarchivesfenetre/ConfigServeur"/>
+
+<g:render template="/elevesarchivesfenetre/modele"/>
+
+<g:javascript library="src/views/elevesarchivesfenetre/Constantes"/>
+<g:javascript library="src/views/elevesarchivesfenetre/EleveGridView"/>
+<g:javascript library="src/views/elevesarchivesfenetre/FenetreController"/>
+<g:javascript library="src/views/elevesarchivesfenetre/FenetreView"/>
+<g:javascript library="src/views/elevesarchivesfenetre/Application"/>
\ No newline at end of file
--- /dev/null
+<%@ page import="org.codehaus.groovy.grails.commons.ConfigurationHolder" %>
+%{--
+ - 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>.
+ --}%
+
+%{--@author bbel--}%
+
+<g:javascript>
+ <g:setJsNs value="eliot.elevesarchives.ConfigServeur"/>
+
+ // Libellés
+ <g:setJsVar value="libelle"/>
+ <g:setJsValueMessage name="valider" code="eliot.notes.libelle.valider"/>
+ <g:setJsValueMessage name="annuler" code="eliot.notes.libelle.annuler"/>
+ <g:setJsValueMessage name="elevesArchives"
+ code="eliot.notes.libelle.cycleEleve.elevesArchives"/>
+
+ <g:setJsVar value="header"/>
+ <g:setJsValueMessage name="nomPrenom"
+ code="eliot.notes.libelle.eleveNomPrenom"/>
+ <g:setJsValueMessage name="classes" code="eliot.notes.libelle.classes"/>
+ <g:setJsValueMessage name="dateSortie"
+ code="eliot.notes.libelle.cycleEleve.dateSortie"/>
+ <g:setJsValueMessage name="affiche"
+ code="eliot.notes.libelle.cycleEleve.affiche"/>
+
+ <g:setJsVar value="url"/>
+ <g:setJsValueLink name="rechercher" controller="eleveArchive"
+ action="getElevesSortisSansDonnees"/>
+ <g:setJsValueLink name="valider" controller="eleveArchive"
+ action="modifieAffichageElevesSortisSansDonnees"/>
+
+ <g:setJsVar value="message"/>
+ <g:setJsValueMessage name="aucunEleveArchive"
+ code="eliot.notes.libelle.cycleEleve.aucunEleveArchive"/>
+ <g:setJsValueMessage name="chargement"
+ code="notes.loading.text"/>
+</g:javascript>
<g:render template="/consultation/commun/graph/composant"/>
<g:render template="/commun/noteField"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ %{--Template de la fenêtre de cycle de vie des élèves--}%
+ <g:render template="/elevesarchivesfenetre/elevesArchivesFenetre"/>
<!-- Template pour les définitions des constantes -->
<g:javascript library="src/views/Modele"/>
eliot.notes.saisie.synthese.Modele.libelle.vieScolaire = '${g.message(code: "eliot.notes.libelle.vieScolaire")?.encodeAsJavaScript()}';
eliot.notes.saisie.synthese.Modele.libelle.vieScolaireDetail = '${g.message(code: "eliot.notes.libelle.vieScolaireDetail")?.encodeAsJavaScript()}';
eliot.notes.saisie.synthese.Modele.libelle.vueEleve = '${g.message(code: "notes.menu.saisie.conseilDeClasse.vueEleve.titrePrincipal")?.encodeAsJavaScript()}';
+ eliot.notes.saisie.synthese.Modele.libelle.elevesArchives = '${g.message(code: "notes.menu.saisie.elevesArchives")?.encodeAsJavaScript()}';
eliot.notes.saisie.synthese.Modele.messages.appreciationModifieEnCours = '${g.message(code: "eliot.notes.message.appreciationModifieEnCours")?.encodeAsJavaScript()}';
eliot.notes.saisie.synthese.Modele.messages.appreciationModifieSucces = '${g.message(code: "eliot.notes.message.appreciationModifieSucces")?.encodeAsJavaScript()}';
%{--Sources de bouton d'export des données--}%
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
<g:javascript>
<g:javascript library="src/views/saisie/synthese/Application"/>
</head>
+
<body>
%{-- Message --}%
<div id="messages" class="portal-messages"/>
--- /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>.
+ */
+
+
+Ext.ns('eliot.elevesarchives');
+
+/**
+ * @author bbel
+ */
+
+eliot.elevesarchives.Application = function () {
+ var Clazz = Ext.extend(Ext.util.Observable, {
+ constructor:function () {
+
+ this.ns = eliot.elevesarchives;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ },
+
+ // Création et affichage de la fenêtre
+ afficheFenetre:function (params, onEnregistrementSuccess) {
+
+ var fenetreController = new this.ns.FenetreController(
+ params.classeId, params.periodeId, onEnregistrementSuccess
+ );
+
+ var eleveGridView = new this.ns.EleveGridView({
+ store:fenetreController.store
+ });
+
+
+ var fenetreView = new this.ns.FenetreView({
+ eleveGrid:eleveGridView.grid,
+ classeCode:params.classeCode,
+ periodeLibelle:params.periodeLibelle
+ });
+
+ fenetreController.observeFenetreView(fenetreView);
+
+ fenetreView.window.show();
+ }
+ });
+
+ // Construit l'instance singleton
+ return new Clazz({
+ name:'eliot.elevesarchives-app'
+ });
+}();
+
--- /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>.
+ */
+
+Ext.ns('eliot.elevesarchives');
+
+/**
+ * @author bbel
+ */
+
+eliot.elevesarchives.ConfigServeur = {
+
+ url:{
+ recherche:undefined,
+ valider:undefined
+ },
+
+ header:{
+ nomPrenom:undefined,
+ classes:undefined,
+ dateSortie:undefined,
+ affiche:undefined
+ },
+
+ libelle:{
+ elevesArchives:undefined,
+ valider:undefined,
+ annuler:undefined
+ },
+
+ message:{
+ aucunEleveArchive:undefined
+ }
+};
\ 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>.
+ */
+
+
+Ext.ns('eliot.elevesarchives');
+
+/**
+ * @author bbel
+ */
+
+eliot.elevesarchives.Constantes = {
+
+ event:{
+ actionValider:'actionValider',
+ actionAnnuler:'actionAnnuler'
+ },
+
+ dataIndex:{
+ nomPrenom:'nomPrenom',
+ classe:'classe',
+ dateSortie:'dateSortie',
+ affiche:'affiche'
+ }
+
+};
--- /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>.
+ */
+
+Ext.ns('eliot.elevesarchives');
+
+/**
+ * @author bbel
+ */
+
+eliot.elevesarchives.EleveGridView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+
+ this.ns = eliot.elevesarchives;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.Config = config;
+
+ this.grid = new Ext.grid.GridPanel(this.getGridConfig());
+
+ this.observeStore();
+ },
+
+
+ getGridConfig:function () {
+
+ this.checkBox = new Ext.grid.CheckColumn({
+ header:this.ConfigServeur.header.affiche,
+ dataIndex:this.Constantes.dataIndex.affiche,
+ width:80
+ });
+
+ var columns = this.getColumns();
+
+ return {
+ layout:'fit',
+ viewConfig:{
+ scrollOffset:3,
+ emptyText:'<div style="color:black;font-size:12px;font-style:italic;text-align:center">' +
+ this.ConfigServeur.message.aucunEleveArchive +
+ '</div>'
+ },
+ loadMask:{
+ msg:this.ConfigServeur.message.chargement
+ },
+ enableColumnMove:false,
+ store:this.Config.store,
+ enableHdMenu:false,
+ enableColumnResize:false,
+ plugins:this.checkBox,
+ colModel:new Ext.grid.ColumnModel({
+ defaults:{
+ sortable:false
+ },
+ columns:columns
+ })
+ }
+ },
+
+ getColumns:function () {
+ return [
+ {
+ id:this.Constantes.libelle,
+ header:this.ConfigServeur.header.nomPrenom,
+ dataIndex:this.Constantes.dataIndex.nomPrenom,
+ width:180
+ },
+ {
+ header:this.ConfigServeur.header.classes,
+ dataIndex:this.Constantes.dataIndex.classe,
+ width:80
+ },
+ {
+ header:this.ConfigServeur.header.dateSortie,
+ dataIndex:this.Constantes.dataIndex.dateSortie,
+ width:100
+ },
+ this.checkBox
+ ]
+ },
+
+ observeStore:function () {
+ this.grid.getStore().addListener({
+ exception:function (dataProxy, type, action, options, response) {
+ this.grid.getView().mainBody.update(
+ '<div style="color:red;font-size:12px;font-style:italic;text-align:center;padding-top:10px;">' +
+ response.message +
+ '</div>'
+ );
+ },
+ scope:this
+ })
+ }
+
+});
+
+/**
+ * checbox dans la colonne
+ * @param config
+ * @constructor
+ */
+Ext.grid.CheckColumn = function (config) {
+ Ext.apply(this, config);
+ if (!this.id) {
+ this.id = Ext.id();
+ }
+ this.renderer = this.renderer.createDelegate(this);
+};
+
+Ext.grid.CheckColumn.prototype = {
+ init:function (grid) {
+ this.grid = grid;
+ this.grid.on('render', function () {
+ var view = this.grid.getView();
+ view.mainBody.on('mousedown', this.onMouseDown, this);
+ }, this);
+ },
+
+ onMouseDown:function (e, t) {
+ if (t.className && t.className.indexOf('x-grid3-cc-' + this.id) != -1) {
+ e.stopEvent();
+ var index = this.grid.getView().findRowIndex(t);
+ var record = this.grid.store.getAt(index);
+ record.set(this.dataIndex, !record.data[this.dataIndex]);
+ }
+ },
+
+ renderer:function (v, p, record) {
+ p.css += ' x-grid3-check-col-td';
+ return '<div class="x-grid3-check-col' + (v ? '-on' : '') + ' x-grid3-cc-' + this.id + '"> </div>';
+ }
+};
\ 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>.
+ */
+
+
+Ext.ns('eliot.elevesarchives');
+
+/**
+ * @author bbel
+ */
+
+eliot.elevesarchives.FenetreController = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (classeId, periodeId, onEnregistrementSuccess) {
+
+ this.ns = eliot.elevesarchives;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.Config = {
+ classeId:classeId,
+ periodeId:periodeId
+ };
+
+ this.onEnregistrementSuccess = onEnregistrementSuccess;
+
+ this.store = this.getStore();
+ },
+
+ getStore:function () {
+ return new Ext.data.JsonStore({
+ url:this.ConfigServeur.url.rechercher,
+ autoLoad:true,
+ idProperty:'id',
+ baseParams:this.Config,
+ root:'eleveArchives',
+ fields:[
+ {name:'id', type:'long'},
+ {name:'nomPrenom', type:'string'},
+ {name:'classe', type:'string'},
+ {name:'dateSortie', type:'string'},
+ {name:'affiche', type:'boolean'}
+ ],
+ successProperty:'success',
+ messageProperty:'message'
+ });
+ },
+
+ observeFenetreView:function (fenetreView) {
+ fenetreView.addListener(
+ this.Constantes.event.actionAnnuler,
+ function () {
+ this.store.rejectChanges();
+ },
+ this
+ );
+
+ fenetreView.addListener(
+ this.Constantes.event.actionValider,
+ this.actionValider,
+ this
+ );
+ },
+
+ actionValider:function () {
+ var data = [];
+
+ this.store.getModifiedRecords().map(function (item) {
+ data.push({id:item.data.id, affiche:item.data['affiche']});
+ });
+
+ // Si aucun changement, on ne déclanche pas l'ajax
+ if (data.length == 0) {
+ return
+ }
+
+ eliot.commun.AjaxHelper.request({
+
+ url:this.ConfigServeur.url.valider,
+
+ params:{
+ elevesModifies:Ext.encode(data),
+ classeId:this.Config.classeId,
+ periodeId:this.Config.periodeId
+ },
+
+ success:function (reponse) {
+ this.onEnregistrementSuccess();
+ },
+
+ failure:function (reponse) {
+ // ne rien faire
+ },
+ scope:this
+ });
+ }
+
+
+
+});
\ 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>.
+ */
+
+Ext.ns('eliot.elevesarchives');
+
+/**
+ * @author bbel
+ */
+
+eliot.elevesarchives.FenetreView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+
+ this.ns = eliot.elevesarchives;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.Config = config;
+
+ this.addEvents(
+ this.Constantes.event.actionValider,
+ this.Constantes.event.actionAnnuler
+ );
+
+ this.window = new Ext.Window(this.getWindowConfig());
+ },
+
+
+ getWindowConfig:function () {
+ return {
+ title:this.getFenetreTitre(),
+ modal:true,
+ closable:true,
+ border:false,
+ width:470,
+ height:400,
+ plain:true,
+ layout:'border',
+ buttonAlign:'left',
+ items:[
+
+ this.getEleveGridView()
+ ],
+ buttons:this.getBouttons()
+ }
+ },
+
+ getFenetreTitre:function () {
+ return this.ConfigServeur.libelle.elevesArchives +
+ ' ' +
+ this.Config.classeCode +
+ ' - ' +
+ this.Config.periodeLibelle;
+ },
+
+ getEleveGridView:function () {
+ return {
+ region:'center',
+ layout:'fit',
+ border:false,
+ items:this.Config.eleveGrid
+ }
+ },
+
+
+ getBouttons:function () {
+
+ return [
+ '->',
+ {
+ text:this.ConfigServeur.libelle.valider,
+ handler:this.actionValider,
+ scope:this
+ },
+ {
+ text:this.ConfigServeur.libelle.annuler,
+ handler:this.actionAnnuler,
+ scope:this
+ }
+ ]
+ },
+
+ actionValider:function () {
+
+ this.fireEvent(
+ this.Constantes.event.actionValider
+ );
+
+ this.window.close();
+ },
+
+ actionAnnuler:function () {
+
+ this.fireEvent(
+ this.Constantes.event.actionAnnuler
+ );
+ }
+
+});
\ No newline at end of file
// Tableau de notes
this.tblNotesController = new this.ns.TblNotesController({
- serviceController: this.serviceController
+ serviceController: this.serviceController,
+ classeModel: this.classeController.model,
+ periodeModel: this.periodeController.model
});
this.tblNotesController.observeToolbarView(this.toolbarView);
eleveChange: 'eleveChange',
afficheMoyennesPrecedentes: 'afficheMoyennesPrecedentes',
afficheRang: 'afficheRang',
- actionOuvrirAuditNoteAppreciation: 'actionOuvrirAuditNoteAppreciation'
+ actionOuvrirAuditNoteAppreciation: 'actionOuvrirAuditNoteAppreciation',
+ actionAfficherElevesArchives :'actionAfficherElevesArchives'
},
composantId:{
vieScolaire: undefined,
vieScolaireDetail: undefined,
- vueEleve: undefined
+ vueEleve: undefined,
+
+ elevesArchives : undefined
},
icon: {
* cfg serviceController
* cfg graph
*/
- constructor: function(config) {
+ constructor:function (config) {
this.ns = eliot.notes.saisie.synthese;
this.ConfigServeur = this.ns.Modele;
);
// Configuration
- var cfg = {
- serviceController: undefined
+ this.Config = {
+ serviceController:undefined
};
- Ext.apply(cfg, config);
+ Ext.apply(this.Config, config);
// La variable qui stock les modifications d'appréciations
this.listeAppreciationModifiee = [];
this.infoModifie = {};
- this.fields = this.getFieldLigneDeNotes(cfg.serviceController.storeService);
+ this.fields = this.getFieldLigneDeNotes(this.Config.serviceController.storeService);
// Store de grid(tableau de notes synthèse)
this.tblNotesStore = new Ext.data.Store({
- autoDestroy: true,
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- root: 'syntheseLignes',
- fields: this.fields
+ autoDestroy:true,
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ root:'syntheseLignes',
+ fields:this.fields
}),
- data: {
- syntheseLignes: this.ConfigServeur.data.syntheseLignes
+ data:{
+ syntheseLignes:this.ConfigServeur.data.syntheseLignes
}
});
/**
* Liste des champs
*/
- getFieldLigneDeNotes: function(storeService) {
+ getFieldLigneDeNotes:function (storeService) {
var fieldLigneDeNotes = [
- {name: 'nomAffichage', type: 'string'},
- {name: 'id', type: 'int'},
- {name: 'personneId', type: 'int'},
- {name: 'moyenne', type: 'string'},
- {name: 'rang', type: 'string'},
- {name: 'appreciationGenerale', type: 'string'},
- {name: 'colonnesGrisees'},
- {name: 'actif'}
+ {name:'nomAffichage', type:'string'},
+ {name:'id', type:'int'},
+ {name:'personneId', type:'int'},
+ {name:'moyenne', type:'string'},
+ {name:'rang', type:'string'},
+ {name:'appreciationGenerale', type:'string'},
+ {name:'colonnesGrisees'},
+ {name:'actif'}
];
for (var i = 0; i < this.ConfigServeur.data.periodesPrecedentes.length; i++) {
var periode = this.ConfigServeur.data.periodesPrecedentes[i];
fieldLigneDeNotes.push({
- name: 'moyennePeriodePrecedente' + periode.id,
- type: 'string'
+ name:'moyennePeriodePrecedente' + periode.id,
+ type:'string'
});
}
for (var i = 0; i < nbService; i++) {
fieldLigneDeNotes.push({
- name: 'moyenneService_' + serviceData.items[i].data.idCompose,
- type: 'string'
+ name:'moyenneService_' + serviceData.items[i].data.idCompose,
+ type:'string'
});
}
* Observe la vue du tableau de notes
* @param tblNotesView
*/
- observeTblNotesView: function(tblNotesView) {
+ observeTblNotesView:function (tblNotesView) {
this.columnsDescription = tblNotesView.columnsDescription;
this.tblNotesView = tblNotesView;
tblNotesView.addListener(
this.Constantes.eventId.actionChangeAppreciation,
- function(record, change) {
+ function (record, change) {
eliot.notes.Messages.resetMessages();
this.setAppreciationModifiee(record, change);
this.fireEvent(
tblNotesView.addListener(
this.Constantes.eventId.actionOuvrirGraphWindow,
- function() {
+ function () {
this.ouvreGraphWindow();
},
this
* Observe la toolbar
* @param toolbarView l'objet de ToolbarView
*/
- observeToolbarView: function(toolbarView) {
+ observeToolbarView:function (toolbarView) {
toolbarView.addListener(
this.Constantes.eventId.actionOuvrirAuditNoteAppreciation,
- function() {
+ function () {
this.executeOuvrirAuditNoteAppreciation();
},
this
toolbarView.addListener(
this.Constantes.eventId.actionOuvrirConseilDeClasse,
- function() {
+ function () {
this.executeOuvrirConseilDeClasse();
},
this
toolbarView.addListener(
this.Constantes.eventId.actionOuvrirAppreciationClasse,
- function() {
+ function () {
this.executeOuvrirAppreciationClasse();
},
this
toolbarView.addListener(
this.Constantes.eventId.actionEnregistrerNotes,
- function() {
+ function () {
eliot.notes.Messages.resetMessages();
this.executeEnregistrerAppreciation(this.infoModifie);
this.activeBoutonExport();
toolbarView.addListener(
this.Constantes.eventId.actionAnnulerModifNotes,
- function() {
+ function () {
eliot.notes.Messages.resetMessages();
this.actionAnnulerModifNotes();
this.activeBoutonExport();
toolbarView.addListener(
this.Constantes.eventId.actionOuvrirGraphWindow,
- function() {
+ function () {
this.ouvreGraphWindow();
},
this);
toolbarView.addListener(
this.Constantes.eventId.afficheMoyennesPrecedentes,
- function(checked) {
+ function (checked) {
this.afficheMoyennesPrecedentes(checked);
},
this);
toolbarView.addListener(
this.Constantes.eventId.afficheRang,
- function(checked) {
+ function (checked) {
this.afficheRang(checked);
},
this);
+ toolbarView.addListener(
+ this.Constantes.eventId.actionAfficherElevesArchives,
+ function () {
+ this.afficheElevesArchives();
+ },
+ this);
+
+ },
+
+ afficheElevesArchives:function () {
+ var classe = this.Config.classeModel.getClasse();
+ var periode = this.Config.periodeModel.getPeriode();
+
+ var params = {
+ classeId:classe.id,
+ classeCode:classe.get('code'),
+ periodeId:periode.id,
+ periodeLibelle:periode.get('libelle')
+ };
+
+ eliot.elevesarchives.Application.afficheFenetre(
+ params,
+ this.onElevesArchivesChange
+ );
+ },
+
+ onElevesArchivesChange:function () {
+ window.location.reload();
},
- activeBoutonExport : function() {
+ activeBoutonExport:function () {
var params = {
- periodeId: this.ConfigServeur.data.periodeId,
- classeId :this.ConfigServeur.data.classeId
+ periodeId:this.ConfigServeur.data.periodeId,
+ classeId:this.ConfigServeur.data.classeId
};
this.fireEvent(
this.BoutonExportEventsId.donneesPretesAExporter,
* @param record l'objet d'appréciation modifiée
* @param change l'appreciation modifiée
*/
- setAppreciationModifiee: function(record, change) {
+ setAppreciationModifiee:function (record, change) {
var isDupliquee = false;
/**
* Enregistre les appréciations
*/
- executeEnregistrerAppreciation: function() {
+ executeEnregistrerAppreciation:function () {
eliot.commun.AjaxHelper.request({
- url: this.ConfigServeur.url.urlSaveAppreciationGenerale,
+ url:this.ConfigServeur.url.urlSaveAppreciationGenerale,
- params: {
- idPeriode: this.ConfigServeur.data.periodeId,
- appreciation: Ext.encode(this.listeAppreciationModifiee)
+ params:{
+ idPeriode:this.ConfigServeur.data.periodeId,
+ appreciation:Ext.encode(this.listeAppreciationModifiee)
},
- success: function(reponse) {
+ success:function (reponse) {
eliot.notes.Messages.showConfirmation(this.ConfigServeur.messages.appreciationModifieSucces);
this.tblNotesStore.commitChanges();
this.tblNotesView.tblNotesGrid.view.processRows(0, true);
this.listeAppreciationModifiee = [];
},
- failure: function(reponse) {
+ failure:function (reponse) {
if ((reponse.message !== undefined) && (reponse.message !== '')) {
eliot.notes.Messages.showErreur(reponse.message);
this.fireEvent(this.Constantes.eventId.actionChangeAppreciation);
},
- maskText: this.ConfigServeur.messages.appreciationModifieEnCours,
- scope: this
+ maskText:this.ConfigServeur.messages.appreciationModifieEnCours,
+ scope:this
});
},
/**
* La méthode permet d'annuler les modifications sur des notes saisie
*/
- actionAnnulerModifNotes : function() {
+ actionAnnulerModifNotes:function () {
if (this.tblNotesStore.getModifiedRecords().length !== 0) {
this.tblNotesStore.rejectChanges();
this.listeAppreciationModifiee = [];
}
},
- executeOuvrirAuditNoteAppreciation: function() {
+ executeOuvrirAuditNoteAppreciation:function () {
eliot.notes.Messages.afficherDialogMultiConfirmation({
- scope: this,
- success: function() {
+ scope:this,
+ success:function () {
var location = this.ConfigServeur.url.urlAuditNoteAppreciation +
'?classeId=' + this.ConfigServeur.data.classeId +
window.location = location;
},
- failure: function() {
+ failure:function () {
},
- verifications: [
+ verifications:[
{
- titre: this.ConfigServeur.messages.attention,
- confirmation: this.ConfigServeur.messages.saisieSyntheseAlert + '\n'
+ titre:this.ConfigServeur.messages.attention,
+ confirmation:this.ConfigServeur.messages.saisieSyntheseAlert + '\n'
+ this.ConfigServeur.messages.confirmationQuitterSaisieSynthese,
- test: function() {
+ test:function () {
return this.listeAppreciationModifiee.length !== 0;
}
}
/**
* Ouvrir le conseil de classe
*/
- executeOuvrirConseilDeClasse: function() {
+ executeOuvrirConseilDeClasse:function () {
eliot.notes.Messages.afficherDialogMultiConfirmation({
- scope: this,
- success: function() {
+ scope:this,
+ success:function () {
var location = this.ConfigServeur.url.urlConseilDeClasse +
'?classeId=' + this.ConfigServeur.data.classeId +
window.location = location;
},
- failure: function() {
+ failure:function () {
},
- verifications: [
+ verifications:[
{
- titre: this.ConfigServeur.messages.attention,
- confirmation: this.ConfigServeur.messages.saisieSyntheseAlert + '\n'
+ titre:this.ConfigServeur.messages.attention,
+ confirmation:this.ConfigServeur.messages.saisieSyntheseAlert + '\n'
+ this.ConfigServeur.messages.confirmationQuitterSaisieSynthese,
- test: function() {
+ test:function () {
return this.listeAppreciationModifiee.length !== 0;
}
}
/**
* Ouvrir le conseil de classe
*/
- executeOuvrirAppreciationClasse: function() {
+ executeOuvrirAppreciationClasse:function () {
eliot.notes.Messages.afficherDialogMultiConfirmation({
- scope: this,
- success: function() {
+ scope:this,
+ success:function () {
var location = this.ConfigServeur.url.urlAppreciationClasse +
'?classeId=' + this.ConfigServeur.data.classeId +
window.location = location;
},
- failure: function() {
+ failure:function () {
},
- verifications: [
+ verifications:[
{
- titre: this.ConfigServeur.messages.attention,
- confirmation: this.ConfigServeur.messages.saisieSyntheseAlert + '\n'
+ titre:this.ConfigServeur.messages.attention,
+ confirmation:this.ConfigServeur.messages.saisieSyntheseAlert + '\n'
+ this.ConfigServeur.messages.confirmationQuitterSaisieSynthese,
- test: function() {
+ test:function () {
return this.listeAppreciationModifiee.length !== 0;
}
}
/**
* Elève en cours
*/
- getEleveIdEnCours: function() {
+ getEleveIdEnCours:function () {
// !!!! Méthode injectée après la création par une méthode de la vue
return undefined;
},
/**
* Ouvrir le graph
*/
- ouvreGraphWindow: function() {
+ ouvreGraphWindow:function () {
var eleveId = this.getEleveIdEnCours();
if (eleveId != null) {
Ext.Ajax.request({
- url : this.ConfigServeur.url.urlGraphTblNotes,
+ url:this.ConfigServeur.url.urlGraphTblNotes,
- params : {
- eleveId: eleveId,
- periodeId: this.ConfigServeur.data.periodeId,
- chargePeriodesPrecedentes:
- this.tblNotesView.periodesPrecedentesCheckbox.getValue()
+ params:{
+ eleveId:eleveId,
+ periodeId:this.ConfigServeur.data.periodeId,
+ chargePeriodesPrecedentes:this.tblNotesView.periodesPrecedentesCheckbox.getValue()
},
- success : function(response, request) {
+ success:function (response, request) {
var reponse = Ext.decode(response.responseText);
if (reponse.success != true) {
if (reponse.errorMsg) {
reponse.graphPeriodes);
}
},
- failure : function() {
+ failure:function () {
eliot.notes.Messages.showErreur(
this.ConfigServeur.messages.tblNotesGraphEchou
);
},
- scope : this
+ scope:this
});
}
},
- hideColumn: function(index, hidden) {
+ hideColumn:function (index, hidden) {
this.fireEvent(this.Constantes.eventId.actionColumnHidden, index, hidden);
},
- afficheMoyennesPrecedentes: function(checked) {
+ afficheMoyennesPrecedentes:function (checked) {
eliot.notes.Messages.resetMessages();
Ext.Ajax.request({
- url : this.ConfigServeur.url.enregistrePreferenceUtilisateur,
+ url:this.ConfigServeur.url.enregistrePreferenceUtilisateur,
- params : {
- moyennesPrecedentes: checked
+ params:{
+ moyennesPrecedentes:checked
},
- success : function(response, request) {
+ success:function (response, request) {
},
- failure : function() {
+ failure:function () {
eliot.notes.Messages.showErreur(
this.ConfigServeur.messages.enregistrePreferenceUtilisateurEchec);
},
- scope : this
+ scope:this
});
},
- afficheRang: function(checked) {
+ afficheRang:function (checked) {
eliot.notes.Messages.resetMessages();
Ext.Ajax.request({
- url : this.ConfigServeur.url.enregistrePreferenceUtilisateur,
+ url:this.ConfigServeur.url.enregistrePreferenceUtilisateur,
- params : {
- rangs: checked
+ params:{
+ rangs:checked
},
- success : function(response, request) {
+ success:function (response, request) {
},
- failure : function() {
+ failure:function () {
eliot.notes.Messages.showErreur(
this.ConfigServeur.messages.enregistrePreferenceUtilisateurEchec);
},
- scope : this
+ scope:this
});
}
/**
* Constructeur
*/
- constructor: function(config) {
+ constructor:function (config) {
this.init(eliot.notes.saisie.synthese, config);
// Bouton "Enregistrer"
this.btnEnregistrer = new Ext.Button({
- text: this.ConfigServeur.libelle.enregistrer,
- icon: this.ConfigServeur.icon.enregistrer,
+ text:this.ConfigServeur.libelle.enregistrer,
+ icon:this.ConfigServeur.icon.enregistrer,
style:'margin-top: 3px;margin-left: 25px;',
- listeners: {
- click: function() {
+ listeners:{
+ click:function () {
this.setModeEdition(false);
this.fireEvent(this.Constantes.eventId.actionEnregistrerNotes);
},
- scope: this
+ scope:this
},
- disabled: true
+ disabled:true
});
// Bouton "Annuler"
this.btnAnnuler = new Ext.Button({
- text: this.ConfigServeur.libelle.annuler,
- icon: this.ConfigServeur.icon.annuler,
+ text:this.ConfigServeur.libelle.annuler,
+ icon:this.ConfigServeur.icon.annuler,
style:'margin-top: 3px;margin-left: 25px',
- listeners: {
- click: function() {
+ listeners:{
+ click:function () {
this.setModeEdition(false);
this.fireEvent(this.Constantes.eventId.actionAnnulerModifNotes);
},
- scope: this
+ scope:this
},
- disabled: true
+ disabled:true
});
// Bouton "Graph"
this.btnGraph = new Ext.Button({
- text: this.ConfigServeur.libelle.graph,
- icon: this.ConfigServeur.icon.graph,
+ text:this.ConfigServeur.libelle.graph,
+ icon:this.ConfigServeur.icon.graph,
style:'margin-top: 3px;margin-left: 25px;',
- listeners: {
- click: function() {
+ listeners:{
+ click:function () {
this.fireEvent(this.Constantes.eventId.actionOuvrirGraphWindow);
},
- scope: this
+ scope:this
},
- disabled: true
+ disabled:true
});
// Bouton "Impression"
this.btnImprimer = new Ext.Button({
- text: this.ConfigServeur.libelle.imprimer,
- icon: this.ConfigServeur.icon.imprimer,
+ text:this.ConfigServeur.libelle.imprimer,
+ icon:this.ConfigServeur.icon.imprimer,
style:'margin-top: 3px;margin-left: 25px',
- listeners: {
- click: function() {
+ listeners:{
+ click:function () {
this.config.impressionController.ouvrePopup();
},
- scope: this
+ scope:this
},
- disabled: desactiveBouton
+ disabled:desactiveBouton
});
this.btnAffichage = this.creeBtnAffichage(desactiveBouton);
// Toolbar
this.toolbar = new Ext.Toolbar({
- border: true,
- autoWidth: true,
- height: 35,
- items: toolbarItems
+ border:true,
+ autoWidth:true,
+ height:35,
+ items:toolbarItems
});
},
- init: function(ns, config) {
+ init:function (ns, config) {
this.ns = ns;
this.Constantes = this.ns.Constantes;
this.ConfigServeur = this.ns.Modele;
creeConfig:function () {
return {
- boutonExporter: undefined,
- impressionController: undefined
+ boutonExporter:undefined,
+ impressionController:undefined
};
},
- creeConseilDeClasseButton: function (toolbarItems, desactiveBouton) {
+ creeConseilDeClasseButton:function (toolbarItems, desactiveBouton) {
var menu = [
{
- text: 'Audit notes et appréciations', // TODO : traduction
- listeners: {
- click: function() {
+ text:'Audit notes et appréciations', // TODO : traduction
+ listeners:{
+ click:function () {
this.fireEvent(this.Constantes.eventId.actionOuvrirAuditNoteAppreciation);
},
- scope: this
+ scope:this
}
},
{
- text: this.ConfigServeur.libelle.vueEleve,
- listeners: {
- click: function() {
+ text:this.ConfigServeur.libelle.vueEleve,
+ listeners:{
+ click:function () {
this.fireEvent(this.Constantes.eventId.actionOuvrirConseilDeClasse);
},
- scope: this
+ scope:this
}
}
];
if (!desactiveBouton) {
menu.push({
- text: 'Appréciations classe', // TODO : traduction
- listeners: {
- click: function() {
+ text:'Appréciations classe', // TODO : traduction
+ listeners:{
+ click:function () {
this.fireEvent(this.Constantes.eventId.actionOuvrirAppreciationClasse);
},
- scope: this
+ scope:this
}
});
}
toolbarItems.push(new Ext.Button({
- text: this.ConfigServeur.libelle.conseilDeClasse,
- icon: this.ConfigServeur.icon.conseilDeClasse,
+ text:this.ConfigServeur.libelle.conseilDeClasse,
+ icon:this.ConfigServeur.icon.conseilDeClasse,
style:'margin-top: 3px;margin-left: 25px;',
- disabled: desactiveBouton,
- menu: menu
+ disabled:desactiveBouton,
+ menu:menu
}));
},
- creeBtnAffichage: function(desactiveBouton) {
- button = new Ext.Button({
- xtype: 'tbbutton',
- text: this.ConfigServeur.libelle.affichage,
+ creeBtnAffichage:function (desactiveBouton) {
+ return new Ext.Button({
+ xtype:'tbbutton',
+ text:this.ConfigServeur.libelle.affichage,
style:'margin-top: 3px;margin-left: 25px',
- disabled: desactiveBouton,
- menu: [
+ disabled:desactiveBouton,
+ menu:[
{
- xtype: 'menucheckitem',
- text: this.ConfigServeur.libelle.moyennesPrecedentes,
- checked: this.ConfigServeur.data.affichage.moyennesPrecedentes,
- cls: 'x-btn-icon',
- listeners: {
- checkchange: function(item, checked) {
+ xtype:'menucheckitem',
+ text:this.ConfigServeur.libelle.moyennesPrecedentes,
+ checked:this.ConfigServeur.data.affichage.moyennesPrecedentes,
+ cls:'x-btn-icon',
+ listeners:{
+ checkchange:function (item, checked) {
this.fireEvent(
this.Constantes.eventId.afficheMoyennesPrecedentes, checked);
},
- scope: this
+ scope:this
}
},
{
- xtype: 'menucheckitem',
- text: this.ConfigServeur.libelle.rang,
- checked: this.ConfigServeur.data.affichage.rangs,
- cls: 'x-btn-icon',
- listeners: {
- checkchange: function(item, checked) {
+ xtype:'menucheckitem',
+ text:this.ConfigServeur.libelle.rang,
+ checked:this.ConfigServeur.data.affichage.rangs,
+ cls:'x-btn-icon',
+ listeners:{
+ checkchange:function (item, checked) {
this.fireEvent(
this.Constantes.eventId.afficheRang, checked);
},
- scope: this
+ scope:this
}
+ },
+ '-',
+ {
+ text:this.ConfigServeur.libelle.elevesArchives,
+ handler:function () {
+ this.fireEvent(this.Constantes.eventId.actionAfficherElevesArchives);
+ },
+ scope:this
}
]
});
-
- return button;
},
/**
* Observe le controlleur tableau de note
* @param tblNotesController
*/
- observeTblNotesController : function(tblNotesController) {
+ observeTblNotesController:function (tblNotesController) {
tblNotesController.addListener(
this.Constantes.eventId.actionChangeAppreciation,
- function(record, change) {
+ function (record, change) {
//if (change) {
this.setModeEdition(true);
//}
* Observe la vue tableau de note
* @param tblNotesView
*/
- observeTblNotesView : function(tblNotesView) {
+ observeTblNotesView:function (tblNotesView) {
tblNotesView.addListener(
this.Constantes.eventId.actionChangeAppreciation,
- function(record, change) {
+ function (record, change) {
this.setModeEdition(true);
},
this
tblNotesView.addListener(
this.Constantes.eventId.eleveChange,
- function(eleve) {
- if (!eleve){
+ function (eleve) {
+ if (!eleve) {
this.btnGraph.disable();
} else {
Ext.Ajax.request({
- url : this.ConfigServeur.url.urlGraphTblNotes,
- params : {
- eleveId: eleve.data.personneId,
- periodeId: this.ConfigServeur.data.periodeId,
- chargePeriodesPrecedentes:
- tblNotesView.periodesPrecedentesCheckbox.getValue()
+ url:this.ConfigServeur.url.urlGraphTblNotes,
+ params:{
+ eleveId:eleve.data.personneId,
+ periodeId:this.ConfigServeur.data.periodeId,
+ chargePeriodesPrecedentes:tblNotesView.periodesPrecedentesCheckbox.getValue()
},
- success : function(response, request) {
+ success:function (response, request) {
var reponse = Ext.decode(response.responseText);
if (reponse.success == true && reponse.data && reponse.data.length != 0) {
this.btnGraph.enable();
} else {
this.btnGraph.disable();
}
- } ,
- scope : this
+ },
+ scope:this
});
}
},
this);
},
- setButtonStates: function(edition) {
+ setButtonStates:function (edition) {
if (edition === true) {
this.btnEnregistrer.enable();
this.btnAnnuler.enable();
}
},
- setButtonStatesDelayed: function(edition) {
+ setButtonStatesDelayed:function (edition) {
this.setButtonStates.defer(500, this, [edition]);
},
* Mode édition
* @param edition (booléen)
*/
- setModeEdition: function(edition) {
+ setModeEdition:function (edition) {
this.setButtonStatesDelayed(edition);
}