-package org.lilie.services.eliot.impression
+package org.lilie.services.eliot.notes
+
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.impression.TemplateDocument
/**
- * Options d'impression du bulletin
+ * Options d'affichage et d'impression du bulletin
* @author othe
*/
class BulletinOptions {
Boolean nombreNotes = true
Boolean rangs = false
+ StructureEnseignement classe
+
static constraints = {
templateDocument(nullable: false)
+ classe(nullable: true, validator: {value -> value == null || value.isClasse()})
}
static mapping = {
@Override
String toString() {
return "BulletinOptions "+
- "moyenneGenerale: $moyenneGenerale "+
- "coefficient: $coefficient "+
- "moyennePrecedente: $moyennePrecedente "+
- "moyenneMinMax: $moyenneMinMax "+
- "nombreNotes: $nombreNotes "+
- "rangs: $rangs "
+ "moyenneGenerale: $moyenneGenerale "+
+ "coefficient: $coefficient "+
+ "moyennePrecedente: $moyennePrecedente "+
+ "moyenneMinMax: $moyenneMinMax "+
+ "nombreNotes: $nombreNotes "+
+ "rangs: $rangs "
}
+
+
}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+
+package org.lilie.services.eliot.applications.notes
+
+import org.lilie.services.eliot.notes.BulletinOptions
+
+class BulletinOptionsService {
+
+ void enregistre(BulletinOptions bulletinOptions) {
+ bulletinOptions.save(flush: true, failOnError: true)
+ }
+
+ void enregistre(BulletinOptions bulletinOptions, Map params) {
+ bulletinOptions.moyenneGenerale = params.moyenneGenerale ? Boolean.valueOf(params.moyenneGenerale) : null
+ bulletinOptions.coefficient = params.coefficient ? Boolean.valueOf(params.coefficient) : null
+ bulletinOptions.moyennePrecedente = params.moyennePrecedente ? Boolean.valueOf(params.moyennePrecedente) : null
+ bulletinOptions.moyenneMinMax = params.moyenneMinMax ? Boolean.valueOf(params.moyenneMinMax) : null
+ bulletinOptions.nombreNotes = params.moyenneGenerale ? Boolean.valueOf(params.nombreNotes) : null
+ bulletinOptions.rangs = params.moyenneGenerale ? Boolean.valueOf(params.rangs) : null
+
+ bulletinOptions.save(flush: true, failOnError: true)
+ }
+}
*/
class MatiereImpressionInfo extends SousMatiereImpressionInfo{
+ Long idMatiere
+
String prof // nom de prof (Nom + prenom) ou des profs pour le cas de co-enseignement
List<SousMatiereImpressionInfo> sousMatieres = []
*/
class SousMatiereImpressionInfo {
+ Long idSousMatiere
+
// Moyenne précédente (T1 ou S1)
String moyennePrec1 = ""
// Moyenne précédente (T2 ou S2)
import org.lilie.services.eliot.impression.ImpressionServiceException
import org.lilie.services.eliot.impression.ImpressionServiceNomUniqueException
import org.lilie.services.eliot.impression.TemplateDocumentSousTemplateEliot
-import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.notes.BulletinOptions
import org.lilie.services.eliot.impression.PublipostageSuivi
class ImpressionTemplateDocumentService {
package org.lilie.services.eliot.impression.template.bulletin.option
-import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.notes.BulletinOptions
/**
* DTO donnant la liste des options d'impression correspondant à la demande de la personne courante
package org.lilie.services.eliot.impression.template.bulletin.option
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.notes.BulletinOptions
import org.lilie.services.eliot.scolarite.TypePeriode
import org.lilie.services.eliot.scolarite.IntervalleEnum
import org.lilie.services.eliot.impression.template.bulletin.colonne.ColonneDescription
import org.lilie.services.eliot.impression.template.bulletin.colonne.ColonneBulletin
+import org.lilie.services.eliot.scolarite.StructureEnseignement
/**
* Permet de calculer des données de positionnement et d'affichage à partir du DTO de paramétrage
*/
class ImpressionBulletinOptionsService {
+
+ public BulletinOptionsPersonnalise getParametreOptionsByTemplate(TemplateDocument templateDocument,
+ TypePeriode typePeriode){
+ BulletinOptions bulletinOptions = BulletinOptions.findByTemplateDocument(templateDocument)
+
+ return getParametreOptions(bulletinOptions, typePeriode)
+ }
+
+ public BulletinOptionsPersonnalise getParametreOptionsByTemplateAndClasse(TemplateDocument templateDocument,
+ TypePeriode typePeriode,
+ StructureEnseignement classe){
+ BulletinOptions bulletinOptions =
+ classe ? BulletinOptions.findByTemplateDocumentAndClasse(templateDocument, classe) : null
+
+ return getParametreOptions(bulletinOptions, typePeriode)
+ }
+
/**
* Retourne le paramétrage d'un bulletin
* @param templateDocument
* @param typePeriode
* @return
*/
- public BulletinOptionsPersonnalise getParametreOptions(TemplateDocument templateDocument, TypePeriode typePeriode) {
+ private BulletinOptionsPersonnalise getParametreOptions(BulletinOptions bulletinOptions, TypePeriode typePeriode) {
BulletinOptionsPersonnalise resultat
- BulletinOptions bulletinOptions = BulletinOptions.findByTemplateDocument(templateDocument)
if (bulletinOptions) {
resultat = new BulletinOptionsPersonnalise(bulletinOptions)
} else {
return false
case ColonneGroupeEnum.MOYENNES:
- return false
+ return !bulletinParametrage.moyenneGenerale
case ColonneGroupeEnum.COEFF:
return !bulletinParametrage.coefficient
}
case ColonneGroupeEnum.MOYENNES:
- return true
+ return bulletinParametrage.moyenneGenerale
case ColonneGroupeEnum.COEFF:
return bulletinParametrage.coefficient
// Vérifie typeIntervalle,deux types sont autorisés : TRIMESTRE et SEMESTERE
if (typeIntervalle != TypeIntervalleEnum.TRIMESTRE &&
- typeIntervalle != TypeIntervalleEnum.SEMESTRE) {
+ typeIntervalle != TypeIntervalleEnum.SEMESTRE) {
throw new IllegalArgumentException("Le type d'intervalle doit etre ${TypeIntervalleEnum.TRIMESTRE} ou ${TypeIntervalleEnum.SEMESTRE}")
}
// Création de nouvelle période
Periode periode = new Periode(
- typePeriode: tp[intervalle],
- classe: struct
+ typePeriode: tp[intervalle],
+ classe: struct
)
// Sauvgarde avec la géstion des accès concurrents
/**
* Toutes les periodes de Xmestres precedantes la periode pour la classe donnee
+ * @param classe
+ * @param periode
+ * @return
*/
List<Periode> findAllPeriodesPrecedentes(StructureEnseignement classe, Periode periode) {
if (!classe.isClasse()) {
* @return
* @deprecated Utilisez getPeriodeCodeCourt et i18n au lieu.
*/
- public String getPeriodeNomCourt(String libelleTypePeriode){
+ public String getNomPeriodePrecedente(String libelleTypePeriode){
switch (libelleTypePeriode){
- case 'T1': return '1er T'
- case 'T2': return '2ème T'
- case 'T3': return '3ème T'
- case 'S1': return '1er S'
- case 'S2': return '2ème S'
- default: return libelleTypePeriode
+ case 'T1':
+ return '1er T'
+ break
+ case 'T2':
+ return '2ème T'
+ break
+ case 'T3':
+ return '3ème T'
+ break
+ case 'S1':
+ return '1er S'
+ break
+ case 'S2':
+ return '2ème S'
+ break
}
}
+
}
import org.lilie.services.eliot.impression.constantes.ConfigImpression
import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
import org.lilie.services.eliot.impression.constantes.TemplateDocumentEnum
+import org.lilie.services.eliot.notes.BulletinOptions
class ImpressionImportServiceTests extends GroovyTestCase {
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.notes.EtablissementNotes
import org.lilie.services.eliot.scolarite.EtablissementSts
+import org.lilie.services.eliot.notes.BulletinOptions
class ImpressionMoteurServiceTests extends GroovyTestCase {
--- /dev/null
+<!--
+ ~ Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ ~ This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ ~
+ ~ Lilie is free software. You can redistribute it and/or modify since
+ ~ you respect the terms of either (at least one of the both license) :
+ ~ - under the terms of the GNU Affero General Public License as
+ ~ published by the Free Software Foundation, either version 3 of the
+ ~ License, or (at your option) any later version.
+ ~ - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ ~ License, or any later version
+ ~
+ ~ There are special exceptions to the terms and conditions of the
+ ~ licenses as they are applied to this software. View the full text of
+ ~ the exception in file LICENSE.txt in the directory of this software
+ ~ distribution.
+ ~
+ ~ Lilie is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ Licenses for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ and the CeCILL-C along with Lilie. If not, see :
+ ~ <http://www.gnu.org/licenses/> and
+ ~ <http://www.cecill.info/licences.fr.html>.
+ -->
+<databaseChangeLog
+ xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
+
+ <changeSet id="1" author="agia">
+ <comment>
+ Ajout de colonne 'classe' dans la table 'impression.bulletin_options'
+ </comment>
+
+ <addColumn schemaName="impression" tableName="bulletin_options">
+ <column name="classe_id" type="int" >
+ <constraints nullable="true" />
+ </column>
+ </addColumn>
+
+ <addForeignKeyConstraint baseTableSchemaName="impression"
+ baseTableName="bulletin_options"
+ baseColumnNames="classe_id"
+ constraintName="fk_bulletin_options_classe_id"
+ referencedTableSchemaName="ent"
+ referencedTableName="structure_enseignement"
+ referencedColumnNames="id" />
+
+ </changeSet>
+
+ <changeSet id="2" author="agia">
+ <comment>
+ Ajout de contrainte d'unicité sur la classe
+ </comment>
+
+ <addUniqueConstraint schemaName="impression"
+ tableName="bulletin_options"
+ columnNames="classe_id"
+ constraintName="uk_bulletin_options_classe_id"/>
+ </changeSet>
+
+</databaseChangeLog>
<include file="changelogs/securite/2013-04-15-0027191.xml"/>
<include file="changelogs/scolarite/2013-04-16-0027053.xml"/>
<include file="changelogs/securite/2013-04-22-0027191.xml"/>
+ <include file="changelogs/scolarite/2013-05-17-0027531.xml"/>
<include file="changelogs/scolarite/annuaire_interface/2013-04-23-0023926.xml"/>
<include file="changelogs/scolarite/annuaire_interface/2013-04-24-0027499.xml"/>
<include file="changelogs/scolarite/2013-04-19-0026845.xml"/>
import org.lilie.services.eliot.AbstractEliotController
import org.lilie.services.eliot.menu.MenuInfo
import org.lilie.services.eliot.EliotConstantes
+import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.scolarite.Periode
import javax.servlet.http.HttpServletResponse
protected Collection<ExceptionHandler> getExceptionHandlers() {
return NotesExceptionHandler.values()
}
+
+ protected TemplateDocument getTemplateDocumentForImpressionDirecteBulletin(){
+ return TemplateDocument.findByCode("BULLETIN_NOTES_1")
+ }
}
import org.lilie.services.eliot.notes.AbstractNotesController
import org.lilie.services.eliot.scolarite.PeriodeService
import org.lilie.services.eliot.notes.ResultatEleveServicePeriode
+import org.lilie.services.eliot.notes.ResultatEleveSousServicePeriode
import org.lilie.services.eliot.notes.AvisElevePeriode
import org.lilie.services.eliot.notes.TypeAvis
import org.lilie.services.eliot.PeriodeLibelleMode
+import org.lilie.services.eliot.impression.donnees.eleve.TableauImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.MatiereImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.SousMatiereImpressionInfo
/**
* @author bper
if (avecPeriodesPrecedentes) {
periodeService.findAllPeriodesPrecedentes(periode.classe, periode).
each { Periode periodePrecedente ->
- bulletinsPrecedents.put(
- periodePrecedente,
- bulletinService.construisBulletin(
- controller.securiteSession,
- eleve,
+ bulletinsPrecedents.put(
periodePrecedente,
- true)
- )
- }
+ bulletinService.construisBulletin(
+ controller.securiteSession,
+ eleve,
+ periodePrecedente,
+ true)
+ )
+ }
}
} else {
message = getMessagePublication(periode)
Map getComposantModele(Boolean asJSON) {
return [
- moyennesServices: asJSON ? getMoyennesServices() as JSON : getMoyennesServices(),
- recapitulatifs: asJSON ? getRecapitulatifs() as JSON : getRecapitulatifs(),
- publie: bulletinsPublies,
- messagePublication: message,
- //verrouille: bulletin?.periode?.verrouille,
- moyennesAjour: bulletin?.moyennesAjour,
- messageMoyennesNonAJour: controller.message(code: 'eliot.notes.message.MoyennesNonAJour',
- args: [bulletin?.dateDernierCalculMoyennes])
+ moyennesServices: asJSON ? getMoyennesServices() as JSON : getMoyennesServices(),
+ recapitulatifs: asJSON ? getRecapitulatifs() as JSON : getRecapitulatifs(),
+ publie: bulletinsPublies,
+ messagePublication: message,
+ //verrouille: bulletin?.periode?.verrouille,
+ moyennesAjour: bulletin?.moyennesAjour,
+ messageMoyennesNonAJour: controller.message(code: 'eliot.notes.message.MoyennesNonAJour',
+ args: [bulletin?.dateDernierCalculMoyennes])
]
}
*/
private Map toMap(BulletinServiceResultat sRes) {
- return [
+ Map map = [
isSousService: false,
service: toMap(sRes.service),
moyenneEleve: sRes.resultatEleveServicePeriode?.getValeurAffichage(),
appreciations: recupereAppreciations(sRes),
sousServices: sRes.sousServiceResultats.collect { toMap(it) }
]
+
+ // Moyennes precedentes
+ List<ResultatEleveServicePeriode> resultatEleveServiceXmestrePrecedents =
+ sRes.resultatEleveServiceXmestrePrecedents
+
+ resultatEleveServiceXmestrePrecedents.each {
+ map."moyenneElevePrecedente${it.periode.id}" = it.getValeurAffichage()
+ }
+ // Nombre de notes
+ map.put('nbNotes', !map.sousServices && sRes.resultatEleveServicePeriode?.nbNotes ? sRes.resultatEleveServicePeriode?.nbNotes : "")
+ // Rangs / nombre d'élèves
+ Integer rang = sRes.resultatEleveServicePeriode?.rang
+ Integer nbEleves = sRes.resultatEleveServicePeriode?.nbEleves
+ String rangSurNbEleves = rang && nbEleves ? rang.toString() + '/' + nbEleves.toString() : ""
+ map.put('rangs',rangSurNbEleves)
+
+ return map
}
List<String> recupereAppreciations(BulletinServiceResultat bulletinServiceResultat) {
// liste appreciations dans le meme ordre comme les professeurs dans le service
return bulletinServiceResultat.service.enseignements.toList().sort {
Personne.findByAutorite(it.enseignant).nomAffichage() }.collect { Enseignement enseignement ->
- bulletinServiceResultat.appreciationEleveEnseignementPeriodes.find {
- it.enseignement.id == enseignement.id }?.appreciation ?: ''
+ bulletinServiceResultat.appreciationEleveEnseignementPeriodes.find {
+ it.enseignement.id == enseignement.id }?.appreciation ?: ''
}
}
* @author bper
*/
private Map toMap(BulletinSousServiceResultat ssRes) {
- return [
+
+ Map map = [
isSousService: true,
service: toMap(ssRes.sousService),
moyenneEleve: ssRes.resultatEleveSousServicePeriode?.getValeurAffichage(),
moyenneClasseMax: ssRes.resultatClasseSousServicePeriode?.moyenneMax,
moyenneClasseMin: ssRes.resultatClasseSousServicePeriode?.moyenneMin
]
+
+ // Moyennes precedentes
+ List<ResultatEleveSousServicePeriode> resultatEleveSousServiceXmestrePrecedents =
+ ssRes.resultatEleveSousServiceXmestrePrecedents
+
+ resultatEleveSousServiceXmestrePrecedents.each {
+ map."moyenneElevePrecedente${it.resultatEleveServicePeriode.periode.id}" = it.getValeurAffichage()
+ }
+ // Nombre de notes
+ map.put('nbNotes', ssRes.resultatEleveSousServicePeriode?.nbNotes ? ssRes.resultatEleveSousServicePeriode?.nbNotes : "")
+
+ return map
}
/**
import org.lilie.services.eliot.notes.impression.ImpressionRequetageBulletinReleveService
import org.lilie.services.eliot.impression.donnees.DonneesOptions
import org.lilie.services.eliot.impression.template.bulletin.option.ImpressionBulletinOptionsService
+import org.lilie.services.eliot.notes.BulletinOptions
/**
* La classe représente le controlleur de "Bulletin" dans menu "Consultation"
// La liste des classes auxquelles l'utilisateur a l'accès
List<StructureEnseignement> classes = notesStructureEnseignementService.
findAllClasseForUtilisateur(
- securiteSession,
- etablissementCourant(),
- Action.CONSULTATION)
+ securiteSession,
+ etablissementCourant(),
+ Action.CONSULTATION)
classes.sort {a, b -> cc.compare(a.code, b.code)}
// Dans le cas où il y a une seule classe dans la liste elle est sélectionné
// dans le combo, les élèves et les périodes sont chargés directement
+ BulletinOptions bulletinOptions = null
if (classes?.size() == 1) {
classe = classes.first()
if ((eleve == null) && (eleves != null) && (eleves.size() > 0)) {
eleve = eleves.first()
}
+
+ bulletinOptions = BulletinOptions.findByClasse(classe)
}
Map resultat = prepareBaseModele(Page.CONSULTATION_BULLETIN)
periode,
false)
resultat.putAll(bulletinComposant.getComposantModele(true))
+
+ if (bulletinOptions){
+ resultat.optionsPublication = bulletinOptions
+ }
}
resultat = ajouteAnnotations(resultat)
def bulletinDeNotes = {
Map result = getResultIfNullParams(['eleveId', 'periodeId'])
Boolean print = false
+
+ StructureEnseignement classe = params.classeId ? StructureEnseignement.get(Long.valueOf(params.classeId)) : null
+ Periode periode = Periode.get(Long.valueOf(params.periodeId))
+ Personne eleve = Personne.get(Long.valueOf(params.eleveId))
+
if (!result) {
result = tryCatch {
notesDroitService.verifieAutorisationByEtablissement(
)
print = (params.print != null) ? Boolean.valueOf(params.print) : false
- Periode periode = Periode.get(Long.valueOf(params.periodeId))
- Personne eleve = Personne.get(Long.valueOf(params.eleveId))
+
BulletinComposant bulletinComposant = new BulletinComposant(
this,
bulletinService,
eleve,
periode,
false)
+
result = bulletinComposant.getComposantModele(false)
+
+ // Récupération des périodes précédentes
+ List<Periode> periodesPrecedentes = periode.isPeriodeNotation() ?
+ periode.getPeriodesPrecedentes() : []
+
+
+ result.periodesPrecedentes = !periodesPrecedentes.isEmpty() ?
+ periodesPrecedentes.collect {[id: it.id, libelle: periodeService.getNomPeriodePrecedente(it.typePeriode.libelle)]} : null
+
+ // Récupération des options de publication pour la consultation du bulletin
+ BulletinOptions bulletinOptions
+ if (classe){
+ bulletinOptions = BulletinOptions.findByClasse(classe)
+ }
+
+ result.optionsPublication = bulletinOptions
+
+ return result
}
}
if (print) {
// get infos pour impression
- Periode periode = Periode.get(params.periodeId)
String libelleTypePeriode = getTypePeriodeLibelle(periode.typePeriode)
- Personne eleve = Personne.get(params.eleveId)
List<Personne> lstEleve = [eleve]
- TemplateDocument templateDocument = TemplateDocument.findByCode("BULLETIN_NOTES_1")
+ TemplateDocument templateDocument = getTemplateDocumentForImpressionDirecteBulletin()
List<EleveImpressionInfo> eleveImpressionInfos =
- impressionRequetageBulletinReleveService.findAllInfoForNotes(
- securiteSession,
- etablissementCourant(),
- lstEleve,
- templateDocument,
- SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1,
- periode.typePeriode,
- periode
- )
+ impressionRequetageBulletinReleveService.findAllInfoForNotes(
+ securiteSession,
+ etablissementCourant(),
+ lstEleve,
+ templateDocument,
+ SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1,
+ periode.typePeriode,
+ periode
+ )
eleveImpressionInfos?.each { EleveImpressionInfo eleveImpressionInfo ->
eleveImpressionInfo.classe_PeriodeNom = libelleTypePeriode
DonneesOptions donneesOptions = new DonneesOptions(
data: eleveImpressionInfos,
- options: impressionBulletinOptionsService.getParametreOptions(
+ options: impressionBulletinOptionsService.getParametreOptionsByTemplateAndClasse(
templateDocument,
- periode.typePeriode
+ periode.typePeriode,
+ classe
)
)
}
/**
- * Gestion du breadCrumbs
- * @return
- */
+ * Gestion du breadCrumbs
+ * @return
+ */
protected List getBreadCrumbsInfo() {
List breadCrumbsInfo = super.getBreadCrumbsInfo()
breadCrumbsInfo << new BreadCrumbsItemInfo(
import org.lilie.services.eliot.notes.NotesDroitService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.notes.NotesFonction
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.notes.BulletinOptions
+import org.lilie.services.eliot.applications.notes.BulletinOptionsService
/**
* Périodes
NotesDroitService notesDroitService
NotesPeriodeService notesPeriodeService
NotesStructureEnseignementService notesStructureEnseignementService
+ BulletinOptionsService bulletinOptionsService
/**
* Périodes de service
render result as JSON
}
+ def enregistreOptionsPublication = {
+ Map result = tryCatch{
+ notesDroitService.verifieAutorisationByEtablissement(
+ securiteSession,
+ etablissementCourant(),
+ Action.MODIFICATION,
+ NotesFonction.DIRECTION_ASSIMILE
+ )
+
+ BulletinOptions bulletinOptions
+
+ def bulletinOptionsId = params.bulletinOptionsId
+ if (bulletinOptionsId){
+ bulletinOptions = BulletinOptions.get(Long.valueOf(bulletinOptionsId))
+ } else {
+ bulletinOptions = new BulletinOptions()
+ bulletinOptions.templateDocument = getTemplateDocumentForImpressionDirecteBulletin()
+ bulletinOptions.classe = params.classeId ? StructureEnseignement.get(Long.valueOf(params.classeId)) : null
+ }
+
+ if (!bulletinOptions.classe){
+ throw new IllegalArgumentException("La classe concernée par les options de publication ne peut pas être nulle", e)
+ }
+
+ bulletinOptionsService.enregistre(bulletinOptions, params)
+
+ }
+
+ render result as JSON
+ }
+
+ def getOptionsPublication = {
+
+ BulletinOptions bulletinOptions = null
+
+ Map result = tryCatch{
+ notesDroitService.verifieAutorisationByEtablissement(
+ securiteSession,
+ etablissementCourant(),
+ Action.MODIFICATION,
+ NotesFonction.DIRECTION_ASSIMILE
+ )
+
+ StructureEnseignement classe = params.classeId ? StructureEnseignement.get(Long.valueOf(params.classeId)) : null
+ if (classe){
+ bulletinOptions = BulletinOptions.findByClasse(classe)
+ if (!bulletinOptions){
+ bulletinOptions = new BulletinOptions(
+ templateDocument : getTemplateDocumentForImpressionDirecteBulletin(),
+ moyenneGenerale : true,
+ coefficient : true,
+ moyennePrecedente : false,
+ moyenneMinMax : true,
+ nombreNotes : false,
+ rangs : false,
+ classe : classe
+ )
+ bulletinOptionsService.enregistre(bulletinOptions)
+ }
+ } else {
+ throw new IllegalArgumentException("La classe concernée par les options de publication ne peut pas être nulle", e)
+ }
+ }
+
+ result.optionsDePublication = bulletinOptions
+
+ render result as JSON
+ }
+
}
BulletinOptionsPersonnalise bulletinOptionsPersonnalise = null
if (typePeriode){
bulletinOptionsPersonnalise =
- impressionBulletinOptionsService.getParametreOptions(
+ impressionBulletinOptionsService.getParametreOptionsByTemplate(
template,
typePeriode
)
eliot.notes.libelle.creer=Créer
eliot.notes.libelle.modifier=Modifier
eliot.notes.libelle.supprimer=Supprimer
+eliot.notes.libelle.btnOptionsDePublication=Options
eliot.notes.libelle.plusDActions=Plus d'actions
eliot.notes.libelle.titre=Nom
eliot.notes.libelle.dateEvaluation=Date
eliot.notes.libelle.reportDuParametrage=Appliquer à
eliot.notes.message.avertissement.appliquerA=La fonction de paramétrages des services sera momentanément indisponible durant le traitement.<br>Elle vous permettra d'accéder au suivi de l'application de vos paramétrages.
+eliot.notes.libelle.optionsDePublication=Options
+eliot.notes.libelle.coefficient=Coefficient
+eliot.notes.libelle.moyennesMinMax=MoyennesMin./Max.
+eliot.notes.libelle.nbNotes=Nombre de notes
+eliot.notes.libelle.rangSurNbEleves=Rang/Nombre d'élèves
+
eliot.notes.libelle.ok=Ok
eliot.notes.libelle.oui=Oui
eliot.notes.libelle.non=Non
eliot.notes.libelle.selParamAppliqueA=Sélection des paramétrages des périodes à appliquer
+eliot.notes.libelle.selOptionsDePublication=Afficher sur le bulletin en consultation :
eliot.notes.libelle.selClassesAModifier=Sélection des classes à modifier
eliot.notes.libelle.notesEtMoyennes=Notes et Moyennes
eliot.notes.libelle.affichage=Affichage
eliot.notes.libelle.moyennesPrecedentes=Moyennes précédentes
eliot.notes.libelle.rang=Rang
+eliot.notes.libelle.rangs=Rangs
+eliot.notes.libelle.nbre=Nbre
eliot.notes.libelle.sousMatieres=Sous-matières
eliot.notes.libelle.vieScolaire=Vie Scolaire
periode)
BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
- impressionBulletinOptionsService.getParametreOptions(
+ impressionBulletinOptionsService.getParametreOptionsByTemplate(
templateDocument,
typePeriode
)
// moyennes generales
if (periodePrecedente1){
- // TOREFACT i18n - utilisez getPeriodeCodeCourt + internalisation au lieu
- tab.nomPeriodePrecedente1 = periodeService.getPeriodeNomCourt(periodePrecedente1.typePeriode?.libelle)
+ tab.nomPeriodePrecedente1 = periodeService.getNomPeriodePrecedente(periodePrecedente1.typePeriode?.libelle)
BigDecimal moyennePrec1 = null
bulletin.syntheseEleve?.resultatEleveXmestrePrecedents?.each{
if (it.periode == periodePrecedente1){
tab.moyennePrec1 = nf.format(moyennePrec1)
}
if (periodePrecedente2){
- // TOREFACT i18n - utilisez getPeriodeCodeCourt + internalisation au lieu
- tab.nomPeriodePrecedente2 = periodeService.getPeriodeNomCourt(periodePrecedente2.typePeriode?.libelle)
+ tab.nomPeriodePrecedente2 = periodeService.getNomPeriodePrecedente(periodePrecedente2.typePeriode?.libelle)
BigDecimal moyennePrec2 = null
bulletin.syntheseEleve?.resultatEleveXmestrePrecedents?.each{
if (it.periode == periodePrecedente2){
tab.moyennePrec2 = nf.format(moyennePrec2)
}
if (periodePrecedente3){
- // TOREFACT i18n - utilisez getPeriodeCodeCourt + internalisation au lieu
- tab.nomPeriodePrecedente3 = periodeService.getPeriodeNomCourt(periodePrecedente3.typePeriode?.libelle)
+ tab.nomPeriodePrecedente3 = periodeService.getNomPeriodePrecedente(periodePrecedente3.typePeriode?.libelle)
BigDecimal moyennePrec3 = null
bulletin.syntheseEleve?.resultatEleveXmestrePrecedents?.each{
if (it.periode == periodePrecedente3){
MatiereImpressionInfo mii = new MatiereImpressionInfo()
Service service = bsr.service
+ mii.idMatiere = service.id
mii.libelle = service.matiere.libelleLong
mii.prof = service.enseignements?.collect {
Personne.findByAutorite(it.enseignant).nomAffichageInitiales()
SousMatiereImpressionInfo smii = new SousMatiereImpressionInfo()
SousService sousService = bssr.sousService
+
+ smii.idSousMatiere = sousService.id
smii.libelle = sousService.modaliteMatiere.libelle
smii.coeff = COEFF_NF.format(sousService.coeff)
BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
- impressionBulletinOptionsService.getParametreOptions(
+ impressionBulletinOptionsService.getParametreOptionsByTemplate(
template,
typePeriode
)
eliot.notes.Modele.libelle.modifier = '${g.message(code: "eliot.notes.libelle.modifier")}';
eliot.notes.Modele.libelle.supprimer = '${g.message(code: "eliot.notes.libelle.supprimer")}';
eliot.notes.Modele.libelle.plusDActions = "${g.message(code: "eliot.notes.libelle.plusDActions")}";
+ eliot.notes.Modele.libelle.btnOptionsDePublication = "${g.message(code: "eliot.notes.libelle.btnOptionsDePublication")}";
eliot.notes.Modele.libelle.enregistrer = "${g.message(code: "eliot.notes.libelle.enregistrer")}";
eliot.notes.Modele.libelle.eleve= '${g.message(code: "eliot.notes.libelle.eleve")?.encodeAsJavaScript()}';
<g:setJsValueMessage name="annuler" code="eliot.notes.libelle.annuler"/>
<g:setJsValueMessage name="enseignant" code="eliot.notes.libelle.enseignant"/>
<g:setJsValueMessage name="appreciation" code="eliot.notes.libelle.appreciation2"/>
+ <g:setJsValueMessage name="nombreNotes" code="eliot.notes.libelle.nbre"/>
+ <g:setJsValueMessage name="rangs" code="eliot.notes.libelle.rangs"/>
+ <g:setJsValueMessage name="moyenneCourt" code="eliot.notes.libelle.moyenneCourt"/>
+
// Data
<g:setJsVar value="ConfigServeur.data"/>
<g:setJsValueNumeric name="classeSelectionneeId" value="${classeId}"/>
<g:javascript library="src/views/commun/Ext.ux.grid.ColumnHeaderGroup"/>
<g:javascript library="src/views/consultation/commun/bulletin/BulletinController"/>
<g:javascript library="src/views/consultation/commun/bulletin/BulletinView"/>
+<g:javascript library="src/views/consultation/commun/bulletin/BulletinModel"/>
<g:javascript library="src/views/consultation/commun/bulletin/Composant"/>
\ No newline at end of file
eliot.notes.parametrages.periodes.Modele.messages.erreurDatesSaisies = '${g.message(code: "eliot.notes.parametrage.periode.message.erreurDatesSaisies").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.messages.commitChanges= '${g.message(code: "eliot.notes.message.commitChanges").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.messages.erreurListeClassesAppliqueA= '${g.message(code: "eliot.notes.message.erreurInconnue")?.encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.messages.erreurGetOptionsPublication= '${g.message(code: "eliot.notes.message.erreurInconnue")?.encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.messages.enCoursAppliqueA= '${g.message(code: "eliot.notes.message.enCoursAppliqueA").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.messages.confirmationAppliqueA= '${g.message(code: "eliot.notes.message.confirmationAppliqueA").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.ajouterUnLibelle = '${g.message(code: "eliot.notes.libelle.ajouterUnLibelle").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.appliquerA = '${g.message(code: "eliot.notes.libelle.appliquerA").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.reportDuParametrage = '${g.message(code: "eliot.notes.libelle.reportDuParametrage").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.optionsDePublication = '${g.message(code: "eliot.notes.libelle.optionsDePublication").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.moyenneGenerale = '${g.message(code: "eliot.notes.libelle.moyenneGenerale").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.coefficient = '${g.message(code: "eliot.notes.libelle.coefficient").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.moyennesMinMax = '${g.message(code: "eliot.notes.libelle.moyennesMinMax").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.moyennesPrecedentes = '${g.message(code: "eliot.notes.libelle.moyennesPrecedentes").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.nbNotes = '${g.message(code: "eliot.notes.libelle.nbNotes").encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.libelle.rangSurNbEleves = '${g.message(code: "eliot.notes.libelle.rangSurNbEleves").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.ok = '${g.message(code: "eliot.notes.libelle.ok").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.annuler = '${g.message(code: "eliot.notes.libelle.annuler").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.notation = '${g.message(code: "groupePeriode.notation").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.examen = '${g.message(code: "groupePeriode.examen").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.selParamAppliqueA = '${g.message(code: "eliot.notes.libelle.selParamAppliqueA").encodeAsJavaScript()}';//'Sélection des paramétrages des périodes à appliquer'
+ eliot.notes.parametrages.periodes.Modele.libelle.selOptionsDePublication = '${g.message(code: "eliot.notes.libelle.selOptionsDePublication").encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.selClassesAModifier = '${g.message(code: "eliot.notes.libelle.selClassesAModifier").encodeAsJavaScript()}';//'Sélection des classes à modifier'
eliot.notes.parametrages.periodes.Modele.url.urlListeTypePeriodesExamen = '${createLink(controller: 'typePeriode', action: 'listeTypePeriodesExamen').encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.url.urlActionCreerLibelle = '${createLink(controller: 'typePeriode', action: 'creerTypePeriode').encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.url.urlListeClassesAppliqueA = '${createLink(controller: 'structureEnseignement', action: 'listeClassesReportParametrage').encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.url.urlGetOptionsPublication = '${createLink(controller: 'periode', action: 'getOptionsPublication').encodeAsJavaScript()}';
+ eliot.notes.parametrages.periodes.Modele.url.urlEnregistreOptionsDePublication = '${createLink(controller: 'periode', action: 'enregistreOptionsPublication').encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.url.urlAppliqueA = '${createLink(controller: 'periode', action: 'reporteParametrage').encodeAsJavaScript()}';
eliot.notes.parametrages.periodes.Modele.libelle.groupeOrder = {
modifier : undefined,
supprimer : undefined,
plusDActions : undefined,
+ btnOptionsDePublication : undefined,
enregistrer : undefined,
eleve: undefined
},
this.classeModel.addListener(
this.Constantes.eventId.classeChange,
function(classe) {
- this.bulletin.afficheBulletin();
+ this.bulletin.videBulletin();
this.rechargeListeEleveEtPeriode(classe.get('id'));
},
this
this.Constantes.eventId.eleveChange,
function() {
+ var classe = this.classeModel.getClasse();
var eleve = this.eleveModel.getEleve();
var periode = this.periodeModel.getPeriode();
- this.rechargeBulletin(eleve, periode);
+ this.rechargeBulletin(classe, eleve, periode);
},
this
);
this.periodeModel.addListener(
this.Constantes.eventId.periodeChange,
function() {
+
+ var classe = this.classeModel.getClasse();
var eleve = this.eleveModel.getEleve();
var periode = this.periodeModel.getPeriode();
- this.rechargeBulletin(eleve, periode);
+ this.rechargeBulletin(classe, eleve, periode);
},
this
);
imprimeBulletin: function() {
var eleve = this.eleveModel.getEleve();
var periode = this.periodeModel.getPeriode();
+ var classe = this.classeModel.getClasse();
if ((eleve !== undefined) && (periode !== undefined)) {
window.open(
this.ConfigServeur.url.urlImprimerBulletin +
'?eleveId=' + eleve.get('eleveId') +
+ '&classeId=' + classe.get('id') +
'&periodeId=' + periode.get('idPeriode'),
'_blank',
'height=600, width=800, toolbar=yes,menubar=no,scrollbars=yes'
eliot.notes.Messages.showAvertissement(reponse.messageMoyennesNonAJour);
}
- this.bulletin.afficheBulletin(
- reponse.moyennesServices,
- reponse.recapitulatifs,
- reponse.publie,
- reponse.messagePublication);
+ this.bulletin.afficheBulletin({
+ moyennesServices: reponse.moyennesServices,
+ recapitulatifs: reponse.recapitulatifs,
+ publie: reponse.publie,
+ messagePublication: reponse.messagePublication,
+ optionsPublication: reponse.optionsPublication,
+ periodesPrecedentes: reponse.periodesPrecedentes
+ });
},
failure: function(reponse) {
/**
* Recharge le bulletin
*/
- rechargeBulletin: function(eleve, periode) {
- if ((eleve !== undefined) && (periode !== undefined)) {
+ rechargeBulletin: function(classe, eleve, periode) {
+ if ((classe !== undefined) && (eleve !== undefined) && (periode !== undefined)) {
eliot.commun.AjaxHelper.request({
url: this.ConfigServeur.url.urlBulletinDeNotes,
params: {
+ classeId: classe.get('id'),
eleveId: eleve.get('eleveId'),
periodeId: periode.get('idPeriode')
},
if ((reponse.moyennesAjour === false) && (reponse.verrouille !== true)) {
eliot.notes.Messages.showAvertissement(reponse.messageMoyennesNonAJour);
}
- this.bulletin.afficheBulletin(
- reponse.moyennesServices,
- reponse.recapitulatifs,
- reponse.publie,
- reponse.messagePublication);
+ this.bulletin.afficheBulletin({
+ moyennesServices: reponse.moyennesServices,
+ recapitulatifs: reponse.recapitulatifs,
+ publie: reponse.publie,
+ messagePublication: reponse.messagePublication,
+ optionsPublication: reponse.optionsPublication,
+ periodesPrecedentes: reponse.periodesPrecedentes
+ });
},
var imprimerDisabled = true;
- if (bulletin.ConfigServeur.data.moyennesServices.length > 1) {
+ if (!bulletin.isEmpty()) {
imprimerDisabled = false;
}
this.Constantes = this.ns.Constantes;
this.ConfigServeur = this.ns.ConfigServeur;
this.config = Ext.apply(this.creeConfig(), config);
- this.addAllEvents();
- },
-
- addAllEvents: function() {
- this.addEvents(
-
- /**
- * Publication du relevé
- * @event bulletinPublieChange
- * @param publie
- * @param messagePublication
- */
- this.Constantes.eventId.bulletinPublieChange);
},
creeConfig: function() {
this.config = {
- editionAppreciations: false
+ model: undefined,
+ composant: undefined,
+ editionAppreciations: undefined
};
return this.config;
},
getInterface: function() {
return {
- modifieAppreciation: this.modifieAppreciation.createDelegate(this)
+ observeView: this.observeView.createDelegate(this),
+ afficheBulletin: this.afficheBulletin.createDelegate(this),
+ isEmpty: this.isEmpty.createDelegate(this),
+ modifieAppreciation: this.modifieAppreciation.createDelegate(this),
+ getStoreBulletinNotes: this.getStoreBulletinNotes.createDelegate(this),
+ getStoreBulletinNotesFooter: this.getStoreBulletinNotesFooter.createDelegate(this),
+ getEnseignementStore: this.getEnseignementStore.createDelegate(this),
+ getPeriodesPrecedentes: this.getPeriodesPrecedentes.createDelegate(this),
+ getOptionsPublication: this.getOptionsPublication.createDelegate(this)
}
},
- creeItems: function() {
- this.creeStoreBulletinNotes();
- this.creeStoreBulletinNotesFooter();
+ observeView: function(view) {
+ this.view = view;
+ },
+ isEmpty: function() {
+ if (this.storeBulletinNotes == null) {
+ return true;
+ }
+ return this.storeBulletinNotes.getTotalCount() == 0;
+ },
+
+ creeItems: function() {
if (this.config.editionAppreciations) {
this.creeEnseignementStore();
}
},
- creeStoreBulletinNotes: function() {
-
- var storeConfigBulletin = {
- autoDestroy: true,
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- root: 'moyennesServices',
- fields: [
- {name: 'service'},
- {name: 'moyenneEleve', type: 'string'},
- {name: 'moyenneClasse', type: 'string'},
- {name: 'coeff', type: 'string'},
- {name: 'moyenneClasseMax', type: 'string'},
- {name: 'moyenneClasseMin', type: 'string'},
- {name: 'appreciations'},
- {name: 'isSousService', type: 'boolean'},
- {name: 'sousServices'}
- ]
- })
- };
-
- if (this.ConfigServeur.data.moyennesServices.length !== 0) {
- storeConfigBulletin.data = {
- moyennesServices: this.ConfigServeur.data.moyennesServices
- }
- }
+ creeStoreBulletinNotes: function(data) {
+ var config = {
+ autoDestroy: true,
+ autoLoad: false,
+ listeners: {
+ 'load': function(store, records) {
+ this.config.composant.onLoad(records);
+ },
+ scope: this
+ },
+ reader: new Ext.data.JsonReader({
+ fields: this.getStoreBulletinNotesFields()
+ })
+ };
- this.storeBulletinNotes = new Ext.data.Store(storeConfigBulletin);
+ if (data != null) {
+ config.data = data;
+ }
+ this.storeBulletinNotes = new Ext.data.Store(config);
},
- creeStoreBulletinNotesFooter: function() {
+ getStoreBulletinNotesFields: function() {
+ var optionsPublication = this.getOptionsPublication();
+ var periodesPrecedentes = this.getPeriodesPrecedentes();
- var storeConfigFooter = {
- autoDestroy: true,
- autoLoad: false,
- reader: new Ext.data.JsonReader({
- root: 'recapitulatifs',
- fields: [
- {name: 'libelle', type: 'string'},
- {name: 'valeur', type: 'string'}
- ]
- })
- };
+ var fields = [
+ {name: 'service'},
+ {name: 'appreciations'},
+ {name: 'isSousService', type: 'boolean'},
+ {name: 'sousServices'}
+ ];
- if (this.ConfigServeur.data.recapitulatifs.length !== 0) {
- storeConfigFooter.data = {
- recapitulatifs: this.ConfigServeur.data.recapitulatifs
- }
+ if (optionsPublication.coefficient == true) {
+ fields.push({name: 'coeff', type: 'string'});
+ }
+
+ if (optionsPublication.moyenneGenerale == true) {
+ fields.push({name: 'moyenneEleve', type: 'string'});
+ fields.push({name: 'moyenneClasse', type: 'string'});
+ }
+
+ if (optionsPublication.moyenneMinMax == true) {
+ fields.push({name: 'moyenneClasseMax', type: 'string'});
+ fields.push({name: 'moyenneClasseMin', type: 'string'});
+ }
+
+ if (optionsPublication.moyennePrecedente == true) {
+ for (var i = 0; i < periodesPrecedentes.length; i++) {
+ fields.push({
+ name: 'moyenneElevePrecedente' + periodesPrecedentes[i].id,
+ type: 'string'
+ });
}
+ }
+
+ if (optionsPublication.nombreNotes == true) {
+ fields.push({name: 'nbNotes', type: 'string'});
+ }
- this.storeBulletinNotesFooter = new Ext.data.Store(storeConfigFooter);
+ if (optionsPublication.rangs == true) {
+ fields.push({name: 'rangs', type: 'string'});
+ }
+
+ return fields;
+ },
+
+ getStoreBulletinNotes: function() {
+ return this.storeBulletinNotes;
+ },
+
+ creeStoreBulletinNotesFooter: function(data) {
+ var config = {
+ autoDestroy: true,
+ autoLoad: false,
+ reader: new Ext.data.JsonReader({
+ fields: [
+ {name: 'libelle', type: 'string'},
+ {name: 'valeur', type: 'string'}
+ ]
+ })
+ };
+
+ if (data != null) {
+ config.data = data;
+ }
+
+ this.storeBulletinNotesFooter = new Ext.data.Store(config);
+ },
+
+ getStoreBulletinNotesFooter: function() {
+ return this.storeBulletinNotesFooter;
},
creeEnseignementStore: function() {
});
},
- /**
- * Charge les données
- * @param eleve
- * @param periode
- */
- loadData: function(moyennesServices, recapitulatifs) {
-
-
- this.storeBulletinNotes.loadData({
- moyennesServices: moyennesServices !== undefined ? moyennesServices : []
- });
-
- this.storeBulletinNotesFooter.loadData({
- recapitulatifs: recapitulatifs !== undefined ? recapitulatifs : []
- });
-
+ getEnseignementStore: function() {
+ return this.enseignementStore;
},
- /**
- * Affiche le bulletin
- * @param moyennesServices
- * @param recapitulatifs
- * @param publie
- * @param messagePublication
- */
- afficheBulletin: function(moyennesServices, recapitulatifs, publie, messagePublication) {
-
- if (publie !== false) {
-
- this.loadData(moyennesServices, recapitulatifs);
-
- this.fireEvent(this.Constantes.eventId.bulletinPublieChange, true);
-
- }
- else {
- this.fireEvent(this.Constantes.eventId.bulletinPublieChange,
- false, messagePublication);
- }
+ afficheBulletin: function() {
+ var value = this.config.model.getValue();
+ this.creeStoreBulletinNotes(value.moyennesServices);
+ this.creeStoreBulletinNotesFooter(value.recapitulatifs);
+ this.view.afficheBulletin();
},
modifieAppreciation: function(enseignementId, appreciation, record, index) {
+ var references = this.config.model.getValue().references;
+
eliot.commun.AjaxHelper.request({
url: this.ConfigServeur.url.modifieAppreciation,
params: {
- classeId: this.references.classe.id,
+ classeId: references.classe.id,
enseignementId: enseignementId,
- periodeId: this.references.periode.id,
- eleveId: this.references.eleve.id,
+ periodeId: references.periode.id,
+ eleveId: references.eleve.id,
appreciation: appreciation
},
eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurModifieAppreciation);
}
},
+
scope: this
});
},
- actualiseReferences: function(references) {
- this.references = references;
+ getOptionsPublication: function() {
+ var value = this.config.model.getValue();
+
+ var optionsPublication = {
+ coefficient: true,
+ moyenneGenerale: true,
+ moyenneMinMax: true,
+ moyennePrecedente: false,
+ nombreNotes: true,
+ rangs: true
+ };
+
+ if (value.optionsPublication != null) {
+ optionsPublication = value.optionsPublication;
+ }
+
+ return optionsPublication;
+ },
+
+ getPeriodesPrecedentes: function() {
+ var value = this.config.model.getValue();
+ var periodesPrecedentes = [];
+
+ if (value.periodesPrecedentes != null) {
+ periodesPrecedentes = value.periodesPrecedentes;
+ }
+
+ return periodesPrecedentes;
}
+
});
--- /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>.
+ * @author onic
+ */
+Ext.ns('eliot.notes.consultation.commun.bulletin');
+
+eliot.notes.consultation.commun.bulletin.BulletinModel = Ext.extend(Ext.util.Observable, {
+
+ constructor: function(value) {
+
+ this.ns = eliot.notes.consultation.commun.bulletin;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.value = value;
+
+ this.addEvents(this.Constantes.eventId.change);
+ },
+
+ applyValue: function(value) {
+ this.value = Ext.apply(this.value, value);
+ this.fireEvent(this.Constantes.eventId.change, this.value);
+ },
+
+ setValue: function(value) {
+ this.value = value;
+ this.fireEvent(this.Constantes.eventId.change, value);
+ },
+
+ getValue: function() {
+ return this.value;
+ }
+
+});
this.Constantes = this.ns.Constantes;
this.ConfigServeur = this.ns.ConfigServeur;
this.config = Ext.apply(this.creeConfig(), config);
- this.addAllEvents();
- },
-
- addAllEvents: function() {
-
},
creeConfig: function() {
this.config = {
- storeBulletinNotes: undefined,
- storeBulletinNotesFooter: undefined,
- enseignementStore: undefined,
- editionAppreciations: false,
- controller: undefined
+ model: undefined,
+ controller: undefined,
+ editionAppreciations: undefined
};
return this.config;
},
- creeItems: function() {
-
+ creeItems: function() {
Ext.QuickTips.init();
this.tooltipSequence = 0;
this.renderedTooltips = [];
-
- this.creeGrids();
this.creeMessagePublication();
- this.observeStore(this.config.storeBulletinNotes);
+
+ this.item = new Ext.Panel({
+ border: false,
+ frame: false,
+ autoScroll: false,
+ items: [],
+ listeners: {
+ render: function() {
+ this.config.controller.afficheBulletin();
+ },
+ scope: this
+ }
+ });
+ },
+
+ getInterface: function() {
+ return {
+ getItems: this.getItems.createDelegate(this),
+ afficheBulletin: this.afficheBulletin.createDelegate(this)
+ }
+ },
+
+ getItems: function() {
+ return [
+ this.item
+ ];
},
+ afficheBulletin: function() {
+ var value = this.config.model.getValue();
+
+ this.creeGrids();
+ this.item.removeAll(true);
+
+ if ((value.publie == true) && !this.config.controller.isEmpty()) {
+ this.item.add(this.bulletinNotesGrid);
+ this.item.add(this.bulletinNotesFooterGrid);
+ }
+
+ if (value.publie == false) {
+ this.item.add(this.messagePublication);
+ this.setMessagePublication(value.messagePublication);
+ }
+
+ this.item.doLayout();
+ },
+
creeGrids: function() {
- if (!this.config.storeBulletinNotes) throw 'La config "storeBulletinNotes" est obligatoire';
- if (!this.config.storeBulletinNotesFooter) throw 'La config "storeBulletinNotesFooter" est obligatoire';
- var gridHidden = this.isGridHidden();
+ var columnConfig = this.creeColumnConfig();
this.bulletinNotesGrid = new Ext.grid.GridPanel({
baseCls: 'eliot-patch-ie-wrap x-panel',
- store: this.config.storeBulletinNotes,
- hidden: gridHidden,
- width: 850,
+ store: this.config.controller.getStoreBulletinNotes(),
+ width: columnConfig.width,
autoHeight: true,
- colModel: this.creeColModel(),
+ colModel: this.creeColModel(columnConfig),
cls: 'portal-default_table',
margins: '0 5 5 5',
border: true,
- plugins: this.creeGridPlugins(),
+ plugins: this.creeGridPlugins(columnConfig),
columnLines: true,
stripeRows: true,
+ listeners: {
+
+ 'viewready': function() {
+ this.refreshHtmlElements();
+ },
+
+ 'celldblclick': function(grid, rowIndex, columnIndex, e) {
+ if ((this.config.editionAppreciations == true) && (columnIndex == 6)) {
+ var record = grid.store.getAt(rowIndex);
+ this.ouvrePopupEditionAppreciation(record);
+ }
+ },
+
+ scope: this
+ },
+
viewConfig: {
getRowClass: function(rec, rowIdx, params, store) {
-
if (rowIdx === store.data.items.length - 1) {
return 'footer';
}
else {
return '';
}
- }
- }
- });
-
- this.bulletinNotesGrid.getView().addListener(
- 'refresh',
- function() {
- this.refreshHtmlElements();
},
- this);
- this.bulletinNotesGrid.addListener(
- 'viewready',
- function() {
- this.refreshHtmlElements();
- },
- this);
-
- if (this.config.editionAppreciations) {
- this.bulletinNotesGrid.addListener(
- 'celldblclick',
- function(grid, rowIndex, columnIndex, e) {
- if (columnIndex == 6) {
- var record = this.config.storeBulletinNotes.getAt(rowIndex);
- this.ouvrePopupEditionAppreciation(record);
- }
+ listeners: {
+ 'refresh': function() {
+ this.refreshHtmlElements();
},
- this);
- }
+ scope: this
+ }
+ }
+ });
this.bulletinNotesFooterGrid = new Ext.grid.GridPanel({
baseCls: 'eliot-patch-ie-wrap x-panel',
- store: this.config.storeBulletinNotesFooter,
- hidden: gridHidden,
- width: 850,
+ store: this.config.controller.getStoreBulletinNotesFooter(),
+ width: columnConfig.width,
autoHeight: true,
- colModel: this.creeFooterColModel(),
+ colModel: this.creeFooterColModel(columnConfig),
cls: 'portal-default_table',
margins: '0 5 5 5',
border: true,
});
},
- creeEnteteGridRow1: function() {
- return [
+ creeColModel: function(columnConfig) {
+ return new Ext.grid.ColumnModel({
+ defaults:
{
- header: '',
- width: 150,
- colspan: 1,
- align:'center'
- }, {
- header: this.ConfigServeur.libelle.moyennes,
- width: 100,
- colspan: 2,
- align:'center'
- }, {
- header: '',
- width: 100,
- colspan: 1,
- align:'center'
- }, {
- header: this.ConfigServeur.libelle.notes,
- width: 100,
- colspan: 2,
- align:'center'
- }, {
- header: '',
- width: 150,
- colspan: 1,
- align:'center'
- }
- ];
+ menuDisabled: true,
+ resizable: false,
+ align: 'left'
+ },
+ columns: columnConfig.columns
+ });
},
- creeServiceHeader: function() {
- return "<P align=left>" + this.ConfigServeur.libelle.discipline + "<br/>" +
- this.ConfigServeur.libelle.professeur + "</P>";
+ creeGridPlugins: function(columnConfig) {
+ return [
+ new Ext.ux.grid.ColumnHeaderGroup({
+ rows: [columnConfig.enteteGridRow1]
+ })
+ ];
},
- creeColModel: function() {
+ creeFooterColModel: function(columnConfig) {
return new Ext.grid.ColumnModel({
defaults:
{
resizable: false,
align: 'left'
},
- columns: this.creeColumns()
+ columns: columnConfig.footerColumns
});
+ },
+
+ creeServiceHeader: function() {
+ return "<P align=left>" + this.ConfigServeur.libelle.discipline + "<br/>" +
+ this.ConfigServeur.libelle.professeur + "</P>";
},
- creeColumns: function() {
+ creeColumnConfig: function() {
+ var columnConfig = this.creeBaseColumnConfig();
+ var optionsPublication = this.config.controller.getOptionsPublication();
+ var periodesPrecedentes = this.config.controller.getPeriodesPrecedentes();
- var view = this;
+ columnConfig.pushFooter({
+ dataIndex: 'libelle',
+ sortable: false,
+ align:'left'
+ });
- return [
- {
- header: this.creeServiceHeader(),
- dataIndex: 'service',
- width: 250,
- sortable: false,
- align:'left',
- renderer: function(value, metadata, record) {
- var result = '<div style=align:left;font-weight:bold>' + value.matiere + '</div>';
-
- if (value.enseignements != null) {
- result += '<span style="white-space:normal">'
- for (var i = 0; i < value.enseignements.length; i++) {
- var enseignement = value.enseignements[i];
+ columnConfig.pushEntete({align:'center'});
+ columnConfig.pushColumn(this.creeColumnConfigService());
- if (i != 0) {
- result += ' ';
- }
- result += enseignement.nomProf + ' ' + enseignement.initialeProf;
- }
- result += '</span>';
- }
+ columnConfig.pushFooter({
+ dataIndex: 'valeur',
+ sortable: false,
+ align:'left',
+ renderer: eliot.notes.commun.Utils.textRenderer
+ });
- var sousServices = record.get('sousServices');
+ if (((optionsPublication.moyennePrecedente == true) && (periodesPrecedentes.length > 0))
+ || (optionsPublication.moyenneGenerale == true)) {
- if (sousServices != null) {
- result += '<ul style="margin-left:10px;">';
- for (var i = 0; i < sousServices.length; i++) {
- var sousService = sousServices[i];
- result += '<li class="modaliteMatiere">' + sousService.service.matiere + '</li>';
- }
- result += '</li></ul>';
- }
+ if ((optionsPublication.moyenneGenerale == false)
+ && (optionsPublication.moyennePrecedente == true)
+ && (periodesPrecedentes.length == 1)) {
+ columnConfig.pushEntete({
+ header: this.ConfigServeur.libelle.moyenneCourt,
+ align:'center'
+ });
+ }
+ else {
+ columnConfig.pushEntete({
+ header: this.ConfigServeur.libelle.moyennes,
+ align:'center'
+ });
+ }
- return result;
+ if (optionsPublication.moyennePrecedente == true) {
+ for (var i = 0; i < periodesPrecedentes.length; i++) {
+ columnConfig.pushColumn(
+ this.creeColumnConfigMoyennePrecedente(periodesPrecedentes[i]));
}
+ }
+
+ if (optionsPublication.moyenneGenerale == true) {
+ columnConfig.pushColumn(this.creeColumnConfigMoyenneEleve());
+ columnConfig.pushColumn(this.creeColumnConfigMoyenneClasse());
+ }
+
+ }
+
+ if ((optionsPublication.coefficient == true)
+ || (optionsPublication.rangs == true)) {
+
+ columnConfig.pushEntete({align:'center'});
+
+ if (optionsPublication.coefficient == true) {
+ columnConfig.pushColumn(this.creeColumnConfigCoeff());
+ }
+
+ if (optionsPublication.rangs == true) {
+ columnConfig.pushColumn(this.creeColumnConfigRangs());
+ }
+
+ }
+
+ if ((optionsPublication.moyenneMinMax == true)
+ || (optionsPublication.nombreNotes == true)){
+
+ columnConfig.pushEntete({
+ header: this.ConfigServeur.libelle.notes,
+ align:'center'
+ });
+
+ if (optionsPublication.moyenneMinMax == true) {
+ columnConfig.pushColumn(this.creeColumnConfigMoyenneMin());
+ columnConfig.pushColumn(this.creeColumnConfigMoyenneMax());
+ }
+
+ if (optionsPublication.nombreNotes == true) {
+ columnConfig.pushColumn(this.creeColumnConfigNombreNotes());
+ }
+ }
+
+ columnConfig.pushEntete({align:'center'});
+ columnConfig.pushColumn(this.creeColumnConfigAppreciation());
+
+ return columnConfig;
+ },
+
+ creeBaseColumnConfig: function() {
+ return {
+ entete: undefined,
+ footer: undefined,
+ width: 0,
+ enteteGridRow1: [],
+ columns: [],
+ footerColumns: [],
+
+ pushEntete: function(entete) {
+ entete.width = 0;
+ entete.colspan = 0;
+ this.entete = entete;
+ this.enteteGridRow1.push(entete);
},
- {
- header: this.ConfigServeur.libelle.moyenneEleve,
- dataIndex: 'moyenneEleve',
- width: 50,
- sortable: false,
- align:'center',
- style: 'padding-top: 6px',
- renderer: function(value, metadata, record) {
- var result = eliot.notes.commun.Utils.getNoteRenderer({
- bold: true,
- annotationRenderer: function(value) {
- var sequence = view.tooltipSequence;
- view.tooltipSequence ++;
- return '<span id="annotation' + sequence
- + '"class="annotation" annotation="' + value + '">'
- + value + '</span>';
- }
- })(value);
- var sousServices = record.get('sousServices');
+ pushFooter: function(footer) {
+ footer.width = 0;
+ this.footer = footer;
+ this.footerColumns.push(footer);
+ },
- if (sousServices != null) {
- result += '<br/>';
- for (var i = 0; i < sousServices.length; i++) {
- var sousService = sousServices[i];
- result += '<br/>' +
- eliot.notes.commun.Utils.getNoteRenderer({
- bold: true,
- annotationRenderer: function(value) {
- var sequence = view.tooltipSequence;
- view.tooltipSequence ++;
- return '<span id="annotation' + sequence
- + '"class="annotation" annotation="' + value + '">'
- + value + '</span>';
- }
- })(sousService.moyenneEleve);
+ pushColumn: function(column) {
+ this.width += column.width;
+ this.footer.width += column.width;
+ this.entete.width += column.width;
+ this.entete.colspan += 1;
+ this.columns.push(column);
+ }
+ };
+ },
+
+ creeColumnConfigService: function() {
+ return {
+ header: this.creeServiceHeader(),
+ dataIndex: 'service',
+ width: 250,
+ sortable: false,
+ align:'left',
+ renderer: function(value, metadata, record) {
+ var result = '<div style=align:left;font-weight:bold>' + value.matiere + '</div>';
+
+ if (value.enseignements != null) {
+ result += '<span style="white-space:normal">'
+ for (var i = 0; i < value.enseignements.length; i++) {
+ var enseignement = value.enseignements[i];
+
+ if (i != 0) {
+ result += ' ';
}
+ result += enseignement.nomProf + ' ' + enseignement.initialeProf;
}
-
- return result;
+ result += '</span>';
}
- },
- {
- header: this.ConfigServeur.libelle.classe,
- dataIndex: 'moyenneClasse',
- width: 50,
- sortable: false,
- align:'center',
- renderer: function(value, metadata, record) {
- var result = eliot.notes.commun.Utils.noteRenderer(value);
- var sousServices = record.get('sousServices');
+ var sousServices = record.get('sousServices');
- if (sousServices != null) {
- result += '<br/>';
- for (var i = 0; i < sousServices.length; i++) {
- var sousService = sousServices[i];
- result += '<br/>' +
- eliot.notes.commun.Utils.noteRenderer(sousService.moyenneClasse);
- }
+ if (sousServices != null) {
+ result += '<ul style="margin-left:10px;">';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<li class="modaliteMatiere">' + sousService.service.matiere + '</li>';
}
+ result += '</li></ul>';
+ }
- return result;
+ return result;
+ }
+ };
+ },
+
+ creeColumnConfigMoyenneEleve: function() {
+ var view = this;
+
+ return {
+ header: this.ConfigServeur.libelle.moyenneEleve,
+ dataIndex: 'moyenneEleve',
+ width: 50,
+ sortable: false,
+ align:'center',
+ style: 'padding-top: 6px',
+ renderer: function(value, metadata, record) {
+ var result = eliot.notes.commun.Utils.getNoteRenderer({
+ bold: true,
+ annotationRenderer: function(value) {
+ var sequence = view.tooltipSequence;
+ view.tooltipSequence ++;
+ return '<span id="annotation' + sequence
+ + '"class="annotation" annotation="' + value + '">'
+ + value + '</span>';
+ }
+ })(value);
+
+ var sousServices = record.get('sousServices');
+
+ if (sousServices != null) {
+ result += '<br/>';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<br/>' +
+ eliot.notes.commun.Utils.getNoteRenderer({
+ bold: true,
+ annotationRenderer: function(value) {
+ var sequence = view.tooltipSequence;
+ view.tooltipSequence ++;
+ return '<span id="annotation' + sequence
+ + '"class="annotation" annotation="' + value + '">'
+ + value + '</span>';
+ }
+ })(sousService.moyenneEleve);
+ }
}
- },
- {
- header: this.ConfigServeur.libelle.coeff,
- dataIndex: 'coeff',
- width: 50,
- sortable: false,
- align:'center',
- renderer: function(value, metadata, record) {
- var result = value;
- var sousServices = record.get('sousServices');
+ return result;
+ }
+ };
+ },
- if (sousServices != null) {
- result += '<br/>';
- for (var i = 0; i < sousServices.length; i++) {
- var sousService = sousServices[i];
- result += '<br/>' + sousService.coeff;
- }
+ creeColumnConfigMoyennePrecedente: function(periodePrecedente) {
+ var dataIndex = 'moyenneElevePrecedente' + periodePrecedente.id;
+
+ return {
+ header: periodePrecedente.libelle,
+ dataIndex: dataIndex,
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: function(value, metadata, record) {
+ var result = eliot.notes.commun.Utils.noteRenderer(value);
+
+ var sousServices = record.get('sousServices');
+
+ if (sousServices != null) {
+ result += '<br/>';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<br/>' +
+ eliot.notes.commun.Utils.noteRenderer(sousService[dataIndex]);
}
+ }
- return result;
+ return result;
+ }
+ };
+ },
+
+ creeColumnConfigMoyenneClasse: function() {
+ return {
+ header: this.ConfigServeur.libelle.classe,
+ dataIndex: 'moyenneClasse',
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: function(value, metadata, record) {
+ var result = eliot.notes.commun.Utils.noteRenderer(value);
+
+ var sousServices = record.get('sousServices');
+
+ if (sousServices != null) {
+ result += '<br/>';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<br/>' +
+ eliot.notes.commun.Utils.noteRenderer(sousService.moyenneClasse);
+ }
}
- },
- {
- header: this.ConfigServeur.libelle.noteMini,
- dataIndex: 'moyenneClasseMin',
- width: 50,
- sortable: false,
- align:'center',
- renderer: function(value, metadata, record) {
- var result = eliot.notes.commun.Utils.noteRenderer(value);
+
+ return result;
+ }
+ };
+ },
+
+ creeColumnConfigRangs: function() {
+ return {
+ header: this.ConfigServeur.libelle.rangs,
+ dataIndex: 'rangs',
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: {
+ fn: function(value, metadata, record) {
+ var result = this.filtreNull(value);
var sousServices = record.get('sousServices');
result += '<br/>';
for (var i = 0; i < sousServices.length; i++) {
var sousService = sousServices[i];
- result += '<br/>' +
- eliot.notes.commun.Utils.noteRenderer(sousService.moyenneClasseMin);
+ result += '<br/>' + this.filtreNull(sousService.rangs);
}
}
return result;
- }
- },
- {
- header: this.ConfigServeur.libelle.noteMax,
- dataIndex: 'moyenneClasseMax',
- width: 50,
- sortable: false,
- align:'center',
- renderer: function(value, metadata, record) {
- var result = eliot.notes.commun.Utils.noteRenderer(value);
+ },
+ scope: this
+ }
+ };
+ },
+
+ creeColumnConfigNombreNotes: function() {
+ return {
+ header: this.ConfigServeur.libelle.nombreNotes,
+ dataIndex: 'nbNotes',
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: {
+ fn: function(value, metadata, record) {
+ var result = this.filtreNull(value);
var sousServices = record.get('sousServices');
result += '<br/>';
for (var i = 0; i < sousServices.length; i++) {
var sousService = sousServices[i];
- result += '<br/>' +
- eliot.notes.commun.Utils.noteRenderer(sousService.moyenneClasseMax);
+ result += '<br/>' + this.filtreNull(sousService.nbNotes);
}
}
return result;
- }
- },
- {
- header: this.ConfigServeur.libelle.appreciations,
- dataIndex: 'appreciations',
- width: 350,
- sortable: false,
- renderer: function(appreciations) {
-
- var value = '';
-
- if (appreciations != null) {
- for(var i = 0; i < appreciations.length; i++) {
- if (appreciations[i] != '') {
- if (i != 0) {
- value += ' ';
- }
- value += appreciations[i];
- }
- }
- }
-
- return eliot.notes.commun.Utils.textRenderer(value);
},
- align:'left'
+ scope: this
}
- ];
+ };
},
- creeGridPlugins: function() {
- return [
- new Ext.ux.grid.ColumnHeaderGroup({
- rows: [this.creeEnteteGridRow1()]
- })
- ];
+ creeColumnConfigCoeff: function() {
+ return {
+ header: this.ConfigServeur.libelle.coeff,
+ dataIndex: 'coeff',
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: function(value, metadata, record) {
+ var result = value;
+
+ var sousServices = record.get('sousServices');
+
+ if (sousServices != null) {
+ result += '<br/>';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<br/>' + sousService.coeff;
+ }
+ }
+
+ return result;
+ }
+ };
},
- isGridHidden: function() {
- var gridHidden = true;
+ creeColumnConfigMoyenneMin: function() {
+ return {
+ header: this.ConfigServeur.libelle.noteMini,
+ dataIndex: 'moyenneClasseMin',
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: function(value, metadata, record) {
+ var result = eliot.notes.commun.Utils.noteRenderer(value);
+
+ var sousServices = record.get('sousServices');
+
+ if (sousServices != null) {
+ result += '<br/>';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<br/>' +
+ eliot.notes.commun.Utils.noteRenderer(sousService.moyenneClasseMin);
+ }
+ }
- if ((this.ConfigServeur.data.eleveSelectionneId !== undefined) &&
- (this.ConfigServeur.data.periodeSelectionneeId !== undefined)) {
- gridHidden = false;
- }
+ return result;
+ }
+ };
+ },
- if (this.ConfigServeur.data.publie === false) gridHidden = true;
+ creeColumnConfigMoyenneMax: function() {
+ return {
+ header: this.ConfigServeur.libelle.noteMax,
+ dataIndex: 'moyenneClasseMax',
+ width: 50,
+ sortable: false,
+ align:'center',
+ renderer: function(value, metadata, record) {
+ var result = eliot.notes.commun.Utils.noteRenderer(value);
+
+ var sousServices = record.get('sousServices');
+
+ if (sousServices != null) {
+ result += '<br/>';
+ for (var i = 0; i < sousServices.length; i++) {
+ var sousService = sousServices[i];
+ result += '<br/>' +
+ eliot.notes.commun.Utils.noteRenderer(sousService.moyenneClasseMax);
+ }
+ }
- return gridHidden;
+ return result;
+ }
+ };
},
- creeFooterColModel: function() {
- return new Ext.grid.ColumnModel({
- defaults:
- {
- menuDisabled: true,
- resizable: false,
- align: 'left'
- },
- columns: this.creeFooterColumns()
- });
- },
+ creeColumnConfigAppreciation: function() {
+ return {
+ header: this.ConfigServeur.libelle.appreciations,
+ dataIndex: 'appreciations',
+ width: 350,
+ sortable: false,
+ renderer: function(appreciations) {
- creeFooterColumns: function() {
- return [
- {
- dataIndex: 'libelle',
- width: 250,
- sortable: false,
- align:'left'
+ var value = '';
+
+ if (appreciations != null) {
+ for(var i = 0; i < appreciations.length; i++) {
+ if (appreciations[i] != '') {
+ if (i != 0) {
+ value += ' ';
+ }
+ value += appreciations[i];
+ }
+ }
+ }
+
+ return eliot.notes.commun.Utils.textRenderer(value);
},
- {
- dataIndex: 'valeur',
- width: 600,
- sortable: false,
- align:'left',
- renderer: eliot.notes.commun.Utils.textRenderer
- }
- ];
+ align:'left'
+ };
},
creeMessagePublication: function() {
});
},
- /**
- * Observe store
- */
- observeStore: function(store) {
-
- store.addListener(
- 'load',
- function(store, records) {
- if (records.length > 0) {
- this.bulletinNotesGrid.show();
- this.bulletinNotesFooterGrid.show();
- }
- else {
- this.bulletinNotesGrid.hide();
- this.bulletinNotesFooterGrid.hide();
- }
- },
- this
- );
- },
-
- /**
- * Observe le controller
- * @param controller
- */
- observeController: function(controller) {
-
- controller.addListener(
- this.Constantes.eventId.bulletinPublieChange,
- function(publie, messagePublication) {
- if (publie === true) {
- this.bulletinNotesGrid.show();
- this.bulletinNotesFooterGrid.show();
- this.messagePublication.hide();
- }
- else {
- this.bulletinNotesGrid.hide();
- this.bulletinNotesFooterGrid.hide();
- this.setMessagePublication(messagePublication);
- this.messagePublication.show();
- }
-
- },
- this);
-
- },
-
- /**
- * Initialise le message de publication
- * @param messagePublication
- */
setMessagePublication: function(messagePublication) {
if (this.messagePublication.rendered === true) {
this.messagePublication.update(
});
}
- this.config.enseignementStore.loadData(data);
+ this.config.controller.getEnseignementStore().loadData(data);
if (service.enseignements.length > 0) {
this.comboBox.setValue(service.enseignements[0].idProf);
var idProf = this.comboBox.getValue();
if (idProf != null) {
- var enseignement = this.config.enseignementStore.getById(idProf);
+ var enseignement = this.config.controller.getEnseignementStore().getById(idProf);
this.config.controller.modifieAppreciation(
enseignement.get('idEnseignement'),
creeComboBox: function() {
this.comboBox = new Ext.form.ComboBox({
- store: this.config.enseignementStore,
+ store: this.config.controller.getEnseignementStore(),
width: 235,
triggerAction: 'all',
selectOnFocus: true,
}
}
}
+ },
+
+ filtreNull: function(text) {
+ if (text == null) {
+ return ' ';
+ }
+ return text;
}
});
\ No newline at end of file
* Composant bulletin de notes
* @author onic
*/
-eliot.notes.consultation.commun.bulletin.Composant = function(config) {
+eliot.notes.consultation.commun.bulletin.Composant = function(configComposant) {
var Clazz = Ext.extend(Ext.util.Observable, {
- constructor: function() {
+ constructor: function(config) {
this.init(eliot.notes.consultation.commun.bulletin, config);
- this.creeItems();
+ this.creeComposantInterface();
+ this.creeItems();
},
init: function(ns, config) {
this.Constantes = this.ns.Constantes;
this.ConfigServeur = this.ns.ConfigServeur;
this.config = Ext.apply(this.creeConfig(), config);
- this.addAllEvents();
- },
-
- addAllEvents: function() {
- this.addEvents(
-
- /**
- * Chargement du bulletin
- * @param records
- */
- 'load');
},
creeConfig: function() {
creeItems: function() {
- // Bulletin
- this.bulletinController = new this.ns.BulletinController({
- editionAppreciations: this.config.editionAppreciations
+ this.model = new this.ns.BulletinModel({
+ moyennesServices: this.ConfigServeur.data.moyennesServices,
+ recapitulatifs: this.ConfigServeur.data.recapitulatifs,
+ publie: this.ConfigServeur.data.publie,
+ messagePublication: this.ConfigServeur.data.messagePublication,
+ references: this.ConfigServeur.data.references,
+ optionsPublication: this.ConfigServeur.data.optionsPublication,
+ periodesPrecedentes: this.ConfigServeur.data.periodesPrecedentes
});
- this.bulletinView = new this.ns.BulletinView({
- storeBulletinNotes: this.bulletinController.storeBulletinNotes,
- storeBulletinNotesFooter: this.bulletinController.storeBulletinNotesFooter,
- enseignementStore: this.bulletinController.enseignementStore,
- editionAppreciations: this.config.editionAppreciations,
- controller: this.bulletinController.getInterface()
- });
+ this.controller = new this.ns.BulletinController({
+ model: this.model,
+ composant: this.getInterface(),
+ editionAppreciations: this.config.editionAppreciations
+ }).getInterface();
- this.bulletinView.observeController(this.bulletinController);
+ this.view = new this.ns.BulletinView({
+ model: this.model,
+ controller: this.controller,
+ composant: this.getInterface(),
+ editionAppreciations: this.config.editionAppreciations
+ }).getInterface();
- this.bulletinController.storeBulletinNotes.addListener(
- 'load',
- function(store, records) {
- this.fireEvent('load', records);
- },
- this);
+ this.controller.observeView(this.view);
- this.items = [
- this.bulletinView.bulletinNotesGrid,
- this.bulletinView.bulletinNotesFooterGrid,
- this.bulletinView.messagePublication
- ];
+ },
+
+ creeComposantInterface: function() {
+ this.composantInterface = new Ext.util.Observable();
+ this.composantInterface.addEvents('load');
+ this.composantInterface.isEmpty = this.isEmpty.createDelegate(this);
+ this.composantInterface.getItems = this.getItems.createDelegate(this);
+ this.composantInterface.afficheBulletin = this.afficheBulletin.createDelegate(this);
+ this.composantInterface.actualiseRecaps = this.actualiseRecaps.createDelegate(this);
+ this.composantInterface.actualiseReferences = this.actualiseReferences.createDelegate(this);
+ this.composantInterface.videBulletin = this.videBulletin.createDelegate(this);
+ },
+
+ getComposantInterface: function() {
+ return this.composantInterface;
+ },
+
+ getInterface: function() {
+ return {
+ onLoad: this.onLoad.createDelegate(this)
+ };
+ },
+
+ isEmpty: function() {
+ return this.controller.isEmpty();
+ },
+
+ onLoad: function(records) {
+ this.composantInterface.fireEvent('load', records);
},
- /**
- * Récupère les composants graphiques à intégrer dans la pasge
- */
getItems: function() {
- return this.items;
+ return this.view.getItems();
},
- /**
- * Affiche le bulletin avec des données statiques
- * @param moyennesServices
- * @param recapitulatifs
- * @param publie
- * @param messagePublication
- */
- afficheBulletin: function(moyennesServices, recapitulatifs, publie, messagePublication) {
- this.moyennesServices = moyennesServices;
- this.recapitulatifs = recapitulatifs;
- this.publie = publie;
- this.messagePublication = messagePublication;
- this.bulletinController.afficheBulletin(
- moyennesServices, recapitulatifs, publie, messagePublication);
+ videBulletin: function() {
+ this.model.setValue({
+ moyennesServices: undefined,
+ recapitulatifs: undefined,
+ publie: undefined,
+ messagePublication: undefined,
+ optionsPublication: undefined,
+ periodesPrecedentes: undefined
+ });
+ this.controller.afficheBulletin();
},
- /**
- * Actulise le tableau de recapitulatifs
- * @param recapitulatifs
+ /*
+ * Paramètre: config
+ * - moyennesServices
+ * - recapitulatifs
+ * - publie
+ * - messagePublication
+ * - optionsPublication
+ * - periodesPrecedentes
*/
- actualiseRecaps: function(recapitulatifs) {
- this.recapitulatifs = recapitulatifs;
- this.bulletinController.afficheBulletin(
- this.moyennesServices, recapitulatifs, this.publie, this.messagePublication);
+ afficheBulletin: function(config) {
+ this.model.applyValue(config);
+ this.controller.afficheBulletin();
+ },
+
+ actualiseRecaps: function(recapitulatifs) {
+ this.model.applyValue({
+ recapitulatifs: recapitulatifs
+ });
+ this.controller.afficheBulletin();
},
actualiseReferences: function(references) {
- this.bulletinController.actualiseReferences(references);
+ this.model.applyValue({
+ references: references
+ });
}
});
- // Construit l'instance singleton
- return new Clazz({
- name: 'eliot-notes-consultation-commun-bulletin-composant'
- });
+ return new Clazz(configComposant).getComposantInterface();
};
\ No newline at end of file
enregistrer: undefined,
annuler: undefined,
enseignant: undefined,
- appreciation: undefined
+ appreciation: undefined,
+
+ nombreNotes: undefined,
+ rangs: undefined,
+ moyenneCourt: undefined
},
icon: {
*/
eliot.notes.consultation.commun.bulletin.Constantes = {
eventId: {
- bulletinPublieChange: 'bulletinPublieChange'
+ bulletinPublieChange: 'bulletinPublieChange',
+ change: 'change'
},
composantId: {
messagePublication: 'messagePublication'
- },
-
- storeId: {
-
}
};
\ No newline at end of file
actionEditPeriodeSelectionne : 'actionEditPeriodeSelectionne',
actionRestaurerDonnee : 'actionRestaurerDonnee',
actionPasserEnTrimestreOuSemestrePeriode : 'actionPasserEnTrimestreOuSemestrePeriode',
+ actionAfficherOptionsDePublication : 'actionAfficherOptionsDePublication',
actionEditCancel : 'actionEditCancel',
actionNouveauLibelle : 'actionNouveauLibelle',
actionAppliqueA: 'actionAppliqueA',
openWindowAppliqueA: 'openWindowAppliqueA',
- appliqueA: 'appliqueA'
+ openWindowOptionsDePublication: 'openWindowOptionsDePublication',
+ appliqueA: 'appliqueA',
+ enregistreOptionsDePublication: 'enregistreOptionsDePublication'
},
composantId:{
idComboClasse : 'idComboClasse',
idBoutonMdification : 'idBoutonMdification',
idBoutonSupprimer : 'idBoutonSupprimer',
idBoutonPlusDActions : 'idBoutonPlusDActions',
+ idBoutonOptionsDePublication : 'idBoutonOptionsDePublication',
idToolbarPanel: 'idToolbarPanel'
},
storeId:{
titreConfirmationPassageEnTrimestre: undefined,
titreConfirmationPassageEnSemestre: undefined,
erreurListeClassesAppliqueA: undefined,
+ erreurGetOptionsPublication: undefined,
enCoursAppliqueA: undefined,
confirmationAppliqueA: undefined,
erreurAppliqueA: undefined
urlListeTypePeriodesExamen: undefined,
urlActionCreerLibelle: undefined,
urlListeClassesAppliqueA: undefined,
+ urlGetOptionsPublication: undefined,
+ urlEnregistreOptionsDePublication: undefined,
urlAppliqueA: undefined
},
libelle : {
ajouterUnLibelle: undefined,
appliquerA: undefined,
reportDuParametrage: undefined,
+ optionsDePublication: undefined,
ok: undefined,
annuler: undefined,
notation: undefined,
+ moyenneGenerale: undefined,
+ coefficient: undefined,
+ moyennesMinMax: undefined,
+ moyennesPrecedentes: undefined,
+ nbNotes: undefined,
+ rangSurNbEleves: undefined,
examen: undefined,
selParamAppliqueA: undefined, //'Sélection des paramétrages des périodes à appliquer'
+ selOptionsDePublication: undefined,
selClassesAModifier: undefined //'Sélection des classes à modifier'
},
icon : {
*/
eliot.notes.parametrages.periodes.PeriodeController = Ext.extend(Ext.util.Observable, {
- /**
- * Constructeur permet de construire le store de grid(periode),
- * tous les stores des composants qui se trouvent dans chaque colonne
- * de grid(periode)
- */
- constructor: function() {
-
- this.ns = eliot.notes.parametrages.periodes;
- this.ConfigServeur = this.ns.Modele;
- this.Constantes = this.ns.Constantes;
-
- this.addEvents(
-
- /**
- * @event periodeChange déclenché lorsqu'une période
- * sélectionnée change
- * @param periode periode sélectionnée
- */
- eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
-
-
- /**
- * @event actionRestaurerDonnee déclenché lorsque période
- * sélectionnée à restaurer
- * @param periodeAModifier periode sélectionnée à restaurer
- */
- eliot.notes.parametrages.periodes.Constantes.eventId.actionRestaurerDonnee,
-
- /**
- * Ouvre la fenêtre Applique A
- * @param classe origine
- * @param classes cibles potentielles
- */
- this.Constantes.eventId.openWindowAppliqueA
-
- );
-
- this.classe = undefined;
- this.periodeSelectionne = undefined;
- this.idNouveauTypePeriode = undefined;
-
- // Store de grid(periode)
- this.storePeriode = new Ext.data.GroupingStore({
- autoDestroy: true,
- id: eliot.notes.parametrages.periodes.Constantes.storeId.idStorePeriode,
- proxy: new Ext.data.HttpProxy({
- url: eliot.notes.parametrages.periodes.Modele.url.urlListeNotesPeriodeInfo,
- method: 'POST'
- }),
-
- reader: new Ext.data.JsonReader({
- root: 'periodeInfos',
- idProperty: 'idPeriode',
- fields:[
- {name: 'idPeriode'},
- {name: 'libelle'},
- {name: 'idTypePeriode'},
- {name: 'ordre'},
- {name: 'groupOrdre'},
- {name: 'dateDebutPeriode', type: 'date', dateFormat: 'c'},
- {name: 'dateFinPeriode', type: 'date', dateFormat: 'c'},
- {name: 'dateFinSaisie', type: 'date', dateFormat: 'c'},
- {name: 'datePublicationBulletins', type: 'date', dateFormat: 'c'},
- {name: 'datePublicationReleves', type: 'date', dateFormat: 'c'},
- {name: 'libelleEditable'},
- {name: 'supprimable'},
- {name: 'isPeriodeAnnee', type: 'boolean'},
- {name: 'isPeriodeXmestre', type: 'boolean'}
- ]
- }),
-
- groupField: 'groupOrdre'
- });
- this.observeProxy(this.storePeriode.proxy);
-
- // Liste des libellés disponnibles dans la combo box de saisie
- this.storeTypePeriode = new Ext.data.Store({
-
- autoLoad: false,
- id: eliot.notes.parametrages.periodes.Constantes.storeId.idStoreTypePeriode,
- proxy: new Ext.data.HttpProxy({
- url: eliot.notes.parametrages.periodes.Modele.url.urlListeTypePeriodesExamen,
- method: 'POST'
- }),
- reader: new Ext.data.JsonReader({
- root: 'typePeriodeInfos',
- fields:[
- {name: 'idTypePeriode', type:'string'},
- {name: 'libelle', type:'string'}
- ]
- })
-
- });
-
- this.observeProxy(this.storeTypePeriode.proxy);
-
- },
-
- /**
- * La méthode permet d'observer les remote requetes ou réponses
- * communiquent entre backoffice et frontoffice au niveau de proxy
- * @param proxy proxy du store de grid periode
- */
- observeProxy : function(proxy) {
- proxy.addListener(
- 'exception',
- function(proxy, type, action, options, res) {
- var message = res.message;
- if (!message) {
- message = eliot.notes.parametrages.periodes.Modele.messages.erreurInconnue;
- }
- eliot.notes.Messages.showErreur(message);
- },
- this);
- },
-
- /**
- * La méthode permet d'observer l'évènement 'actionChangePeriode' qui
- * se lance dans periodeView, une fois l'évènement est lancé,
- * la méthode déclenche l'évènement 'periodeChange'.
- * @param periodeView l'objet periodeView
- */
- observePeriodeView : function(periodeView) {
-
- periodeView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionChangePeriode,
- function(periode) {
- eliot.notes.Messages.resetMessages();
-
- this.periodeSelectionne = periode;
-
- this.fireEvent(
- eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
- periode
- );
-
- },
- this
- );
-
- periodeView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionAfterEdit,
- function(record, changes) {
-
- eliot.notes.Messages.resetMessages();
- this.executeModifierPeriode(record, changes);
-
- },
- this
- );
-
- periodeView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionEditCancel,
- function(index) {
- var donnees = this.storePeriode.getAt(index);
- if (donnees) {
- if (!donnees.data.idPeriode) {
- this.storePeriode.removeAt(index);
-
- this.periodeSelectionne = undefined;
- this.fireEvent(
- eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
- this.periodeSelectionne
- );
- }
- }
- },
- this
- );
-
- periodeView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionNouveauLibelle,
- function(libelle) {
- this.creerLibelle(libelle);
- },
- this
- );
-
- periodeView.addListener(
- this.Constantes.eventId.appliqueA,
- function(notation, examen, classes) {
- this.appliqueA(notation, examen, classes);
- },
- this);
-
- },
-
- /**
- * La méthode qui permet d'observer l'évènement qui est lancé
- * par le controlleur de combo-box de classe.
- * @param classeController controlleur de combo-box de classe
- */
- observeClasseController : function(classeController) {
- classeController.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.classeChange,
- function(classe) {
- this.changeClasse(classe);
- },
- this
- );
- },
-
- /**
- * La méthode permet de recharger le store de periode quand une
- * classe sélectionné
- * @param classe classe sélectionnée
- */
- changeClasse : function(classe) {
- if (classe != null) {
-
- this.classe = classe;
-
- // Recharge la liste des périodes
- this.reloadStorePeriode();
+ /**
+ * Constructeur permet de construire le store de grid(periode),
+ * tous les stores des composants qui se trouvent dans chaque colonne
+ * de grid(periode)
+ */
+ constructor: function() {
+
+ this.ns = eliot.notes.parametrages.periodes;
+ this.ConfigServeur = this.ns.Modele;
+ this.Constantes = this.ns.Constantes;
+
+ this.addEvents(
+
+ /**
+ * @event periodeChange déclenché lorsqu'une période
+ * sélectionnée change
+ * @param periode periode sélectionnée
+ */
+ eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
+
+
+ /**
+ * @event actionRestaurerDonnee déclenché lorsque période
+ * sélectionnée à restaurer
+ * @param periodeAModifier periode sélectionnée à restaurer
+ */
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionRestaurerDonnee,
+
+ /**
+ * Ouvre la fenêtre Applique A
+ * @param classe origine
+ * @param classes cibles potentielles
+ */
+ this.Constantes.eventId.openWindowAppliqueA,
+
+ /**
+ * Ouvre la fenêtre Options de publication
+ * @param classe concernée
+ * @param options de publication potentielles de la classe
+ */
+ this.Constantes.eventId.openWindowOptionsDePublication
+
+ );
+
+ this.classe = undefined;
+ this.periodeSelectionne = undefined;
+ this.idNouveauTypePeriode = undefined;
+
+ // Store de grid(periode)
+ this.storePeriode = new Ext.data.GroupingStore({
+ autoDestroy: true,
+ id: eliot.notes.parametrages.periodes.Constantes.storeId.idStorePeriode,
+ proxy: new Ext.data.HttpProxy({
+ url: eliot.notes.parametrages.periodes.Modele.url.urlListeNotesPeriodeInfo,
+ method: 'POST'
+ }),
+
+ reader: new Ext.data.JsonReader({
+ root: 'periodeInfos',
+ idProperty: 'idPeriode',
+ fields:[
+ {name: 'idPeriode'},
+ {name: 'libelle'},
+ {name: 'idTypePeriode'},
+ {name: 'ordre'},
+ {name: 'groupOrdre'},
+ {name: 'dateDebutPeriode', type: 'date', dateFormat: 'c'},
+ {name: 'dateFinPeriode', type: 'date', dateFormat: 'c'},
+ {name: 'dateFinSaisie', type: 'date', dateFormat: 'c'},
+ {name: 'datePublicationBulletins', type: 'date', dateFormat: 'c'},
+ {name: 'datePublicationReleves', type: 'date', dateFormat: 'c'},
+ {name: 'libelleEditable'},
+ {name: 'supprimable'},
+ {name: 'isPeriodeAnnee', type: 'boolean'},
+ {name: 'isPeriodeXmestre', type: 'boolean'}
+ ]
+ }),
+
+ groupField: 'groupOrdre'
+ });
+ this.observeProxy(this.storePeriode.proxy);
+
+ // Liste des libellés disponnibles dans la combo box de saisie
+ this.storeTypePeriode = new Ext.data.Store({
+
+ autoLoad: false,
+ id: eliot.notes.parametrages.periodes.Constantes.storeId.idStoreTypePeriode,
+ proxy: new Ext.data.HttpProxy({
+ url: eliot.notes.parametrages.periodes.Modele.url.urlListeTypePeriodesExamen,
+ method: 'POST'
+ }),
+ reader: new Ext.data.JsonReader({
+ root: 'typePeriodeInfos',
+ fields:[
+ {name: 'idTypePeriode', type:'string'},
+ {name: 'libelle', type:'string'}
+ ]
+ })
+
+ });
+
+ this.observeProxy(this.storeTypePeriode.proxy);
+
+ },
+
+ /**
+ * La méthode permet d'observer les remote requetes ou réponses
+ * communiquent entre backoffice et frontoffice au niveau de proxy
+ * @param proxy proxy du store de grid periode
+ */
+ observeProxy : function(proxy) {
+ proxy.addListener(
+ 'exception',
+ function(proxy, type, action, options, res) {
+ var message = res.message;
+ if (!message) {
+ message = eliot.notes.parametrages.periodes.Modele.messages.erreurInconnue;
+ }
+ eliot.notes.Messages.showErreur(message);
+ },
+ this);
+ },
+
+ /**
+ * La méthode permet d'observer l'évènement 'actionChangePeriode' qui
+ * se lance dans periodeView, une fois l'évènement est lancé,
+ * la méthode déclenche l'évènement 'periodeChange'.
+ * @param periodeView l'objet periodeView
+ */
+ observePeriodeView : function(periodeView) {
+
+ periodeView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionChangePeriode,
+ function(periode) {
+ eliot.notes.Messages.resetMessages();
+
+ this.periodeSelectionne = periode;
+
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
+ periode
+ );
+
+ },
+ this
+ );
+
+ periodeView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionAfterEdit,
+ function(record, changes) {
+
+ eliot.notes.Messages.resetMessages();
+ this.executeModifierPeriode(record, changes);
+
+ },
+ this
+ );
+
+ periodeView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionEditCancel,
+ function(index) {
+ var donnees = this.storePeriode.getAt(index);
+ if (donnees) {
+ if (!donnees.data.idPeriode) {
+ this.storePeriode.removeAt(index);
+
+ this.periodeSelectionne = undefined;
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
+ this.periodeSelectionne
+ );
+ }
+ }
+ },
+ this
+ );
+
+ periodeView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionNouveauLibelle,
+ function(libelle) {
+ this.creerLibelle(libelle);
+ },
+ this
+ );
+
+ periodeView.addListener(
+ this.Constantes.eventId.appliqueA,
+ function(notation, examen, classes) {
+ this.appliqueA(notation, examen, classes);
+ },
+ this);
+
+ periodeView.addListener(
+ this.Constantes.eventId.enregistreOptionsDePublication,
+ function(optionsDePublication) {
+ this.enregistreOptionsDePublication(optionsDePublication);
+ },
+ this);
+
+ },
+
+ /**
+ * La méthode qui permet d'observer l'évènement qui est lancé
+ * par le controlleur de combo-box de classe.
+ * @param classeController controlleur de combo-box de classe
+ */
+ observeClasseController : function(classeController) {
+ classeController.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.classeChange,
+ function(classe) {
+ this.changeClasse(classe);
+ },
+ this
+ );
+ },
+
+ /**
+ * La méthode permet de recharger le store de periode quand une
+ * classe sélectionné
+ * @param classe classe sélectionnée
+ */
+ changeClasse : function(classe) {
+ if (classe != null) {
+
+ this.classe = classe;
+
+ // Recharge la liste des périodes
+ this.reloadStorePeriode();
+
+ }
+ },
+
+ /**
+ * Recharge le store des périodes
+ */
+ reloadStorePeriode: function() {
+ // Recharge la liste des périodes
+ this.storePeriode.reload({
+ params: {idClasse: this.classe.id}
+ });
+ },
+
+ /**
+ * Recharge le store des types de période
+ * @param idTypePeriode
+ */
+ reloadStoreTypePeriode: function(idTypePeriode) {
+ // Recharge la liste des types de période pour cette classe
+ this.storeTypePeriode.load({
+ params: {
+ idClasse: this.classe.id,
+ idTypePeriode: idTypePeriode
+ }
+ });
+ },
+
+ /**
+ * La méthode qui permet d'observer l'évènement
+ * 'actionModifierPeriodeice' lancé par la vue de toolbar,le grid(periode)
+ * entre dans la mode d'édition
+ * @param toolbarView l'objet toolbarView
+ */
+ observeToolbarView : function(toolbarView) {
+
+ toolbarView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionCreerPeriode,
+ function() {
+ eliot.notes.Messages.resetMessages();
+ this.creerNouvellePeriode();
+ },
+ this
+ );
+
+
+ toolbarView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionModifierPeriode,
+ function() {
+ eliot.notes.Messages.resetMessages();
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionEditPeriodeSelectionne
+ );
+ },
+ this
+ );
+
+ toolbarView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionSupprimerPeriode,
+ function() {
+ eliot.notes.Messages.resetMessages();
+
+ var periode = this.periodeSelectionne;
+
+ eliot.notes.Messages.afficherDialogConfirmation(
+ eliot.notes.parametrages.periodes.Modele.messages.supprimerPeriode,
+ eliot.notes.parametrages.periodes.Modele.messages.confirmationSuppressionPeriode +
+ ' ' + periode.data.libelle + ' ?',
+ this.executeSupprimerPeriode.createDelegate(this),
+ null,
+ periode
+ );
+
+ },
+ this
+ );
+
+ toolbarView.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionPasserEnTrimestreOuSemestrePeriode,
+ function() {
+ eliot.notes.Messages.resetMessages();
+ this.passerEnTrimestreOuSemestre();
+ },
+ this
+ );
+
+ toolbarView.addListener(
+ this.Constantes.eventId.actionAppliqueA,
+ function() {
+ eliot.notes.Messages.resetMessages();
+ this.actionAppliqueA();
+ },
+ this
+ );
+
+ toolbarView.addListener(
+ this.Constantes.eventId.actionAfficherOptionsDePublication,
+ function() {
+ eliot.notes.Messages.resetMessages();
+ this.actionAfficherOptionsDePublication();
+ },
+ this
+ );
+ },
+
+ /**
+ * Exécution d'action d'enregistrement d'une période modifiée
+ * @param periode periode(objet) sélectionnée à enregistrer
+ * @param periodeInfoModifie information modifié
+ */
+ executeModifierPeriode : function(periode, periodeInfoModifie) {
+ periodeInfoModifie.idPeriode = periode.data.idPeriode;
+ periodeInfoModifie.idClasse = this.classe.id;
+ periodeInfoModifie.libelle = Encoder.htmlEncode(periodeInfoModifie.libelle);
+
+ if (this.valideDatesPeriode(periode)) {
+
+ var url = (periodeInfoModifie.idPeriode != null) ?
+ eliot.notes.parametrages.periodes.Modele.url.urlModifierPeriode :
+ eliot.notes.parametrages.periodes.Modele.url.urlCreerPeriode;
+
+ var maskText = (periodeInfoModifie.idPeriode != null) ?
+ this.ConfigServeur.messages.periodeModifieEnCours :
+ this.ConfigServeur.messages.periodeCreeEnCours;
+
+ eliot.commun.AjaxHelper.request({
+ url: url,
+
+ // periodeInfoModifie qui contient info obligatoire: idPeriode
+ // infos optionnels : coeff et evaluable
+ params: periodeInfoModifie,
+
+ success:function() {
+
+ var message = (periodeInfoModifie.idPeriode != null) ?
+ eliot.notes.parametrages.periodes.Modele.messages.periodeModifieSucces :
+ eliot.notes.parametrages.periodes.Modele.messages.periodeCreeSucces;
+
+ eliot.notes.Messages.showConfirmation(message);
+ this.reloadStorePeriode();
+
+ },
+ failure:function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
+ else {
+
+ var message = (periodeInfoModifie.idPeriode != null) ?
+ eliot.notes.parametrages.periodes.Modele.messages.periodeModifieEchou :
+ eliot.notes.parametrages.periodes.Modele.messages.periodeCreeEchou;
+
+ eliot.notes.Messages.showErreur(message);
+ }
+ this.reloadStorePeriode();
+ },
+ maskText: maskText,
+ scope : this
+ });
+ }
+ else {
+ eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurDatesSaisies);
+ this.reloadStorePeriode();
+ }
+ },
+
+ /**
+ * Valide les dates saisies pour la période
+ */
+ valideDatesPeriode: function(periode) {
+ var dateDebut = periode.get('dateDebutPeriode');
+ var date = undefined;
+
+ // Date de fin de période
+ date = periode.get('dateFinPeriode');
+ if (date < dateDebut) return false;
+
+ // Date de fin de saisie
+ date = periode.get('dateFinSaisie');
+ if (date < dateDebut) return false;
+
+ // Date de publication bulletins
+ date = periode.get('datePublicationBulletins');
+ if (date < dateDebut) return false;
+
+ // Date de publication releves
+ date = periode.get('datePublicationReleves');
+
+ return !(date < dateDebut);
+ },
+
+ /**
+ * Crée une nouvelle période
+ */
+ creerNouvellePeriode : function() {
+
+ var nouvellePeriode = new this.storePeriode.recordType({
+ libelle : '',
+ ordre : '',
+ groupOrdre : 2,
+ libelleEditable : true,
+ supprimable : true
+ });
+
+ var dateExamenParDefaut = this.getDateExamenParDefaut();
+ nouvellePeriode.set('dateDebutPeriode', dateExamenParDefaut);
+ nouvellePeriode.set('dateFinPeriode', dateExamenParDefaut);
+ nouvellePeriode.set('dateFinSaisie', dateExamenParDefaut);
+ nouvellePeriode.set('datePublicationBulletins', dateExamenParDefaut);
+ nouvellePeriode.set('datePublicationReleves', dateExamenParDefaut);
+
+ this.storePeriode.add(nouvellePeriode);
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.Constantes.eventId.actionCreerPeriode
+ );
+ },
+ /**
+ * Date par defaut quand on cree la periode d'examen.
+ * aujourd'hui - Si la date d'aujourd'hui est dans l'annee actuel ou l'annee
+ * actuele n'est pas definie.
+ * debutAnnee - Si la date d'aujourd'hui est inferieur de debut d'annee.
+ * finAnnee - Si la date d'aujourd'hui est supperieur de fin d'annee.
+ *
+ */
+ getDateExamenParDefaut : function() {
+ var dateExamen = this.getDateAujourdhui();
+ var periodeAnnee = this.getPeriodeAnnee();
+ if (periodeAnnee) {
+ var debutAnnee = periodeAnnee.data.dateDebutPeriode;
+ var finAnnee = periodeAnnee.data.dateFinPeriode;
+ if (debutAnnee && dateExamen < debutAnnee) {
+ dateExamen = debutAnnee;
+ }
+ if (finAnnee && dateExamen > finAnnee) {
+ dateExamen = finAnnee;
+ }
+ }
+ return dateExamen;
+ },
+ /**
+ * Date d'ajourd'hui sans partie time.
+ */
+ getDateAujourdhui : function() {
+ var today = new Date();
+ today.setHours(0);
+ today.setMinutes(0);
+ today.setSeconds(0);
+ today.setMilliseconds(0);
+ return today;
+ },
+ /**
+ * Get la periode d'annee
+ */
+ getPeriodeAnnee : function() {
+ var periodes = this.storePeriode.data.items;
+ var periodeAnnee = undefined;
+ if (periodes) {
+ for (var i = 0; periodes.length; i++) {
+ if (periodes[i] && periodes[i].data.isPeriodeAnnee) {
+ periodeAnnee = periodes[i];
+ break;
}
- },
-
- /**
- * Recharge le store des périodes
- */
- reloadStorePeriode: function() {
- // Recharge la liste des périodes
- this.storePeriode.reload({
- params: {idClasse: this.classe.id}
- });
- },
-
- /**
- * Recharge le store des types de période
- * @param idTypePeriode
- */
- reloadStoreTypePeriode: function(idTypePeriode) {
- // Recharge la liste des types de période pour cette classe
- this.storeTypePeriode.load({
- params: {
- idClasse: this.classe.id,
- idTypePeriode: idTypePeriode
- }
- });
- },
-
- /**
- * La méthode qui permet d'observer l'évènement
- * 'actionModifierPeriodeice' lancé par la vue de toolbar,le grid(periode)
- * entre dans la mode d'édition
- * @param toolbarView l'objet toolbarView
- */
- observeToolbarView : function(toolbarView) {
-
- toolbarView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionCreerPeriode,
- function() {
- eliot.notes.Messages.resetMessages();
- this.creerNouvellePeriode();
- },
- this
- );
-
-
- toolbarView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionModifierPeriode,
- function() {
- eliot.notes.Messages.resetMessages();
- this.fireEvent(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionEditPeriodeSelectionne
- );
- },
- this
- );
-
- toolbarView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionSupprimerPeriode,
- function() {
- eliot.notes.Messages.resetMessages();
-
- var periode = this.periodeSelectionne;
-
- eliot.notes.Messages.afficherDialogConfirmation(
- eliot.notes.parametrages.periodes.Modele.messages.supprimerPeriode,
- eliot.notes.parametrages.periodes.Modele.messages.confirmationSuppressionPeriode +
- ' ' + periode.data.libelle + ' ?',
- this.executeSupprimerPeriode.createDelegate(this),
- null,
- periode
- );
-
- },
- this
- );
-
- toolbarView.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionPasserEnTrimestreOuSemestrePeriode,
- function() {
- eliot.notes.Messages.resetMessages();
- this.passerEnTrimestreOuSemestre();
- },
- this
- );
-
- toolbarView.addListener(
- this.Constantes.eventId.actionAppliqueA,
- function() {
- eliot.notes.Messages.resetMessages();
- this.actionAppliqueA();
- },
- this
- );
- },
-
- /**
- * Exécution d'action d'enregistrement d'une période modifiée
- * @param periode periode(objet) sélectionnée à enregistrer
- * @param periodeInfoModifie information modifié
- */
- executeModifierPeriode : function(periode, periodeInfoModifie) {
- periodeInfoModifie.idPeriode = periode.data.idPeriode;
- periodeInfoModifie.idClasse = this.classe.id;
- periodeInfoModifie.libelle = Encoder.htmlEncode(periodeInfoModifie.libelle);
-
- if (this.valideDatesPeriode(periode)) {
-
- var url = (periodeInfoModifie.idPeriode != null) ?
- eliot.notes.parametrages.periodes.Modele.url.urlModifierPeriode :
- eliot.notes.parametrages.periodes.Modele.url.urlCreerPeriode;
-
- var maskText = (periodeInfoModifie.idPeriode != null) ?
- this.ConfigServeur.messages.periodeModifieEnCours :
- this.ConfigServeur.messages.periodeCreeEnCours;
-
- eliot.commun.AjaxHelper.request({
- url: url,
-
- // periodeInfoModifie qui contient info obligatoire: idPeriode
- // infos optionnels : coeff et evaluable
- params: periodeInfoModifie,
-
- success:function() {
-
- var message = (periodeInfoModifie.idPeriode != null) ?
- eliot.notes.parametrages.periodes.Modele.messages.periodeModifieSucces :
- eliot.notes.parametrages.periodes.Modele.messages.periodeCreeSucces;
-
- eliot.notes.Messages.showConfirmation(message);
- this.reloadStorePeriode();
-
- },
- failure:function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
-
- var message = (periodeInfoModifie.idPeriode != null) ?
- eliot.notes.parametrages.periodes.Modele.messages.periodeModifieEchou :
- eliot.notes.parametrages.periodes.Modele.messages.periodeCreeEchou;
-
- eliot.notes.Messages.showErreur(message);
- }
- this.reloadStorePeriode();
- },
- maskText: maskText,
- scope : this
- });
+ }
+ }
+ return periodeAnnee;
+ },
+ /**
+ * Exécution d'action de suppression d'une période
+ * @param periode l'évaluation (objet) sélectionnée à supprimer
+ */
+ executeSupprimerPeriode : function(periode) {
+
+ var periodeInfoSupprime = {
+ idPeriode: periode.id
+ };
+
+ eliot.commun.AjaxHelper.request({
+
+ url:eliot.notes.parametrages.periodes.Modele.url.urlSupprimerPeriode,
+ params: periodeInfoSupprime,
+
+ success:function(reponse) {
+
+ // Si l'évaluation à supprimer contient les notes,
+ // Alors recomfirmer la suppression
+ if (reponse.deleted != true) {
+
+ eliot.notes.Messages.afficherDialogConfirmation(
+ eliot.notes.parametrages.periodes.Modele.messages.supprimerPeriode,
+ eliot.notes.parametrages.periodes.Modele.messages.noteDejaSaisie
+ + '</br>' +
+ eliot.notes.parametrages.periodes.Modele.messages.confirmationSuppressionPeriode +
+ ' ' + periode.data.libelle + ' ?',
+ this.executerSupprimer.createDelegate(this),
+ null,
+ periode
+ );
+ }
+
+ else {
+ eliot.notes.Messages.showConfirmation(
+ eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeSucces
+ );
+ this.reloadStorePeriode();
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
+ undefined
+ );
+
}
+ },
+
+ failure:function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
else {
- eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurDatesSaisies);
- this.reloadStorePeriode();
+ eliot.notes.Messages.showErreur(
+ eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeEchou
+ );
}
- },
-
- /**
- * Valide les dates saisies pour la période
- */
- valideDatesPeriode: function(periode) {
- var dateDebut = periode.get('dateDebutPeriode');
- var date = undefined;
-
- // Date de fin de période
- date = periode.get('dateFinPeriode');
- if (date < dateDebut) return false;
-
- // Date de fin de saisie
- date = periode.get('dateFinSaisie');
- if (date < dateDebut) return false;
-
- // Date de publication bulletins
- date = periode.get('datePublicationBulletins');
- if (date < dateDebut) return false;
-
- // Date de publication releves
- date = periode.get('datePublicationReleves');
-
- return !(date < dateDebut);
- },
-
- /**
- * Crée une nouvelle période
- */
- creerNouvellePeriode : function() {
-
- var nouvellePeriode = new this.storePeriode.recordType({
- libelle : '',
- ordre : '',
- groupOrdre : 2,
- libelleEditable : true,
- supprimable : true
- });
-
- var dateExamenParDefaut = this.getDateExamenParDefaut();
- nouvellePeriode.set('dateDebutPeriode', dateExamenParDefaut);
- nouvellePeriode.set('dateFinPeriode', dateExamenParDefaut);
- nouvellePeriode.set('dateFinSaisie', dateExamenParDefaut);
- nouvellePeriode.set('datePublicationBulletins', dateExamenParDefaut);
- nouvellePeriode.set('datePublicationReleves', dateExamenParDefaut);
-
- this.storePeriode.add(nouvellePeriode);
+ },
+ maskText: this.ConfigServeur.messages.periodeSupprimeEnCours,
+ scope : this
+ });
+ },
+
+ /**
+ * La méthode permet de supprimer une période qui contient les notes
+ * @param periode l'objet période à supprimer
+ */
+ executerSupprimer : function(periode) {
+
+ var periodeInfoSupprime = {
+ idPeriode: periode.id
+ };
+
+ eliot.commun.AjaxHelper.request({
+
+ url:eliot.notes.parametrages.periodes.Modele.url.urlSupprimerPeriodeLierNote,
+ params: periodeInfoSupprime,
+
+ success:function() {
+
+ eliot.notes.Messages.showConfirmation(
+ eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeSucces
+ );
+ this.reloadStorePeriode();
+
this.fireEvent(
- eliot.notes.parametrages.periodes.Constantes.eventId.actionCreerPeriode
- );
- },
- /**
- * Date par defaut quand on cree la periode d'examen.
- * aujourd'hui - Si la date d'aujourd'hui est dans l'annee actuel ou l'annee
- * actuele n'est pas definie.
- * debutAnnee - Si la date d'aujourd'hui est inferieur de debut d'annee.
- * finAnnee - Si la date d'aujourd'hui est supperieur de fin d'annee.
- *
- */
- getDateExamenParDefaut : function() {
- var dateExamen = this.getDateAujourdhui();
- var periodeAnnee = this.getPeriodeAnnee();
- if (periodeAnnee) {
- var debutAnnee = periodeAnnee.data.dateDebutPeriode;
- var finAnnee = periodeAnnee.data.dateFinPeriode;
- if (debutAnnee && dateExamen < debutAnnee) {
- dateExamen = debutAnnee;
- }
- if (finAnnee && dateExamen > finAnnee) {
- dateExamen = finAnnee;
- }
+ eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
+ undefined
+ );
+
+ },
+
+ failure:function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
}
- return dateExamen;
- },
- /**
- * Date d'ajourd'hui sans partie time.
- */
- getDateAujourdhui : function() {
- var today = new Date();
- today.setHours(0);
- today.setMinutes(0);
- today.setSeconds(0);
- today.setMilliseconds(0);
- return today;
- },
- /**
- * Get la periode d'annee
- */
- getPeriodeAnnee : function() {
- var periodes = this.storePeriode.data.items;
- var periodeAnnee = undefined;
- if (periodes) {
- for (var i = 0; periodes.length; i++) {
- if (periodes[i] && periodes[i].data.isPeriodeAnnee) {
- periodeAnnee = periodes[i];
- break;
- }
- }
+ else {
+ eliot.notes.Messages.showErreur(
+ eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeEchou
+ );
}
- return periodeAnnee;
- },
- /**
- * Exécution d'action de suppression d'une période
- * @param periode l'évaluation (objet) sélectionnée à supprimer
- */
- executeSupprimerPeriode : function(periode) {
-
- var periodeInfoSupprime = {
- idPeriode: periode.id
- };
-
- eliot.commun.AjaxHelper.request({
-
- url:eliot.notes.parametrages.periodes.Modele.url.urlSupprimerPeriode,
- params: periodeInfoSupprime,
-
- success:function(reponse) {
-
- // Si l'évaluation à supprimer contient les notes,
- // Alors recomfirmer la suppression
- if (reponse.deleted != true) {
-
- eliot.notes.Messages.afficherDialogConfirmation(
- eliot.notes.parametrages.periodes.Modele.messages.supprimerPeriode,
- eliot.notes.parametrages.periodes.Modele.messages.noteDejaSaisie
- + '</br>' +
- eliot.notes.parametrages.periodes.Modele.messages.confirmationSuppressionPeriode +
- ' ' + periode.data.libelle + ' ?',
- this.executerSupprimer.createDelegate(this),
- null,
- periode
- );
- }
-
- else {
- eliot.notes.Messages.showConfirmation(
- eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeSucces
- );
- this.reloadStorePeriode();
- this.fireEvent(
- eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
- undefined
- );
-
- }
-
- },
-
- failure:function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
- eliot.notes.Messages.showErreur(
- eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeEchou
- );
- }
- },
- maskText: this.ConfigServeur.messages.periodeSupprimeEnCours,
- scope : this
- });
- },
-
- /**
- * La méthode permet de supprimer une période qui contient les notes
- * @param periode l'objet période à supprimer
- */
- executerSupprimer : function(periode) {
-
- var periodeInfoSupprime = {
- idPeriode: periode.id
- };
-
- eliot.commun.AjaxHelper.request({
-
- url:eliot.notes.parametrages.periodes.Modele.url.urlSupprimerPeriodeLierNote,
- params: periodeInfoSupprime,
-
- success:function() {
-
- eliot.notes.Messages.showConfirmation(
- eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeSucces
- );
- this.reloadStorePeriode();
-
- this.fireEvent(
- eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
- undefined
- );
-
- },
-
- failure:function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
- eliot.notes.Messages.showErreur(
- eliot.notes.parametrages.periodes.Modele.messages.periodeSupprimeEchou
- );
- }
- },
- maskText: this.ConfigServeur.messages.periodeSupprimeEnCours,
- scope : this
- });
- },
-
-
- /**
- * Passer en mode trimestre ou Semestre
- */
- passerEnTrimestreOuSemestre : function() {
-
- // Message d'avertissement
- var passageEnTrimestre = false;
+ },
+ maskText: this.ConfigServeur.messages.periodeSupprimeEnCours,
+ scope : this
+ });
+ },
+
+
+ /**
+ * Passer en mode trimestre ou Semestre
+ */
+ passerEnTrimestreOuSemestre : function() {
+
+ // Message d'avertissement
+ var passageEnTrimestre = false;
+ var typeIntervalle = this.classe.typeIntervalle.name;
+
+ if (typeIntervalle !== eliot.notes.parametrages.periodes.Modele.type.typePeriodeTRIMESTRE) {
+ passageEnTrimestre = true;
+ }
+
+ var titre = '';
+ var message = '';
+
+ if (passageEnTrimestre === true) {
+ titre = eliot.notes.parametrages.periodes.Modele.messages.titreConfirmationPassageEnTrimestre;
+ message = eliot.notes.parametrages.periodes.Modele.messages.confirmationPassageEnTrimestre;
+ }
+ else {
+ titre = eliot.notes.parametrages.periodes.Modele.messages.titreConfirmationPassageEnSemestre;
+ message = eliot.notes.parametrages.periodes.Modele.messages.confirmationPassageEnSemestre;
+ }
+
+ // Avertissement et confirmation
+ eliot.notes.Messages.afficherDialogConfirmation(
+ titre,
+ message,
+ this.executePasserEnTrimestreOuSemestre.createDelegate(this)
+ );
+ },
+
+ /**
+ * Effectuer l'action de passer en mode trimestre ou semestre
+ */
+ executePasserEnTrimestreOuSemestre : function() {
+ eliot.commun.AjaxHelper.request({
+ url:eliot.notes.parametrages.periodes.Modele.url.urlPasserEnTrimestreOuSemestre,
+ params: {'idClasse': this.classe.id},
+ timeout: 300000, // 5 minutes (le traitement est lourds)
+
+ success:function() {
+
var typeIntervalle = this.classe.typeIntervalle.name;
- if (typeIntervalle !== eliot.notes.parametrages.periodes.Modele.type.typePeriodeTRIMESTRE) {
- passageEnTrimestre = true;
+ if (typeIntervalle === eliot.notes.parametrages.periodes.Modele.type.typePeriodeTRIMESTRE) {
+ this.classe.typeIntervalle.name = eliot.notes.parametrages.periodes.Modele.type.typePeriodeSEMESTRE;
+ }
+ else {
+ this.classe.typeIntervalle.name = eliot.notes.parametrages.periodes.Modele.type.typePeriodeTRIMESTRE;
+ }
+
+ this.reloadStorePeriode();
+ eliot.notes.Messages.showConfirmation(
+ eliot.notes.parametrages.periodes.Modele.messages.passageEnTrimestreSemestreSucces
+ );
+ },
+ failure:function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
+ else {
+ eliot.notes.Messages.showErreur(
+ eliot.notes.parametrages.periodes.Modele.messages.passageEnTrimestreSemestreEchou
+ );
}
+ },
+ maskText: this.ConfigServeur.messages.passageEnTrimestreSemestreEnCours,
+ scope : this
+ });
+ },
+
+ /**
+ * Méthode de création d'un libellé de période
+ * @param libelle saisi
+ */
+ creerLibelle: function(libelle) {
+ this.idNouveauTypePeriode = undefined;
+
+ // appeler la création du libellé
+ eliot.commun.AjaxHelper.request({
+
+ url: eliot.notes.parametrages.periodes.Modele.url.urlActionCreerLibelle,
- var titre = '';
- var message = '';
+ params: {
+ libelle: libelle,
+ idClasse: this.classe.id
+ },
+ maskText: eliot.notes.parametrages.periodes.Modele.messages.enCoursCreationLibelle,
+ scope: this,
- if (passageEnTrimestre === true) {
- titre = eliot.notes.parametrages.periodes.Modele.messages.titreConfirmationPassageEnTrimestre;
- message = eliot.notes.parametrages.periodes.Modele.messages.confirmationPassageEnTrimestre;
+ success: function(reponse) {
+
+ // Id du type de période crée
+ this.idNouveauTypePeriode = reponse.idTypePeriode;
+
+ // Recharge la liste des types de période pour cette classe
+ this.reloadStoreTypePeriode();
+
+ eliot.notes.Messages.showConfirmation(
+ eliot.notes.parametrages.periodes.Modele.messages.confirmationLibelleCree);
+
+ },
+
+ failure: function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
}
else {
- titre = eliot.notes.parametrages.periodes.Modele.messages.titreConfirmationPassageEnSemestre;
- message = eliot.notes.parametrages.periodes.Modele.messages.confirmationPassageEnSemestre;
+ eliot.notes.Messages.showErreur(
+ eliot.notes.parametrages.periodes.Modele.messages.erreurCreationLibelle);
}
+ this.reloadStoreTypePeriode();
+ }
+ });
+ },
- // Avertissement et confirmation
- eliot.notes.Messages.afficherDialogConfirmation(
- titre,
- message,
- this.executePasserEnTrimestreOuSemestre.createDelegate(this)
- );
- },
-
- /**
- * Effectuer l'action de passer en mode trimestre ou semestre
- */
- executePasserEnTrimestreOuSemestre : function() {
- eliot.commun.AjaxHelper.request({
- url:eliot.notes.parametrages.periodes.Modele.url.urlPasserEnTrimestreOuSemestre,
- params: {'idClasse': this.classe.id},
- timeout: 300000, // 5 minutes (le traitement est lourds)
-
- success:function() {
-
- var typeIntervalle = this.classe.typeIntervalle.name;
-
- if (typeIntervalle === eliot.notes.parametrages.periodes.Modele.type.typePeriodeTRIMESTRE) {
- this.classe.typeIntervalle.name = eliot.notes.parametrages.periodes.Modele.type.typePeriodeSEMESTRE;
- }
- else {
- this.classe.typeIntervalle.name = eliot.notes.parametrages.periodes.Modele.type.typePeriodeTRIMESTRE;
- }
-
- this.reloadStorePeriode();
- eliot.notes.Messages.showConfirmation(
- eliot.notes.parametrages.periodes.Modele.messages.passageEnTrimestreSemestreSucces
- );
- },
- failure:function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
- eliot.notes.Messages.showErreur(
- eliot.notes.parametrages.periodes.Modele.messages.passageEnTrimestreSemestreEchou
- );
- }
- },
- maskText: this.ConfigServeur.messages.passageEnTrimestreSemestreEnCours,
- scope : this
- });
- },
-
- /**
- * Méthode de création d'un libellé de période
- * @param libelle saisi
- */
- creerLibelle: function(libelle) {
- this.idNouveauTypePeriode = undefined;
-
- // appeler la création du libellé
- eliot.commun.AjaxHelper.request({
-
- url: eliot.notes.parametrages.periodes.Modele.url.urlActionCreerLibelle,
-
- params: {
- libelle: libelle,
- idClasse: this.classe.id
- },
- maskText: eliot.notes.parametrages.periodes.Modele.messages.enCoursCreationLibelle,
- scope: this,
-
- success: function(reponse) {
-
- // Id du type de période crée
- this.idNouveauTypePeriode = reponse.idTypePeriode;
-
- // Recharge la liste des types de période pour cette classe
- this.reloadStoreTypePeriode();
-
- eliot.notes.Messages.showConfirmation(
- eliot.notes.parametrages.periodes.Modele.messages.confirmationLibelleCree);
-
- },
-
- failure: function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
- eliot.notes.Messages.showErreur(
- eliot.notes.parametrages.periodes.Modele.messages.erreurCreationLibelle);
- }
- this.reloadStoreTypePeriode();
- }
- });
- },
+ /**
+ * Applique le paramétrage à d'autres périodes
+ */
+ actionAppliqueA: function() {
- /**
- * Applique le paramétrage à d'autres périodes
- */
- actionAppliqueA: function() {
+ // Cherche la liste des classes
+ this.getListeClasse(function(reponse) {
+ this.fireEvent(this.Constantes.eventId.openWindowAppliqueA, this.classe, reponse.classes);
+ });
- // Cherche la liste des classes
- this.getListeClasse(function(reponse) {
- this.fireEvent(this.Constantes.eventId.openWindowAppliqueA, this.classe, reponse.classes);
- });
+ },
- },
+ actionAfficherOptionsDePublication: function() {
- /**
- * Liste des classes sur lesquelles appliquer le paramétrage
- * @param success
- */
- getListeClasse: function(success) {
+ this.getOptionsPublication(function(reponse) {
+ this.fireEvent(this.Constantes.eventId.openWindowOptionsDePublication, this.classe, reponse.optionsDePublication);
+ });
- eliot.commun.AjaxHelper.request({
+ },
- url: this.ConfigServeur.url.urlListeClassesAppliqueA,
+ /**
+ * Liste des classes sur lesquelles appliquer le paramétrage
+ * @param success
+ */
+ getListeClasse: function(success) {
- params: {
- classeId: this.classe.id
- },
+ eliot.commun.AjaxHelper.request({
- scope: this,
+ url: this.ConfigServeur.url.urlListeClassesAppliqueA,
- success: success,
+ params: {
+ classeId: this.classe.id
+ },
- failure: function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
- eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurListeClassesAppliqueA);
- }
- }
- });
- },
-
- /**
- * Applique le paramétrage
- * @param notation
- * @param examen
- * @param classes
- */
- appliqueA: function(notation, examen, classes) {
-
- var classesParam = [];
-
- Ext.each(classes, function(classe) {
- classesParam.push(classe.id);
- }, this);
-
- eliot.commun.AjaxHelper.request({
-
- url: this.ConfigServeur.url.urlAppliqueA,
-
- params: {
- classeId: this.classe.id,
- notation: notation,
- examen: examen,
- classes: Ext.encode(classesParam)
- },
-
- maskText: eliot.notes.parametrages.periodes.Modele.messages.enCoursAppliqueA,
- scope: this,
-
- success: function(reponse) {
- eliot.notes.Messages.showConfirmation(this.ConfigServeur.messages.confirmationAppliqueA);
- },
-
- failure: function(reponse) {
- if ((reponse.message !== undefined) && (reponse.message !== '')) {
- eliot.notes.Messages.showErreur(reponse.message);
- }
- else {
- eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurAppliqueA);
- }
- }
- });
- }
+ scope: this,
+
+ success: success,
+
+ failure: function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
+ else {
+ eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurListeClassesAppliqueA);
+ }
+ }
+ });
+ },
+
+ getOptionsPublication: function(success) {
+
+ eliot.commun.AjaxHelper.request({
+
+ url: this.ConfigServeur.url.urlGetOptionsPublication,
+
+ params: {
+ classeId: this.classe.id
+ },
+
+ scope: this,
+
+ success: success,
+
+ failure: function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
+ else {
+ eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurGetOptionsPublication);
+ }
+ }
+ });
+ },
+
+ /**
+ * Applique le paramétrage
+ * @param notation
+ * @param examen
+ * @param classes
+ */
+ appliqueA: function(notation, examen, classes) {
+
+ var classesParam = [];
+
+ Ext.each(classes, function(classe) {
+ classesParam.push(classe.id);
+ }, this);
+
+ eliot.commun.AjaxHelper.request({
+
+ url: this.ConfigServeur.url.urlAppliqueA,
+
+ params: {
+ classeId: this.classe.id,
+ notation: notation,
+ examen: examen,
+ classes: Ext.encode(classesParam)
+ },
+
+ maskText: eliot.notes.parametrages.periodes.Modele.messages.enCoursAppliqueA,
+ scope: this,
+
+ success: function(reponse) {
+ eliot.notes.Messages.showConfirmation(this.ConfigServeur.messages.confirmationAppliqueA);
+ },
+
+ failure: function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
+ else {
+ eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurAppliqueA);
+ }
+ }
+ });
+ },
+
+ enregistreOptionsDePublication: function(optionsDePublication) {
+
+ eliot.commun.AjaxHelper.request({
+
+ url: this.ConfigServeur.url.urlEnregistreOptionsDePublication,
+
+ params: {
+ classeId: this.classe.id,
+ bulletinOptionsId: optionsDePublication.id,
+ moyenneGenerale: optionsDePublication.moyenneGenerale,
+ coefficient: optionsDePublication.coefficient,
+ moyennePrecedente: optionsDePublication.moyennePrecedente,
+ moyenneMinMax: optionsDePublication.moyenneMinMax,
+ nombreNotes:optionsDePublication.nombreNotes,
+ rangs: optionsDePublication.rangs
+
+ },
+
+ scope: this,
+
+ failure: function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.notes.Messages.showErreur(reponse.message);
+ }
+ else {
+ eliot.notes.Messages.showErreur(this.ConfigServeur.messages.erreurInconnue);
+ }
+ }
+ });
+ }
});
\ No newline at end of file
this.addEvents(
- /**
- * @event actionChangePeriode déclenché lorsque uune periode
- * sélectionnée
- * @param grid l'objet grid de periode
- * @param rowIndex numéro de ligne de periode sélectionnée
- */
+ /**
+ * @event actionChangePeriode déclenché lorsque uune periode
+ * sélectionnée
+ * @param grid l'objet grid de periode
+ * @param rowIndex numéro de ligne de periode sélectionnée
+ */
this.Constantes.eventId.actionChangePeriode,
- /**
- * @event actionEditCancel annule la saisie en cours
- * @param index index de la ligne éditée
- */
+ /**
+ * @event actionEditCancel annule la saisie en cours
+ * @param index index de la ligne éditée
+ */
this.Constantes.eventId.actionEditCancel,
- /**
- * Ajout de nouveau libellé par sélection de nouveau dans la
- * Combo libellé de période
- * @event actionNouveauLibelle
- * @param libelle libellé saisi
- */
+ /**
+ * Ajout de nouveau libellé par sélection de nouveau dans la
+ * Combo libellé de période
+ * @event actionNouveauLibelle
+ * @param libelle libellé saisi
+ */
this.Constantes.eventId.actionNouveauLibelle,
this.Constantes.eventId.actionAfterEdit,
this.Constantes.eventId.actionBeforeEdit,
- /**
- * Applique le paramétrage à
- * @event appliqueA
- * @param notation
- * @param examen
- * @param classes
- */
- this.Constantes.eventId.appliqueA
+ /**
+ * Applique le paramétrage à
+ * @event appliqueA
+ * @param notation
+ * @param examen
+ * @param classes
+ */
+ this.Constantes.eventId.appliqueA,
+ this.Constantes.eventId.enregistreOptionsDePublication
- );
+ );
// Fenêtre Applique à
this.windowAppliqueA = undefined;
+ this.windowOptionsDePublication = undefined;
+
// Mode édition
this.edition = false;
width: 100,
renderer: Ext.util.Format.dateRenderer('d/m/Y'),
editor: this.datePublicationBulletinsEditor
- }
+ }
]
});
},
this
- );
+ );
},
},
this
- );
+ );
this.editor.addListener(
'beforeedit',
this.fireEvent(
this.Constantes.eventId.actionBeforeEdit
- );
+ );
this.dateDebPeriodeEditor.setValue(null);
this.dateFinPeriodeEditor.setValue(null);
},
this
- );
+ );
// Ajouter un listener sur editor pour capter l'évènement "afteredit"
this.editor.addListener(
this.Constantes.eventId.actionAfterEdit,
record,
record.getChanges()
- );
+ );
},
this
- );
+ );
// Ecoute 'canceledit'
this.editor.addListener(
this.fireEvent(
this.Constantes.eventId.actionEditCancel,
this.rowIndexAModifier
- );
+ );
if (this.periodeGrid.store.getAt(this.rowIndexAModifier) === undefined) {
this.rowIndexAModifier = undefined;
}
},
this
- );
+ );
},
/**
if (this.periodeController.periodeSelectionne) {
this.idTypePeriodeEditor.setValue(
this.periodeController.periodeSelectionne.data.idTypePeriode
- );
+ );
} else {
this.idTypePeriodeEditor.setValue('');
}
this.fireEvent(
this.Constantes.eventId.actionChangePeriode,
periode
- );
+ );
}
},
scope: this
this.rowIndexAModifier = index;
},
this
- );
+ );
periodeController.addListener(
this.editePeriodeSelectionne();
},
this
- );
+ );
periodeController.addListener(
this.Constantes.eventId.actionEditPeriodeSelectionne,
this.editePeriodeSelectionne();
},
this
- );
+ );
periodeController.addListener(
this.Constantes.eventId.openWindowAppliqueA,
},
this);
+ periodeController.addListener(
+ this.Constantes.eventId.openWindowOptionsDePublication,
+ function(classe, optionsDePublication) {
+ this.openWindowOptionsDePublication(classe, optionsDePublication);
+ },
+ this);
+
},
/**
},
+ /**
+ * Ouvre la fenêtre popup Options de publication
+ * @param classe
+ * @param optionsDePublication
+ */
+ openWindowOptionsDePublication: function(classe, optionsDePublication) {
+
+ if (this.windowOptionsDePublication === undefined) {
+ this.initWindowOptionsDePublication(classe);
+ }
+
+ this.optionsDePublication = optionsDePublication;
+ if (this.optionsDePublication){
+ var moyenneGenerale = this.optionsDePublication.moyenneGenerale;
+ var coefficient = this.optionsDePublication.coefficient;
+ var moyenneMinMax = this.optionsDePublication.moyenneMinMax;
+ var moyennePrecedente = this.optionsDePublication.moyennePrecedente;
+ var nombreNotes = this.optionsDePublication.nombreNotes;
+ var rangs = this.optionsDePublication.rangs;
+ if (moyenneGenerale != undefined) {
+ this.checkBoxMoyenneGenerale.setValue(moyenneGenerale);
+ }
+ if (coefficient != undefined){
+ this.checkBoxCoefficient.setValue(coefficient);
+ }
+ if (moyenneMinMax != undefined){
+ this.checkBoxMoyennesMinMax.setValue(moyenneMinMax);
+ }
+ if (moyennePrecedente != undefined){
+ this.checkBoxMoyennesPrecedentes.setValue(moyennePrecedente);
+ }
+ if (nombreNotes != undefined){
+ this.checkBoxNbNotes.setValue(nombreNotes);
+ }
+ if (rangs != undefined){
+ this.checkBoxRang.setValue(rangs);
+ }
+ }
+
+ this.windowOptionsDePublication.show();
+
+ },
+
/**
* Crée la popup Applique a
* @param classe
});
},
+ /**
+ * Crée la popup Options De Publication
+ */
+ initWindowOptionsDePublication: function(classe) {
+
+ this.checkBoxMoyenneGenerale = new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyenneGenerale + '</span>',
+ checked: true
+ });
+ this.checkBoxCoefficient = new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.coefficient + '</span>',
+ checked: true
+ });
+ this.checkBoxMoyennesMinMax = new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyennesMinMax + '</span>',
+ checked: true
+ });
+ this.checkBoxMoyennesPrecedentes = new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyennesPrecedentes + '</span>',
+ checked: false
+ });
+ this.checkBoxNbNotes = new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.nbNotes + '</span>',
+ checked: false
+ });
+ this.checkBoxRang = new Ext.form.Checkbox({
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.rangSurNbEleves + '</span>',
+ checked: false
+ });
+
+ this.buttonOk = new Ext.Button({
+ text: this.ConfigServeur.libelle.ok,
+ handler: function() {
+ this.optionsDePublication.moyenneGenerale = this.checkBoxMoyenneGenerale.getValue();
+ this.optionsDePublication.coefficient = this.checkBoxCoefficient.getValue();
+ this.optionsDePublication.moyenneMinMax = this.checkBoxMoyennesMinMax.getValue();
+ this.optionsDePublication.moyennePrecedente = this.checkBoxMoyennesPrecedentes.getValue();
+ this.optionsDePublication.nombreNotes = this.checkBoxNbNotes.getValue();
+ this.optionsDePublication.rangs = this.checkBoxRang.getValue();
+
+ this.fireEvent(
+ this.Constantes.eventId.enregistreOptionsDePublication,
+ this.optionsDePublication);
+
+ this.windowOptionsDePublication.hide();
+ },
+ scope: this
+ });
+
+ this.windowOptionsDePublication = new Ext.Window({
+
+ title: this.ConfigServeur.libelle.optionsDePublication,
+ layout:'fit',
+ width:350,
+ height:250,
+ closeAction:'hide',
+ resizable: false,
+ plain: true,
+
+ items: [
+ {
+ xtype: 'fieldset',
+ border: false,
+ autoHeight: true,
+ defaults: {
+ width: 200
+ },
+ items: [
+ {
+ xtype: 'label',
+ html: this.ConfigServeur.libelle.selOptionsDePublication+'<div style="margin: 0 0 5px 0"/>'
+ },
+ {
+ xtype: 'checkboxgroup',
+ columns: 1,
+ labelWidth: 30,
+ hideLabel: true,
+ items: [
+ this.checkBoxMoyenneGenerale,
+ this.checkBoxCoefficient,
+ this.checkBoxMoyennesMinMax,
+ this.checkBoxMoyennesPrecedentes,
+ this.checkBoxNbNotes,
+ this.checkBoxRang,
+ ]
+ }
+ ]
+ }
+ ],
+
+ buttons: [this.buttonOk,
+ {
+ text: this.ConfigServeur.libelle.annuler,
+ handler: function() {
+ this.windowOptionsDePublication.hide();
+ },
+ scope: this
+ }]
+ });
+
+ },
/**
eliot.notes.parametrages.periodes.ToolbarView =
Ext.extend(Ext.util.Observable, {
- /**
- * Constructeur permet de construire un toolbar qui contient trois
- * boutons : "créer", "modifier" et "supprimer"
- */
- constructor: function(periodeController) {
-
- this.ns = eliot.notes.parametrages.periodes;
- this.ConfigServeur = this.ns.Modele;
- this.Constantes = this.ns.Constantes;
-
- this.addEvents(
/**
- * @event actionCreationPeriode déclenché lorsque le bouton
- * 'Créer' est cliqué
+ * Constructeur permet de construire un toolbar qui contient trois
+ * boutons : "créer", "modifier" et "supprimer"
*/
- eliot.notes.parametrages.periodes.Constantes.
- eventId.actionCreerPeriode,
+ constructor: function(periodeController) {
- /**
- * @event actionCreationSPeriode déclenché lorsque le bouton
- * 'Modifier' est cliqué
- */
- eliot.notes.parametrages.periodes.Constantes.
- eventId.actionModifierPeriode,
+ this.ns = eliot.notes.parametrages.periodes;
+ this.ConfigServeur = this.ns.Modele;
+ this.Constantes = this.ns.Constantes;
- /**
- * @event actionCreationSPeriode déclenché lorsque le bouton
- * 'Supprimer' est cliqué
- */
- eliot.notes.parametrages.periodes.Constantes.
- eventId.actionSupprimerPeriode,
+ this.addEvents(
+ /**
+ * @event actionCreationPeriode déclenché lorsque le bouton
+ * 'Créer' est cliqué
+ */
+ eliot.notes.parametrages.periodes.Constantes.
+ eventId.actionCreerPeriode,
- /**
- * @event actionPasserEnTrimestreOuSemestrePeriode déclenhé par le bouton
- * 'PasserEnTrimestreOuSemestrePeriode'
- */
- eliot.notes.parametrages.periodes.Constantes.
- eventId.actionPasserEnTrimestreOuSemestrePeriode,
+ /**
+ * @event actionCreationSPeriode déclenché lorsque le bouton
+ * 'Modifier' est cliqué
+ */
+ eliot.notes.parametrages.periodes.Constantes.
+ eventId.actionModifierPeriode,
- /**
- * Applique le pararamétrage à d'autres périodes
- * @event actionAppliqueA
- */
- this.Constantes.eventId.actionAppliqueA
+ /**
+ * @event actionCreationSPeriode déclenché lorsque le bouton
+ * 'Supprimer' est cliqué
+ */
+ eliot.notes.parametrages.periodes.Constantes.
+ eventId.actionSupprimerPeriode,
+
+ /**
+ * @event actionPasserEnTrimestreOuSemestrePeriode déclenhé par le bouton
+ * 'PasserEnTrimestreOuSemestrePeriode'
+ */
+ eliot.notes.parametrages.periodes.Constantes.
+ eventId.actionPasserEnTrimestreOuSemestrePeriode,
+
+ /**
+ * Applique le pararamétrage à d'autres périodes
+ * @event actionAppliqueA
+ */
+ this.Constantes.eventId.actionAppliqueA
);
- // Bouton "Créer"
- this.btnCreer = new Ext.Button({
- xtype: 'tbbutton',
- text: eliot.notes.Modele.libelle.creer,
- icon: eliot.notes.Modele.icon.creation,
- id: eliot.notes.parametrages.periodes.
- Constantes.composantId.idBoutonCreer,
- style:'margin-top: 3px;margin-left: 25px',
- menu: [
- {
- text: eliot.notes.parametrages.periodes.Modele.libelle.creerPeriodeExamen,
- cls: 'x-btn-icon',
+ // Bouton "Créer"
+ this.btnCreer = new Ext.Button({
+ xtype: 'tbbutton',
+ text: eliot.notes.Modele.libelle.creer,
icon: eliot.notes.Modele.icon.creation,
+ id: eliot.notes.parametrages.periodes.
+ Constantes.composantId.idBoutonCreer,
+ style:'margin-top: 3px;margin-left: 25px',
+ menu: [
+ {
+ text: eliot.notes.parametrages.periodes.Modele.libelle.creerPeriodeExamen,
+ cls: 'x-btn-icon',
+ icon: eliot.notes.Modele.icon.creation,
+ listeners: {
+ click : function() {
+ this.actionCreerPeriode();
+ },
+ scope : this
+ }
+ }
+ ],
+ disabled:true
+ });
+
+ // Bouton "Modifier"
+ this.btnModifier = new Ext.Button({
+ xtype: 'tbbutton',
+ text: eliot.notes.Modele.libelle.modifier,
+ icon: eliot.notes.Modele.icon.modification,
+ id: eliot.notes.parametrages.periodes.
+ Constantes.composantId.idBoutonMdification,
+ style:'margin-top: 3px;margin-left: 25px;',
listeners: {
click : function() {
- this.actionCreerPeriode();
+ this.actionModifierPeriode(
+ periodeController
+ );
},
scope : this
- }
- }
- ],
- disabled:true
- });
-
- // Bouton "Modifier"
- this.btnModifier = new Ext.Button({
- xtype: 'tbbutton',
- text: eliot.notes.Modele.libelle.modifier,
- icon: eliot.notes.Modele.icon.modification,
- id: eliot.notes.parametrages.periodes.
- Constantes.composantId.idBoutonMdification,
- style:'margin-top: 3px;margin-left: 25px;',
- listeners: {
- click : function() {
- this.actionModifierPeriode(
- periodeController
- );
- },
- scope : this
- },
- disabled:true
- });
-
- // Bouton "Supprimer"
- this.btnSupprimer = new Ext.Button({
- xtype: 'tbbutton',
- text : eliot.notes.Modele.libelle.supprimer,
- icon : eliot.notes.Modele.icon.suppression,
- id: eliot.notes.parametrages.periodes.
- Constantes.composantId.idBoutonSupprimer,
- style:'margin-top: 3px;margin-left: 25px;',
- listeners: {
- click : function() {
- this.actionSupprimerPeriode();
- },
- scope : this
- },
- disabled:true
- });
+ },
+ disabled:true
+ });
- // Bouton "Plus d'actions"
- this.btnPlusDActions = new Ext.Button({
- xtype: 'tbbutton',
- text : eliot.notes.Modele.libelle.plusDActions,
- id: eliot.notes.parametrages.periodes.Constantes.composantId.idBoutonPlusDActions,
- style:'margin-top: 3px;margin-left: 25px;',
- menu: [
- {
- text: eliot.notes.parametrages.periodes.Modele.libelle.PasserEnTrimestreOuSemestre,
- cls: 'x-btn-icon',
+ // Bouton "Supprimer"
+ this.btnSupprimer = new Ext.Button({
+ xtype: 'tbbutton',
+ text : eliot.notes.Modele.libelle.supprimer,
+ icon : eliot.notes.Modele.icon.suppression,
+ id: eliot.notes.parametrages.periodes.
+ Constantes.composantId.idBoutonSupprimer,
+ style:'margin-top: 3px;margin-left: 25px;',
listeners: {
click : function() {
- this.actionPasserEnTrimestreOuSemestrePeriode();
+ this.actionSupprimerPeriode();
},
scope : this
- }
- },
- {
- text: eliot.notes.parametrages.periodes.Modele.libelle.appliquerA + '...',
- cls: 'x-btn-icon',
+ },
+ disabled:true
+ });
+
+ // Bouton "Plus d'actions"
+ this.btnPlusDActions = new Ext.Button({
+ xtype: 'tbbutton',
+ text : eliot.notes.Modele.libelle.plusDActions,
+ id: eliot.notes.parametrages.periodes.Constantes.composantId.idBoutonPlusDActions,
+ style:'margin-top: 3px;margin-left: 25px;',
+ menu: [
+ {
+ text: eliot.notes.parametrages.periodes.Modele.libelle.PasserEnTrimestreOuSemestre,
+ cls: 'x-btn-icon',
+ listeners: {
+ click : function() {
+ this.actionPasserEnTrimestreOuSemestrePeriode();
+ },
+ scope : this
+ }
+ },
+ {
+ text: eliot.notes.parametrages.periodes.Modele.libelle.appliquerA + '...',
+ cls: 'x-btn-icon',
+ listeners: {
+ click : function() {
+ this.actionAppliqueA();
+ },
+ scope : this
+ }
+ }
+ ],
+ disabled:true
+ });
+
+ // Bouton "Options" -> pour les options de publication
+ this.btnOptionsDePublication = new Ext.Button({
+ xtype: 'tbbutton',
+ text : eliot.notes.Modele.libelle.btnOptionsDePublication,
+ id: eliot.notes.parametrages.periodes.Constantes.composantId.idBoutonOptionsDePublication,
+ style:'margin-top: 3px;margin-left: 25px;',
listeners: {
click : function() {
- this.actionAppliqueA();
+ this.actionAfficherOptionsDePublication();
},
scope : this
- }
- }
- ],
- disabled:true
- });
+ },
+ disabled:true
+ });
- this.toolbar = new Ext.Toolbar({
- border: true,
- autoWidth:true,
- height: 35,
- id: eliot.notes.parametrages.periodes.Constantes.
- composantId.idToolBar,
- items: [
- this.btnCreer,
- this.btnModifier,
- this.btnSupprimer,
- this.btnPlusDActions
- ]
- });
- },
+ this.toolbar = new Ext.Toolbar({
+ border: true,
+ autoWidth:true,
+ height: 35,
+ id: eliot.notes.parametrages.periodes.Constantes.
+ composantId.idToolBar,
+ items: [
+ this.btnCreer,
+ this.btnModifier,
+ this.btnSupprimer,
+ this.btnOptionsDePublication,
+ this.btnPlusDActions
+ ]
+ });
+ },
- /**
- * La méthode permet d'écouter les évènements 'periodeChange' et
- * 'periodeEnregistrer', qui sont déclenchés par periodeController,
- * ensuite il active/desactive "modifier" et "supprimer" dans toolbar
- * @param periodeController l'objet speriodeController
- */
- observerPeriodeController : function(periodeController) {
- periodeController.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
- function(periode) {
- if (periode !== undefined) {
- this.btnModifier.enable();
+ /**
+ * La méthode permet d'écouter les évènements 'periodeChange' et
+ * 'periodeEnregistrer', qui sont déclenchés par periodeController,
+ * ensuite il active/desactive "modifier" et "supprimer" dans toolbar
+ * @param periodeController l'objet speriodeController
+ */
+ observerPeriodeController : function(periodeController) {
+ periodeController.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.periodeChange,
+ function(periode) {
+ if (periode !== undefined) {
+ this.btnModifier.enable();
- if (periode.data.supprimable === true) {
- this.btnSupprimer.enable();
- }
- else {
- this.btnSupprimer.disable();
- }
- }
- else {
- this.btnModifier.disable();
- this.btnSupprimer.disable();
- }
- },
- this
+ if (periode.data.supprimable === true) {
+ this.btnSupprimer.enable();
+ }
+ else {
+ this.btnSupprimer.disable();
+ }
+ }
+ else {
+ this.btnModifier.disable();
+ this.btnSupprimer.disable();
+ }
+ },
+ this
)
- },
+ },
- /**
- * La méthode permet d'écouter les évènements 'classeChange' qui est déclenché par classeController,
- * ensuite il active/desactive "créer" dans toolbar
- * @param classeController l'objet classeController
- */
- observerClasseController : function(classeController) {
- classeController.addListener(
- eliot.notes.parametrages.periodes.Constantes.eventId.classeChange,
- function(idClasse) {
- if (idClasse != null) {
- this.btnCreer.enable();
- this.btnPlusDActions.enable();
- }
- },
- this
+ /**
+ * La méthode permet d'écouter les évènements 'classeChange' qui est déclenché par classeController,
+ * ensuite il active/desactive "créer" dans toolbar
+ * @param classeController l'objet classeController
+ */
+ observerClasseController : function(classeController) {
+ classeController.addListener(
+ eliot.notes.parametrages.periodes.Constantes.eventId.classeChange,
+ function(idClasse) {
+ if (idClasse != null) {
+ this.btnCreer.enable();
+ this.btnPlusDActions.enable();
+ this.btnOptionsDePublication.enable();
+ }
+ },
+ this
)
- },
+ },
- /**
- * La méthode permet de déclencher un évènement 'actionCreationSPeriode'
- */
- actionCreerPeriode: function() {
- this.fireEvent(
- eliot.notes.parametrages.periodes.
- Constantes.eventId.actionCreerPeriode
+ /**
+ * La méthode permet de déclencher un évènement 'actionCreationSPeriode'
+ */
+ actionCreerPeriode: function() {
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.
+ Constantes.eventId.actionCreerPeriode
);
- },
+ },
- /**
- * La méthode permet de déclencher un évènement 'actionCreationPeriode'
- * @param periodeController l'objet du periodeController
- */
- actionModifierPeriode: function(periodeController) {
- this.fireEvent(
- eliot.notes.parametrages.periodes.
- Constantes.eventId.actionModifierPeriode,
- periodeController.periodeSelectionne
+ /**
+ * La méthode permet de déclencher un évènement 'actionCreationPeriode'
+ * @param periodeController l'objet du periodeController
+ */
+ actionModifierPeriode: function(periodeController) {
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.
+ Constantes.eventId.actionModifierPeriode,
+ periodeController.periodeSelectionne
);
- },
+ },
- /**
- * La méthode permet de déclencher un évènement 'actionCreationPeriode'
- */
- actionSupprimerPeriode: function() {
- this.fireEvent(
- eliot.notes.parametrages.periodes.
- Constantes.eventId.actionSupprimerPeriode
+ /**
+ * La méthode permet de déclencher un évènement 'actionCreationPeriode'
+ */
+ actionSupprimerPeriode: function() {
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.
+ Constantes.eventId.actionSupprimerPeriode
);
- },
+ },
- /**
- * Déclenchement de l'action 'actionPasserEnTrimestreOuSemestrePeriode'
- */
- actionPasserEnTrimestreOuSemestrePeriode: function() {
- this.fireEvent(
- eliot.notes.parametrages.periodes.
- Constantes.eventId.actionPasserEnTrimestreOuSemestrePeriode
+ /**
+ * Déclenchement de l'action 'actionPasserEnTrimestreOuSemestrePeriode'
+ */
+ actionPasserEnTrimestreOuSemestrePeriode: function() {
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.
+ Constantes.eventId.actionPasserEnTrimestreOuSemestrePeriode
);
- },
+ },
- /**
- * Appliquer à
- */
- actionAppliqueA: function() {
- this.fireEvent(
- eliot.notes.parametrages.periodes.
- Constantes.eventId.actionAppliqueA
+ /**
+ * Appliquer à
+ */
+ actionAppliqueA: function() {
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.
+ Constantes.eventId.actionAppliqueA
);
- }
+ },
+
+ actionAfficherOptionsDePublication: function(){
+ this.fireEvent(
+ eliot.notes.parametrages.periodes.
+ Constantes.eventId.actionAfficherOptionsDePublication
+ )
+ }
- }
+ }
-);
\ No newline at end of file
+ );
\ No newline at end of file
border: false,
frame: false,
autoScroll: true,
- items: this.bulletin.items,
+ items: this.bulletin.getItems(),
listeners: {
activate: function() {
this.fireEvent(this.Constantes.eventId.ouvreOngletBulletin);
reponse.verrouille,
reponse.actif);
- this.afficheBulletin(
- reponse.moyennesServices,
- reponse.recapitulatifs,
- reponse.publie,
- reponse.messagePublication);
+ this.afficheBulletin({
+ moyennesServices: reponse.moyennesServices,
+ recapitulatifs: reponse.recapitulatifs,
+ publie: reponse.publie,
+ messagePublication: reponse.messagePublication,
+ optionsPublication: reponse.optionsPublication,
+ periodesPrecedentes: reponse.periodesPrecedentes
+ });
this.afficheGraph(reponse.data, reponse.periodesPrecedentesExistent, reponse.graphPeriodes);
rechargeBulletinRecap: function() {
if (this.bloqueRechargement === false) {
+ var classe = this.classeModel.getClasse();
var eleve = this.eleveModel.getEleve();
var periode = this.periodeModel.getPeriode();
eliot.commun.AjaxHelper.request({
url: this.ConfigServeur.url.bulletinDeNotes,
params: {
+ classeId: classe.get('id'),
eleveId: eleve.get('eleveId'),
- periodeId: periode.get('idPeriode')
+ periodeId: periode.get('idPeriode')
},
success: function(reponse) {
reponse.verrouille,
reponse.actif);
- this.afficheBulletin(
- reponse.moyennesServices,
- reponse.recapitulatifs,
- reponse.publie,
- reponse.messagePublication);
+ this.afficheBulletin({
+ moyennesServices: reponse.moyennesServices,
+ recapitulatifs: reponse.recapitulatifs,
+ publie: reponse.publie,
+ messagePublication: reponse.messagePublication,
+ optionsPublication: reponse.optionsPublication,
+ periodesPrecedentes: reponse.periodesPrecedentes
+ });
this.afficheGraph(reponse.data, reponse.periodesPrecedentesExistent, reponse.graphPeriodes);
/**
* Affiche le bulletin
*/
- afficheBulletin: function(moyennesServices, recapitulatifs, publie, messagePublication) {
+ afficheBulletin: function(config) {
this.bulletin.actualiseReferences({
classe: this.classeModel.getClasse(),
periode: this.periodeModel.getPeriode()
});
- this.bulletin.afficheBulletin(moyennesServices, recapitulatifs, publie, messagePublication);
+ this.bulletin.afficheBulletin(config);
this.bulletinRecapDirty = false;
},
var couleurs = [0xFFE400, 0xFF7800, 0x93000B, 0x980086];
- for(var i = 0; i < periodes.length; i++) {
- var periode = periodes[i];
-
- var yField = {
- name: periode.code,
- type: 'line',
- libelle: (periode.libelle != null) ?
- periode.libelle : this.ConfigServeur.libelle.moyenneEleve,
- style: {
- color: couleurs[i]
- },
- round: eliot.notes.commun.Utils.noteRound
- };
+ if (periodes != null) {
+ for(var i = 0; i < periodes.length; i++) {
+ var periode = periodes[i];
+
+ var yField = {
+ name: periode.code,
+ type: 'line',
+ libelle: (periode.libelle != null) ?
+ periode.libelle : this.ConfigServeur.libelle.moyenneEleve,
+ style: {
+ color: couleurs[i]
+ },
+ round: eliot.notes.commun.Utils.noteRound
+ };
- yFields.push(yField);
+ yFields.push(yField);
+ }
}
// Graph
DonneesOptions donneesOptions = new DonneesOptions(
data: data,
- options: impressionBulletinOptionsService.getParametreOptions(
+ options: impressionBulletinOptionsService.getParametreOptionsByTemplate(
templateDocument,
typePeriode)
)
import org.lilie.services.eliot.impression.TemplateJasper
import org.lilie.services.eliot.impression.TemplateChampMemo
import org.lilie.services.eliot.impression.TemplateDocumentSousTemplateEliot
-import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.notes.BulletinOptions
import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
import org.lilie.services.eliot.impression.template.fonte.PoliceEnum
import org.lilie.services.eliot.scolarite.TypePeriode
TypePeriode typePeriode = TypePeriode.findByIntervalle(IntervalleEnum.T3)
BulletinOptionsPersonnalise bulletinOptionsPersonnalise =
- impressionBulletinOptionsService.getParametreOptions(templateDocument, typePeriode)
+ impressionBulletinOptionsService.getParametreOptionsByTemplate(templateDocument, typePeriode)
ZoneTemplateJasperInfo zone = new ZoneTemplateJasperInfo(
x: subreport.x,
import net.sf.jasperreports.engine.fill.JRTemplatePrintText
import org.lilie.services.eliot.impression.ImpressionMoteurService
import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.BulletinOptions
+import org.lilie.services.eliot.notes.BulletinOptions
import org.lilie.services.eliot.scolarite.impression.ImpressionImportResourcesService
class ImpressionBulletinTemplateServiceTests extends GroovyTestCase {
Map resultat = [:]
- BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptions(
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptionsByTemplate(
templateDocument,
typePeriode
)
List<String> resultat = []
- BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptions(
+ BulletinOptionsPersonnalise bulletinOptionsPersonnalise = impressionBulletinOptionsService.getParametreOptionsByTemplate(
templateDocument,
typePeriode
)
<textField>
<reportElement style="table_TD" x="0" y="0" width="27" height="10"/>
<textElement/>
- <textFieldExpression class="java.lang.Integer"><![CDATA[$F{nbNotes}]]></textFieldExpression>
+ <textFieldExpression class="java.lang.String"><![CDATA[$F{nbNotes} != null ? $F{nbNotes}.toString() : ""]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>