impression {
+ // la valeur de seuil à partir de laquelle une impression publipostage passe en différé
+ seuil = 1
+
logo {
// taille max du logo
tailleMaxEnKo = 100
* <http://www.cecill.info/licences.fr.html>.
*/
-package org.lilie.services.eliot.absences.impression.publipostage
+package org.lilie.services.eliot.impression.publipostage
+import org.codehaus.groovy.grails.web.json.JSONObject
+import org.lilie.services.eliot.demon.DemandeTraitement
+import org.lilie.services.eliot.demon.DemandeTraitementStatut
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.securite.Autorite
import org.lilie.services.eliot.impression.constantes.TypeMedia
+import java.text.SimpleDateFormat
+
/**
- * Traitement des demande de publipostage différés. Pour le courrier et pour les
- * sms
+ * Traitement des demande de publipostage différés. Pour le courrier et pour les sms
* @author othe
*/
-class PublipostageDiffereService {
+class AbsencesPublipostageDiffereService {
LocalStructureEnseignementService localStructureEnseignementService
DemandeTraitementService demandeTraitementService
/**
* Création d'une demande différée pour le publipostage courrier ou sms
*/
- public void creeDemandeDifferee(Autorite demandeur, Etablissement etablissement, def params) {
+ void creeDemandeDifferee(Autorite demandeur, Etablissement etablissement, def params) {
if (!params.mediaId) {
throw new IllegalArgumentException("Le type de média 'mediaId' est manquant.")
}
}
+
/**
* Méthode permet de construire un nom de traitement, il est composé par
* nom de modèle et nom de classe sélectionné
*/
private String construitNomDeTraitement(Map params) {
- String modeleId =
- params.modeleId
+ String modeleId = params.modeleId
- def listeEleves = params.elevesSelectionnes
+ List elevesSelectionnes =
+ (params.elevesSelectionnes instanceof String) ?
+ [params.elevesSelectionnes] : params.elevesSelectionnes
- List<String> listElevesId
+ List<Long> eleveIds = elevesSelectionnes.collect {it.split(':')[0].toLong()}
- if (listeEleves instanceof String) {
- listElevesId = [params.elevesSelectionnes]
- } else {
- listElevesId =
- params.elevesSelectionnes
- }
+ List<Personne> listEleves = Personne.findAllByIdInList(eleveIds)
- List<Personne> listEleves = []
+ List<StructureEnseignement> classes =
+ localStructureEnseignementService.findAllClassesForAllEleves(listEleves)
- listElevesId.each {
- List<String> ids = it.split(':')
- Personne eleve = Personne.get(Long.parseLong(ids[0]))
- if (!listEleves.contains(eleve)) {
- listEleves << eleve
- }
- }
+ String modeleLibelle = TemplateDocument.findById(modeleId.toLong()).nom
- List<StructureEnseignement> listClasses =
- localStructureEnseignementService.findAllClassesForAllEleves(listEleves)
+ String classesCode = classes*.code.join(',')
+
+ String nom = "$modeleLibelle - $classesCode"
- Set<StructureEnseignement> listClassesPropre = listClasses as Set
+ if (nom.size() > 128) {
+ nom = nom.substring(0, 124) + '...'
+ }
- String modeleLibelle =
- TemplateDocument.findById(Long.parseLong(modeleId)).nom
+ return nom
+ }
- String classesCode = ''
- listClassesPropre.each {
- classesCode += it.code
- if (it != listClassesPropre.toArray()[listClassesPropre.size() - 1]) {
- classesCode += ','
+ List<DemandeTraitementStatut> parseCriteriaStatut(String listeStatut) {
+ List<DemandeTraitementStatut> result = []
+ if (listeStatut.contains("-1")) {
+ DemandeTraitementStatut.each {
+ if (it != DemandeTraitementStatut.ANNULEE) {
+ result << it
+ }
+ }
+ } else {
+ listeStatut.split(',').collect {
+ result << DemandeTraitementStatut.parseByCode(Integer.parseInt(it))
}
}
+ return result
+ }
- // Construire le nom de traitement
- String nom = modeleLibelle + ' - ' + classesCode
- if (nom.size() > 128) {
- nom = nom.substring(0, 124) + '...'
+ Long getIdModeleForDemandeTraitementId(Long demandeId) {
+ DemandeTraitement dt = demandeTraitementService.getDemandeTraitement(demandeId)
+ Map params = new JSONObject(dt.getTraitementArgs())
+ Object obj = params.modeleId
+ switch (obj.class) {
+ case String: return Long.parseLong(params.modeleId)
+ case Long: return (Long) obj
+ case Integer: return (Integer) obj
+ default:
+ throw new IllegalStateException("getIdModeleForDemandeTraitementId erreur de type")
}
+ }
- return nom
+
+ String getNomSupport(Long idDemande) {
+ Long idModel = getIdModeleForDemandeTraitementId(idDemande)
+ TemplateDocument modele = TemplateDocument.get(idModel)
+ TypeMedia support = TypeMedia.typeMediaForCode(modele.media)
+ return support.libelle
+ }
+
+
+ String getDateFinTraitement(DemandeTraitementStatut statut, Date dateFin) {
+ SimpleDateFormat sdfAffichage = new SimpleDateFormat("dd/MM/yyyy HH:mm", Locale.FRANCE)
+ if (dateFin && statut == DemandeTraitementStatut.TERMINEE) {
+ return sdfAffichage.format(dateFin)
+ }
+ return ""
}
* <http://www.cecill.info/licences.fr.html>.
*/
-package org.lilie.services.eliot.absences.impression.publipostage
+package org.lilie.services.eliot.impression.publipostage
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
-import org.lilie.services.eliot.absences.publipostage.selection.PublipostageCommand
import org.lilie.services.eliot.impression.requetage.ImpressionRequetageAbsencesService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.impression.publipostage.PublipostageParametresService
import org.lilie.services.eliot.impression.ImpressionSuiviEleveService
import org.lilie.services.eliot.impression.moteur.ImpressionMoteurService
import org.lilie.services.eliot.impression.requetage.ImpressionSelectionRequeteService
* Création du document courrier pour l'impression directe du publipostage
* @author othe
*/
-class PublipostageDirectService {
+class AbsencesPublipostageDirectService {
ImpressionTemplateDocumentService impressionTemplateDocumentService
ImpressionRequetageAbsencesService impressionRequetageAbsencesService
public ByteArrayOutputStream publipostageDirect(SecuriteSession securiteSession,
Etablissement etablissement,
Personne demandeur,
- PublipostageCommand publipostageCommand,
+ AbsencesPublipostageParams publipostageCommand,
Map params) {
+
TemplateDocument templateDocument = impressionTemplateDocumentService.
findTemplateDocument(
publipostageCommand.modeleId
)
- List<EleveImpressionInfo> donneesEleve =(List<EleveImpressionInfo>)impressionRequetageAbsencesService.
+ List<EleveImpressionInfo> donneesEleve = (List<EleveImpressionInfo>)impressionRequetageAbsencesService.
lectureDonneesEleve(
publipostageCommand,
impressionSelectionRequeteService.findAllSelectionRequete(templateDocument),
templateDocument,
donneesEleve
)
-
-
}
}
* Présente les paramètres nécessaires pour une action de publipostage
* @author bahj , othe
*/
-class PublipostageAbsencesParams {
+class AbsencesPublipostageParams {
Long modeleId = 0
String dateDebut = ""
--- /dev/null
+package org.lilie.services.eliot.impression.publipostage
+
+import org.lilie.services.eliot.impression.ImpressionInfoGenerale
+import org.lilie.services.eliot.impression.ImpressionRequetageService
+import org.lilie.services.eliot.impression.constantes.TypeMedia
+import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+
+abstract class PublipostageService {
+
+ static transactional = true
+
+ ImpressionRequetageService impressionRequetageService
+ LocalStructureEnseignementService localStructureEnseignementService
+
+
+ protected List<EleveImpressionInfo> getEleveImpressionInfos(Etablissement etablissement,
+ Set<Personne> eleves,
+ SelectionAdresseResponsableEnum selectionAdresseResponsableEnum,
+ TypeMedia typeMedia) {
+
+ ImpressionInfoGenerale impressionInfoGenerale = new ImpressionInfoGenerale(
+ allEleves: eleves.toList(),
+ adresseResponsableEnum: selectionAdresseResponsableEnum,
+ etablissement: etablissement
+ )
+
+ List<EleveImpressionInfo> eleveImpressionInfos =
+ impressionRequetageService.findAllInfoGeneralesEleve(
+ impressionInfoGenerale,
+ null,
+ EleveImpressionInfo,
+ typeMedia
+ )
+
+ impressionRequetageService.triEleves(eleveImpressionInfos)
+
+ return eleveImpressionInfos
+ }
+
+
+ /**
+ * Met en forme le résultat
+ * @param eleves : la liste des élèves à inclure dans le résultat
+ * @param selectionAdresseResponsableEnum : la selection des résultats dépend du type de responsable choisit
+ * @return une liste de maps
+ */
+ protected List metEnFormeResultat(List<EleveImpressionInfo> eleves,
+ SelectionAdresseResponsableEnum selectionAdresseResponsableEnum) {
+ List result = []
+
+ eleves.each {
+ EleveImpressionInfo eleveImpressionInfo ->
+
+ // validité adresse ou portable
+ boolean selection = eleveImpressionInfo.getSelection(selectionAdresseResponsableEnum)
+
+ String portable = eleveImpressionInfo?.responsable?.getTelephonePortable()
+
+ result << [
+ id: eleveImpressionInfo.personneId + ":" + eleveImpressionInfo.selectionAdresseResponsable.toString(),
+ nomPrenom: eleveImpressionInfo.personne.nomAffichage(),
+ classe: eleveImpressionInfo.eleve_Classe,
+ selection: selection,
+ valide: eleveImpressionInfo.valide(),
+ responsableNum: (eleveImpressionInfo.selectionAdresseResponsable == SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1) ? 1 : 2,
+ responsable: (eleveImpressionInfo.parent_Nom ? eleveImpressionInfo.parent_Nom : '') +
+ ' ' +
+ (eleveImpressionInfo.parent_Prenom ? eleveImpressionInfo.parent_Prenom : ''),
+ adresse: eleveImpressionInfo.parent_Adresse ? eleveImpressionInfo.parent_Adresse : '',
+ cpVille:
+ (eleveImpressionInfo.parent_CodePostal ? eleveImpressionInfo.parent_CodePostal : '') +
+ ' ' +
+ (eleveImpressionInfo.parent_Ville ? eleveImpressionInfo.parent_Ville : ''),
+ portable: portable ? portable : ""
+ ]
+ }
+
+ result.sort {
+ it.nomPrenom
+ }
+
+ return result
+ }
+}
import org.lilie.services.eliot.scolarite.*
import org.lilie.services.eliot.impression.ImpressionRequetageService
import org.lilie.services.eliot.LocalAutoriteService
-import org.lilie.services.eliot.impression.publipostage.PublipostageAbsencesParams
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageParams
import org.codehaus.groovy.grails.web.json.JSONObject
import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
* pas dans un contrôleur car en fait on va faire appel à cette méthode
* dans les jobs.
*/
- public PublipostageAbsencesParams construitSelectionCommand(String argsJSON) {
+ public AbsencesPublipostageParams construitSelectionCommand(String argsJSON) {
Map params = new JSONObject(argsJSON)
String elevesSelectionnes = params.elevesSelectionnes
elevesSelectionnes = elevesSelectionnes.replace('"', '')
List eleveId = elevesSelectionnes.split(',')
- PublipostageAbsencesParams parametresSelectionPublipostage =
- new PublipostageAbsencesParams(
+ AbsencesPublipostageParams parametresSelectionPublipostage =
+ new AbsencesPublipostageParams(
modeleId: params.modeleId ? Long.parseLong(params.modeleId) : 0,
dateDebut: params.dateDebut,
dateFin: params.dateFin,
return absencesImpression
}
- public PublipostageCriteresRecherche parseCriteriaRetards(PublipostageAbsencesParams parametresSelectionPublipostage) {
+ public PublipostageCriteresRecherche parseCriteriaRetards(AbsencesPublipostageParams parametresSelectionPublipostage) {
PublipostageCriteresRecherche result = ParseCriteriaHelper.parseCriteriaCommuns(parametresSelectionPublipostage)
result.setTousTypes(false)
result.retards = true
return result
}
- public PublipostageCriteresRecherche parseCriteriaAbsences(PublipostageAbsencesParams parametresSelectionPublipostage) {
+ public PublipostageCriteresRecherche parseCriteriaAbsences(AbsencesPublipostageParams parametresSelectionPublipostage) {
PublipostageCriteresRecherche result = ParseCriteriaHelper.parseCriteriaCommuns(parametresSelectionPublipostage)
result.demiPension = false
result.internat = false
* Lecture des données au moment du publipostage
*/
public List<EleveImpressionInfo> lectureDonneesEleve(
- PublipostageAbsencesParams parametresSelectionPublipostage,
+ AbsencesPublipostageParams parametresSelectionPublipostage,
ImpressionRequetageSelection requetageSelection,
SecuriteSession securiteSession,
Etablissement etablissement
return eleveImpressionInfos
}
- private PublipostageCriteresRecherche createCritereRetards(PublipostageAbsencesParams parametresSelectionPublipostage, Etablissement etablissement, SelectionAdresseResponsableEnum typeResponsable) {
+ private PublipostageCriteresRecherche createCritereRetards(AbsencesPublipostageParams parametresSelectionPublipostage, Etablissement etablissement, SelectionAdresseResponsableEnum typeResponsable) {
PublipostageCriteresRecherche criteresRetards = parseCriteriaRetards(
parametresSelectionPublipostage
criteresRetards
}
- private void prepareCriteres(Etablissement etablissement, PublipostageCriteresRecherche criteres, PublipostageAbsencesParams parametresSelectionPublipostage, SelectionAdresseResponsableEnum typeResponsable) {
+ private void prepareCriteres(Etablissement etablissement, PublipostageCriteresRecherche criteres, AbsencesPublipostageParams parametresSelectionPublipostage, SelectionAdresseResponsableEnum typeResponsable) {
criteres.etablissementId = etablissement.id
criteres.eleveIds =
package org.lilie.services.eliot.impression.requetage
-import org.lilie.services.eliot.impression.publipostage.PublipostageAbsencesParams
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageParams
import org.lilie.services.eliot.applications.absences.BasicCriteresRecherche
import org.lilie.services.eliot.temps.DateUtil
import org.lilie.services.eliot.absences.Motif
private final static int INTERNAT = 7
- public static PublipostageCriteresRecherche parseCriteriaCommuns(PublipostageAbsencesParams parametresSelectionPublipostage) {
+ public static PublipostageCriteresRecherche parseCriteriaCommuns(AbsencesPublipostageParams parametresSelectionPublipostage) {
PublipostageCriteresRecherche result = new PublipostageCriteresRecherche()
* @return un BilanCriteria complété avec les dates
* @author jbui
*/
- private static void parseBilanCriteriaDates(PublipostageAbsencesParams parametresSelectionPublipostage,
- BasicCriteresRecherche criteria) {
+ private static void parseBilanCriteriaDates(AbsencesPublipostageParams parametresSelectionPublipostage,
+ BasicCriteresRecherche criteria) {
+
String dateDebut = parametresSelectionPublipostage.dateDebut
String dateFin = parametresSelectionPublipostage.dateFin
- criteria.dateDebut.setTime(
- DateUtil.parseDateJavascript(dateDebut)
- )
-
- criteria.dateFin.setTime(
- DateUtil.parseDateJavascript(dateFin)
- )
+ if (dateDebut) {
+ criteria.dateDebut.setTime(DateUtil.parseDateJavascript(dateDebut))
+ }
- DateUtil.setFinJour(criteria.dateFin)
+ if (dateFin) {
+ criteria.dateFin.setTime(DateUtil.parseDateJavascript(dateFin))
+ DateUtil.setFinJour(criteria.dateFin)
+ }
}
-/**
- * Récupère les motifs associés aux groupes de motifs
- * @param params : les paramètres de la requête
- * @param bilanCriteria : le BilanCriteria à compléter
- * @author jbui
- */
+ /**
+ * Récupère les motifs associés aux groupes de motifs
+ * @param params : les paramètres de la requête
+ * @param bilanCriteria : le BilanCriteria à compléter
+ * @author jbui
+ */
private static void parseCriteriaGroupeMotifs(def listeGroupeMotifs,
BasicCriteresRecherche bilanCriteria) {
List<Long> groupeMotifs
package org.lilie.services.eliot.impression.template
+import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.impression.constantes.TypeMedia
return reponse
}
+
+ List<TemplateDocument> findAllTemplateDocByEtabtAndTemplateEliotEnums(Etablissement etablissement,
+ List<TemplateEliotEnum> templateEliots) {
+
+ List<TemplateDocument> list = TemplateDocument.withCriteria {
+ eq('etablissement', etablissement)
+ templateEliot {
+ 'in'('code', templateEliots*.toString())
+ }
+ }
+
+ return list
+ }
}
NOTIFICATION_PREFERNCE_UTILISATEUR(false),
SCOL_MAGISTER(false),
SCOL_LVS(false),
- ETABLISSEMENT(false)
+ ETABLISSEMENT(false),
+ SCOL_PUBLIPOSTAGE(true)
private ScolariteFonctionnalites() {}
classes << value
}
+ classes.unique()
+
return classes
}
ScolariteFonctionnalites.PARAMETRAGE_NOTIFICATION,
ScolariteFonctionnalites.PARAMETRAGE_ACCES_FONCTIONS,
ScolariteFonctionnalites.SCOL_MAGISTER,
- ScolariteFonctionnalites.ETABLISSEMENT
+ ScolariteFonctionnalites.ETABLISSEMENT,
+ ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE
],
(FonctionEnum.ENSEIGNANT): (Set) [
return map
}
-
/* cas particulier de la consultation d'absences.
* La fonctionnalité paramétrable est ABS_CONSULT mais pour que le droit d'accès
* soit accepté par le module Absences, il faut préciser de quelle type de consultation
* on parle. Quand on autorise une fonction paramétrable à accéder à la consultation
* d'absences, il faut lui donner l'accès à la fonctionnalité ABS_CONSULT_DIR
*/
+
private void gereDroitAccesConsultationAbsence(Set<FonctionEnum> fonctionEnums,
- Set<EliotFonctionnalites> eliotFonctionnalites) {
+ Set<EliotFonctionnalites> eliotFonctionnalites) {
- for (FonctionEnum fonctionEnum in fonctionEnums){
+ for (FonctionEnum fonctionEnum in fonctionEnums) {
if (fonctionEnum.accesParametrable) {
if (eliotFonctionnalites.find {it.code == AbsencesFonctionnalite.ABS_CONSULT.code} &&
- !eliotFonctionnalites.find {it.code == AbsencesFonctionnalite.ABS_CONSULT_DIR.code ||
- it.code == AbsencesFonctionnalite.ABS_CONSULT_ELEVE.code ||
- it.code == AbsencesFonctionnalite.ABS_CONSULT_ENSEIGNANT.code ||
- it.code == AbsencesFonctionnalite.ABS_CONSULT_MULTICRITERE.code ||
- it.code == AbsencesFonctionnalite.ABS_CONSULT_PARENT.code}) {
+ !eliotFonctionnalites.find {
+ it.code == AbsencesFonctionnalite.ABS_CONSULT_DIR.code ||
+ it.code == AbsencesFonctionnalite.ABS_CONSULT_ELEVE.code ||
+ it.code == AbsencesFonctionnalite.ABS_CONSULT_ENSEIGNANT.code ||
+ it.code == AbsencesFonctionnalite.ABS_CONSULT_MULTICRITERE.code ||
+ it.code == AbsencesFonctionnalite.ABS_CONSULT_PARENT.code
+ }) {
eliotFonctionnalites.add(AbsencesFonctionnalite.ABS_CONSULT_DIR)
break
}
Boolean sortAsc
Long start
Long limit
+
+ String filtreSql
}
requeteFiltre += " and etablissement_id = ? "
paramsFiltre << params.etablissementId.toLong()
}
+
if (params.filtreStatut) {
String statuts = params.filtreStatut.collect {"'${it?.name()}'"}.toString().replace('[', '(').replace(']', ')')
requeteFiltre += " and statut IN $statuts "
}
+
if (params.filtreType) {
String types = params.filtreType.collect {"'${it?.name()}'"}.toString().replace('[', '(').replace(']', ')')
requeteFiltre += " and traitement_type IN $types "
}
+ if (params.filtreSql) {
+ requeteFiltre += params.filtreSql
+ }
result.requeteFiltre = requeteFiltre
result.paramsFiltre = paramsFiltre
--- /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="bper">
+ <comment>
+ Ajout de la fonctionnalité 'SCOL_PUBLIPOSTAGE'. Les accès à cette fonctionnalité sont copiés de la fonctionnalité 'SCOL_PARAM_MODELES_DOC'
+ </comment>
+
+ <sql>
+ INSERT INTO securite.fonctionnalite (
+ id,
+ code,
+ parent_id,
+ parametrable,
+ ordre,
+ groupe
+ )
+ VALUES (
+ nextVal('securite.fonctionnalite_id_seq'),
+ 'SCOL_PUBLIPOSTAGE',
+ (SELECT id FROM securite.fonctionnalite WHERE code = 'SCOL'),
+ true,
+ 2,
+ false
+ );
+
+
+ INSERT INTO securite.acces_fonctionnalite_fonction_defaut (id, fonctionnalite_id, fonction_id, actif)
+ SELECT
+ nextval('securite.acces_fonctionnalite_fonction_defaut_id_seq'),
+ (SELECT id FROM securite.fonctionnalite WHERE code = 'SCOL_PUBLIPOSTAGE'),
+ fonction_id,
+ actif
+ FROM securite.acces_fonctionnalite_fonction_defaut
+ INNER JOIN securite.fonctionnalite AS f ON fonctionnalite_id = f.id
+ WHERE f.code = 'SCOL_PARAM_MODELES_DOC';
+
+
+ INSERT INTO securite.acces_fonctionnalite_fonction (id, etablissement_id, fonctionnalite_id, fonction_id, actif)
+ SELECT
+ nextval('securite.acces_fonctionnalite_fonction_id_seq'),
+ etablissement_id,
+ (SELECT id FROM securite.fonctionnalite WHERE code = 'SCOL_PUBLIPOSTAGE'),
+ fonction_id,
+ actif
+ FROM securite.acces_fonctionnalite_fonction
+ INNER JOIN securite.fonctionnalite AS f ON fonctionnalite_id = f.id
+ WHERE f.code = 'SCOL_PARAM_MODELES_DOC';
+
+
+ INSERT INTO securite.acces_fonctionnalite_personne (id, etablissement_id, fonctionnalite_id, personne_id)
+ SELECT
+ nextval('securite.acces_fonctionnalite_personne_id_seq'),
+ etablissement_id,
+ (SELECT id FROM securite.fonctionnalite WHERE code = 'SCOL_PUBLIPOSTAGE'),
+ personne_id
+ FROM securite.acces_fonctionnalite_personne
+ INNER JOIN securite.fonctionnalite AS f ON fonctionnalite_id = f.id
+ WHERE f.code = 'SCOL_PARAM_MODELES_DOC';
+
+ </sql>
+
+ </changeSet>
+
+</databaseChangeLog>
<include file="changelogs/scolarite/2014-10-20-0039940.xml"/>
<include file="changelogs/scolarite/2014-10-21-0039942.xml"/>
<include file="changelogs/scolarite/2014-10-24-0039348.xml"/>
-
+ <include file="changelogs/scolarite/2014-11-03-0039341.xml"/>
+
</databaseChangeLog>
package org.lilie.services.eliot.absences.publipostage.selection
-import org.lilie.services.eliot.impression.publipostage.PublipostageAbsencesParams
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageParams
/**
* La classe SelectionCommand est exactement la même que
* réservés pour faire interface entre la vue et le contrôleur.
* @author : othe
*/
-class PublipostageCommand extends PublipostageAbsencesParams {
+class AbsencesPublipostageCommand extends AbsencesPublipostageParams {
}
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.impression.requetage.PublipostageCriteresRecherche
import org.lilie.services.eliot.absences.consultation.AbstractConsultationController
-import org.lilie.services.eliot.absences.consultation.PublipostageAbsencesService
+import org.lilie.services.eliot.absences.consultation.AbsencesPublipostageService
import org.lilie.services.eliot.applications.absences.BasicCriteresRecherche
import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
import org.lilie.services.eliot.urllabel.UrlLabelInfo
import org.lilie.services.eliot.impression.constantes.TypeMedia
-import org.lilie.services.eliot.absences.impression.publipostage.PublipostageDirectService
-import org.lilie.services.eliot.absences.impression.publipostage.PublipostageDiffereService
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageDirectService
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageDiffereService
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.absences.AbsencesFonctionnalite
import org.lilie.services.eliot.absences.Motif
CalendrierService calendrierService
LocalStructureEnseignementService localStructureEnseignementService
- PublipostageAbsencesService publipostageAbsencesService
+ AbsencesPublipostageService absencesPublipostageService
ImpressionTemplateDocumentService impressionTemplateDocumentService
- PublipostageDirectService publipostageDirectService
- PublipostageDiffereService publipostageDiffereService
+ AbsencesPublipostageDirectService absencesPublipostageDirectService
+ AbsencesPublipostageDiffereService absencesPublipostageDiffereService
AbsencesSelonCriteresService absencesSelonCriteresService
def index = {
private List getListeStructures() {
List<StructureEnseignement> classes = localStructureEnseignementService.
- findAllClasseByEtablissement(etablissementCourant(), "code")
+ findAllClasseByEtablissement(etablissementCourant())
CodeComparator comparateurLogique = CodeComparator.create()
// Trie logique
Boolean filtrerDejaEnvoye = Boolean.valueOf(mapParams.filtrerDejaEnvoye)
- List<Map> datas = publipostageAbsencesService.getListAbsences(
+ List<Map> datas = absencesPublipostageService.getListAbsences(
getSecuriteSession(),
getPreferencesEtablissementCourant(),
criteria,
filtrerDejaEnvoye
)
- render([
- data: datas,
- success: true
- ] as JSON)
+ render([data: datas, success: true] as JSON)
}
private PublipostageCriteresRecherche parseCriteriaAbsences(Map params) {
Boolean filtrerDejaEnvoye = Boolean.valueOf(mapParams.filtrerDejaEnvoye)
- List<Map> datas = publipostageAbsencesService.getListRetards(
+ List<Map> datas = absencesPublipostageService.getListRetards(
getSecuriteSession(),
this.preferencesEtablissementCourant,
criteria,
}
}
-/**
- * Permet une impression directe
- */
- def publiposteDirecte = {PublipostageCommand publipostageCommand ->
+ /**
+ * Permet une impression directe
+ */
+ def publiposteDirecte = {AbsencesPublipostageCommand publipostageCommand ->
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_PUBLIPOSTAGE)
// on envoie la réponse en PDF
sendPdfFile(
response,
- publipostageDirectService.publipostageDirect(getSecuriteSession(),
+ absencesPublipostageDirectService.publipostageDirect(
+ getSecuriteSession(),
etablissementCourant(),
(Personne) (session.personne),
publipostageCommand,
params
-
),
templateDocument.nom
)
}
-/**
- * Permet une impression différée
- * Ne gère pas les params. Ne fait que les passer comme demande de traitement,
- * car cette action n'a pas besoin de connaitre les paramètres envoyés à
- * l'utilisateur. C'est pourquoi la classe PublipostageCommand n'est pas
- * utilisée.
- */
+ /**
+ * Permet une impression différée
+ * Ne gère pas les params. Ne fait que les passer comme demande de traitement,
+ * car cette action n'a pas besoin de connaitre les paramètres envoyés à
+ * l'utilisateur. C'est pourquoi la classe PublipostageCommand n'est pas
+ * utilisée.
+ */
@SuppressWarnings('CatchException')
def publiposteDiffere = {
Map resultats
try {
- publipostageDiffereService.creeDemandeDifferee(
+ absencesPublipostageDiffereService.creeDemandeDifferee(
securiteSession.defaultAutorite,
etablissementCourant(),
params
return result
}
-/**
- * Récupère les paramètres de dates
- * @param params : les paramètres de la requêtes
- * @return un BilanCriteria complété avec les dates
- * @author jbui
- */
+ /**
+ * Récupère les paramètres de dates
+ * @param params : les paramètres de la requêtes
+ * @return un BilanCriteria complété avec les dates
+ * @author jbui
+ */
protected void parseBilanCriteriaDates(Map params, BasicCriteresRecherche criteria) {
String dateDebut = params.dateDebut
String dateFin = params.dateFin
import grails.converters.JSON
import org.lilie.services.eliot.demon.DemandeTraitementService
import org.lilie.services.eliot.absences.AbstractAbsencesController
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageDiffereService
+
import java.text.SimpleDateFormat
import org.lilie.services.eliot.demon.DemandeTraitement
import org.lilie.services.eliot.impression.stockage.PublipostageStockageFichierService
import org.lilie.services.eliot.absences.page.Page
import org.lilie.services.eliot.scolarite.Calendrier
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import org.lilie.services.eliot.absences.demon.AbsencesDemandeTraitementService
import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
import org.lilie.services.eliot.urllabel.UrlLabelInfo
import org.lilie.services.eliot.absences.AbsencesFonctionnalite
DemandeTraitementService demandeTraitementService
PublipostageStockageFichierService publipostageStockageFichierService
CalendrierService calendrierService
- AbsencesDemandeTraitementService absencesDemandeTraitementService
+ AbsencesPublipostageDiffereService absencesPublipostageDiffereService
def index = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_PUBLIPOSTAGE)
Map modele = prepareBaseModele(Page.PUBLIPOSTAGE_SUIVI_IMPRESSION)
- Calendrier calendrier =
- calendrierService.getCalendrierForEtablissement(
- etablissementCourant()
- )
SimpleDateFormat sdf = new SimpleDateFormat('dd/MM/yyyy', Locale.FRANCE)
- modele.anneeScolaire = [
- debutAnneeScolaire: sdf.format(calendrier.premierJour),
- finAnneeScolaire: sdf.format(calendrier.dernierJour)
- ] as JSON
-
- def listStatutImpression = []
- DemandeTraitementStatut.each {
- if (it != DemandeTraitementStatut.ANNULEE &&
- it != DemandeTraitementStatut.SUPPRIMEE) {
- listStatutImpression <<
- [
- id: it.getCode(),
- libelle: message(code: it.getCodeMessage())
- ]
- }
- }
+ modele.anneeScolaire = getAnneeScolaireDates(sdf) as JSON
+
modele.listStatutImpression = listStatutImpression as JSON
ChampHistoriqueDemandeTraitement.each {
view: '/publipostage/suiviimpression/index',
model: modele
)
+ }
+
+ private Map getAnneeScolaireDates(SimpleDateFormat sdf) {
+ Calendrier calendrier = calendrierService.getCalendrierForEtablissement(
+ etablissementCourant()
+ )
+ [
+ debutAnneeScolaire: sdf.format(calendrier.premierJour),
+ finAnneeScolaire: sdf.format(calendrier.dernierJour)
+ ]
}
-/**
- * Retourne la liste des demande de traitements lancées par l'utilisateur
- */
+ private List getListStatutImpression() {
+ List<DemandeTraitementStatut> list = DemandeTraitementStatut.findAll {
+ it != DemandeTraitementStatut.ANNULEE && it != DemandeTraitementStatut.SUPPRIMEE
+ }
+
+ list.collect {[id: it.getCode(), libelle: message(code: it.getCodeMessage())]}
+ }
+
+ /**
+ * Retourne la liste des demande de traitements lancées par l'utilisateur
+ */
def getSuiviImpression = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_PUBLIPOSTAGE)
boolean trierAsc) {
return new SuiviDemandeTraitementParams(
etablissementId: etablissementCourantId(),
- filtreStatut: absencesDemandeTraitementService.parseCriteriaStatut(
+ filtreStatut: absencesPublipostageDiffereService.parseCriteriaStatut(
mapParams.statutImpressionId
),
- filtreType: [
- DefaultTraitementType.PUBLIPOSTAGE_ABSENCES],
+ filtreType: [DefaultTraitementType.PUBLIPOSTAGE_ABSENCES],
dateDebut: dateDebut,
dateFin: dateFin,
start: mapParams.start ?: 0,
- limit: mapParams.limit ?:
- (grailsApplication.config.eliot.absences.publipostage.
- historique.nombreLignesParPage ?:
- (grailsApplication.config.eliot.absences.publipostage.
- historique.nombreLignesParPage ?: 100)),
+ limit: mapParams.limit ?: grailsApplication.config.eliot.absences.publipostage.historique.nombreLignesParPage ?: 100,
sortField: champParam,
sortAsc: trierAsc
)
result.put(
ChampHistoriqueDemandeTraitement.SUPPORT.getNomChamp(),
message(
- code: absencesDemandeTraitementService.getNomSupport(
+ code: absencesPublipostageDiffereService.getNomSupport(
demandeTraitement.id
)
)
)
result.put(
ChampHistoriqueDemandeTraitement.DATE_DU_DOCUMENT.getNomChamp(),
- absencesDemandeTraitementService.
+ absencesPublipostageDiffereService.
getDateFinTraitement(
demandeTraitement.statut,
demandeTraitement.dateFinExecutionTraitement
return result
}
-/**
- * Retourne un flux vers le fichier résultant de la demande
- */
+ /**
+ * Retourne un flux vers le fichier résultant de la demande
+ */
def getFichier = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_PUBLIPOSTAGE)
demandeTraitement
)
+ response.setHeader(
+ "Content-disposition", 'attachment; filename="' +
+ publipostageStockageFichierService.calculeNomFichier(demandeTraitement) + '"'
+ )
- response.setHeader("Content-disposition", 'attachment; filename="' +
- publipostageStockageFichierService.calculeNomFichier(
- demandeTraitement
- ) + '"')
response.contentType = "application/pdf"
response.characterEncoding = "UTF-8"
response.outputStream << flux
* <http://www.cecill.info/licences.fr.html>.
*/
-
-
package org.lilie.services.eliot.absences.consultation
+import org.lilie.services.eliot.absences.securite.DroitsService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.applications.absences.BilanService
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
+import org.lilie.services.eliot.impression.publipostage.PublipostageService
+import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.annuaire.PersonneProprietesScolarite
import org.lilie.services.eliot.scolarite.anneescolaire.AnneeScolaireService
import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
-import org.lilie.services.eliot.impression.ImpressionRequetageService
import org.lilie.services.eliot.impression.constantes.TypeMedia
import org.lilie.services.eliot.applications.absences.BilanAbsencesParPersonneInfo
import org.lilie.services.eliot.impression.ImpressionInfoGenerale
import org.lilie.services.eliot.temps.DateUtil
-class PublipostageAbsencesService extends AbstractConsultationService {
+class AbsencesPublipostageService extends PublipostageService {
static transactional = true
AnneeScolaireService anneeScolaireService
- ImpressionRequetageService impressionRequetageService
+ BilanService bilanService
+ DroitsService droitsService
/**
* Retourne une liste de maps contenant chacune
TypeMedia typeMedia = TypeMedia.COURRIER,
Boolean filtrerDejaEnvoye = false) {
+ Etablissement etablissement = pref.etablissement
+
criteria = (PublipostageCriteresRecherche) filtreEtCompleteStructuresEnseignement(
criteria,
securiteSession,
- pref.etablissement
+ etablissement
)
Set<Personne> eleves
//Soit on recherche les élèves qui ont un certain nombre d'absences
if (criteria.nbLimit > 0) {
- BilanAbsencesParPersonneInfo datas = findAbsencesDatasForPublipostageAbs(
+ BilanAbsencesParPersonneInfo datas = bilanService.findAbsencesDatasForPublipostageAbs(
criteria,
typeMedia,
filtrerDejaEnvoye
)
- Map resultBrut = calculeNbAbsencesParEleve(datas, pref)
+ Map resultBrut = bilanService.calculeNbAbsencesParEleve(datas, pref)
eleves = filtreResultatWithLimit(resultBrut, criteria)
}
else { //soit on recherche tous les élèves
return []
}
- ImpressionInfoGenerale impressionInfoGenerale = new ImpressionInfoGenerale(
- allEleves: eleves.toList(),
- adresseResponsableEnum: selectionAdresseResponsableEnum,
- etablissement: pref.etablissement
+ List<EleveImpressionInfo> eleveImpressionInfos = getEleveImpressionInfos(
+ etablissement,
+ eleves,
+ selectionAdresseResponsableEnum,
+ typeMedia
)
- List<EleveImpressionInfo> infosResponsables =
- impressionRequetageService.findAllInfoGeneralesEleve(
- impressionInfoGenerale,
- null,
- EleveImpressionInfo,
- typeMedia
- )
-
- impressionRequetageService.triEleves(infosResponsables)
-
- return metEnFormeResultat(
- infosResponsables,
- selectionAdresseResponsableEnum
- )
+ return metEnFormeResultat(eleveImpressionInfos, selectionAdresseResponsableEnum)
}
/**
TypeMedia typeMedia = TypeMedia.COURRIER,
Boolean filtrerDejaEnvoye = false) {
+ Etablissement etablissement = pref.etablissement
+
criteria = (PublipostageCriteresRecherche) filtreEtCompleteStructuresEnseignement(
criteria,
securiteSession,
- pref.etablissement
+ etablissement
)
Set<Personne> eleves
eleves = findAllElevesForCriteria(criteria)
}
- ImpressionInfoGenerale impressionInfoGenerale = new ImpressionInfoGenerale(
- allEleves: eleves.toList(),
- adresseResponsableEnum: selectionAdresseResponsableEnum,
- etablissement: pref.etablissement
+ List<EleveImpressionInfo> eleveImpressionInfos = getEleveImpressionInfos(
+ etablissement,
+ eleves,
+ selectionAdresseResponsableEnum,
+ typeMedia
)
- List<EleveImpressionInfo> infosResponsables =
- impressionRequetageService.findAllInfoGeneralesEleve(
- impressionInfoGenerale,
- null,
- EleveImpressionInfo,
- typeMedia
- )
-
- impressionRequetageService.triEleves(infosResponsables)
-
- return metEnFormeResultat(
- infosResponsables,
- selectionAdresseResponsableEnum)
+ return metEnFormeResultat(eleveImpressionInfos, selectionAdresseResponsableEnum)
}
/**
return result
}
- /**
- * Met en forme le résultat
- * @param eleves : la liste des élèves à inclure dans le résultat
- * @param selectionAdresseResponsableEnum : la selection des résultats dépend du type de responsable choisit
- * @return une liste de maps
- */
- private List metEnFormeResultat(List<EleveImpressionInfo> eleves,
- SelectionAdresseResponsableEnum selectionAdresseResponsableEnum) {
- List result = []
-
- eleves.each {
- EleveImpressionInfo eleveImpressionInfo ->
-
- // validité adresse ou portable
- boolean selection = eleveImpressionInfo.getSelection(selectionAdresseResponsableEnum)
-
- String portable = eleveImpressionInfo?.responsable?.getTelephonePortable()
-
- result << [
- id: eleveImpressionInfo.personneId + ":" + eleveImpressionInfo.selectionAdresseResponsable.toString(),
- nomPrenom: eleveImpressionInfo.personne.nomAffichage(),
- classe: eleveImpressionInfo.eleve_Classe,
- selection: selection,
- valide: eleveImpressionInfo.valide(),
- responsableNum: (eleveImpressionInfo.selectionAdresseResponsable == SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1) ?
- 1 : 2,
- responsable: (eleveImpressionInfo.parent_Nom ? eleveImpressionInfo.parent_Nom : '') +
- ' ' +
- (eleveImpressionInfo.parent_Prenom ? eleveImpressionInfo.parent_Prenom : ''),
- adresse: eleveImpressionInfo.parent_Adresse ? eleveImpressionInfo.parent_Adresse : '',
- cpVille:
- (eleveImpressionInfo.parent_CodePostal ? eleveImpressionInfo.parent_CodePostal : '') +
- ' ' +
- (eleveImpressionInfo.parent_Ville ? eleveImpressionInfo.parent_Ville : ''),
- portable: portable ? portable : ""
- ]
- }
-
- result.sort {
- it.nomPrenom
- }
-
- return result
- }
-
/**
* Retourne la liste des élèves correspondant aux critères
* @return un Set<Personne>
return eleves
}
+ /**
+ * Filtre les divisions en fonction des droits de l'acteur
+ * Si la liste des divisions est nulle, remplie la liste avec toutes les structures autorisées
+ * @param criteria : les critères de la recherche
+ * @param securiteSession : securiteSession de l'acteur effectuant la recherche
+ * @return un BilanCriteria filtré
+ */
+ private BasicCriteresRecherche filtreEtCompleteStructuresEnseignement(BasicCriteresRecherche criteria,
+ SecuriteSession securiteSession,
+ Etablissement etablissement) {
+
+
+ List<StructureEnseignement> listeStructuresAutorisees =
+ droitsService.findAllStructureEnseignementAccessibles(
+ securiteSession,
+ etablissement
+ )
+
+ if (criteria.structIds.contains(BasicCriteresRecherche.VALEUR_TOUS)) {
+ criteria.structIds = listeStructuresAutorisees*.id
+ }
+
+ else {
+ List<StructureEnseignement> structuresAEnlever = []
+ criteria.structIds.each {
+ if (!listeStructuresAutorisees.find {StructureEnseignement struct -> struct.id == it}) {
+ structuresAEnlever << it
+ }
+ }
+ structuresAEnlever.each {
+ criteria.structIds.remove(it)
+ }
+ }
+
+ return criteria
+ }
+
+
}
+++ /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.absences.demon
-
-import org.lilie.services.eliot.demon.DemandeTraitementStatut
-import java.text.SimpleDateFormat
-import org.lilie.services.eliot.impression.constantes.TypeMedia
-import org.lilie.services.eliot.impression.TemplateDocument
-import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
-import org.lilie.services.eliot.demon.DemandeTraitementService
-import org.lilie.services.eliot.scolarite.Etablissement
-import org.lilie.services.eliot.demon.ChampHistoriqueDemandeTraitement
-import org.lilie.services.eliot.demon.DemandeTraitement
-import org.codehaus.groovy.grails.web.json.JSONObject
-import org.lilie.services.eliot.demon.impl.DefaultDemandeTraitement
-import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
-
-/**
- * Construit des demandes de traitement spécifiques à eliot-absences à partir de l'interface
- * générique DemandeTraitement
- * @author jtra
- */
-class AbsencesDemandeTraitementService {
-
- ImpressionTemplateDocumentService impressionTemplateDocumentService
- DemandeTraitementService demandeTraitementService
-
- public List<DemandeTraitementStatut> parseCriteriaStatut(String listeStatut) {
- List<DemandeTraitementStatut> result = []
- if (listeStatut.contains("-1")) {
- DemandeTraitementStatut.each {
- if (it != DemandeTraitementStatut.ANNULEE) {
- result << it
- }
- }
- } else {
- listeStatut.split(',').collect {
- result << DemandeTraitementStatut.parseByCode(Integer.parseInt(it))
- }
- }
- return result
- }
-
- public List<Long> parseCriteriaModele(String listeModele, Etablissement etablissement) {
- List<Long> result = []
- if (listeModele.contains("-1")) {
- impressionTemplateDocumentService.findAllTemplateParEtabEtTypeFonctionnalites(
- etablissement,
- [TemplateTypeFonctionnaliteEnum.LETTRE_ABSENCES]
- ).each {
- result << it.id.toLong()
- }
-
- impressionTemplateDocumentService.findAllTemplateParEtabEtTypeFonctionnalites(
- etablissement,
- [TemplateTypeFonctionnaliteEnum.LETTRE_RETARDS]
- ).each {
- result << it.id.toLong()
- }
-
- } else {
- listeModele.split(',').collect {
- result << it.toLong()
- }
- }
- return result
- }
-
- public String getNomModele(Long idDemande) {
- Long idModel = getIdModeleForDemandeTraitementId(idDemande)
- TemplateDocument modele = TemplateDocument.get(idModel)
- return modele?.nom
- }
-
- public List<DefaultDemandeTraitement> filtrerModele(List<Long> filtreModele,
- List<DefaultDemandeTraitement> liste) {
- List<DefaultDemandeTraitement> result = []
- liste.each {
- Long idModel = getIdModeleForDemandeTraitementId(it.id)
- if (filtreModele.contains(idModel)) {
- result << it
- }
- }
- return result
- }
-
- public Long getIdModeleForDemandeTraitementId(Long demandeId) {
- DemandeTraitement dt =
- demandeTraitementService.getDemandeTraitement(
- demandeId
- )
- Map params = new JSONObject(dt.getTraitementArgs())
- Object obj = params.modeleId
- switch (obj.class) {
- case String: return Long.parseLong(params.modeleId)
- case Long: return (Long) obj
- case Integer: return (Integer) obj
- default:
- throw new IllegalStateException("getIdModeleForDemandeTraitementId erreur de type")
- }
-
- }
-
- public String getNomSupport(Long idDemande) {
- Long idModel = getIdModeleForDemandeTraitementId(idDemande)
- TemplateDocument modele = TemplateDocument.get(idModel)
- if (modele) {
- TypeMedia support = TypeMedia.typeMediaForCode(modele.media)
- return support.libelle
- }
- return "absences.publipostage.suiviImpression.supportInvalide"
- }
-
- public String getDateFinTraitement(DemandeTraitementStatut statut, Date dateFin) {
- SimpleDateFormat sdfAffichage = new SimpleDateFormat("dd/MM/yyyy HH:mm",
- Locale.FRANCE)
- if (dateFin && statut == DemandeTraitementStatut.TERMINEE) {
- return sdfAffichage.format(dateFin)
- }
- return ""
- }
-
- /**
- * Trie, et pagine les résultat dans le cas ou l'on demande un trie sur des colonnes
- * non présentes en base : [PERIODE, SUPPORT]
- * @param liste : liste de toute les données remontés
- * @param sortField : champ sur lequel il faut appliquer le trie
- * @param trieAsc : trie ascendant ou non
- * @param start :
- * @param limit :
- * @return la liste triée et paginée
- */
- public List trierParChampNonEnBase(List liste,
- ChampHistoriqueDemandeTraitement sortField,
- boolean trieAsc,
- int start,
- int limit
- ) {
- List result
- switch (sortField) {
- case ChampHistoriqueDemandeTraitement.MODELE:
- result = liste.sort {it.modele}
- break
- case ChampHistoriqueDemandeTraitement.TELECHARGER_DOC:
- result = liste.sort {it.telecharger_doc}
- break
- case ChampHistoriqueDemandeTraitement.SUPPORT:
- result = liste.sort {it.support}
- break
- default:
- result = liste.sort {it.date_demande}
- }
- if (!trieAsc) {
- result = result.reverse()
- }
- if (start + limit > result.size()) {
- result = result.subList(start, result.size())
- }
- else {
- result = result.subList(start, start + limit)
- }
- return result
- }
-
-}
\ No newline at end of file
import org.lilie.services.eliot.impression.batch.PublipostageRequetageService
import org.lilie.services.eliot.impression.constantes.TemplateTypeFonctionnaliteEnum
import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageParams
import org.lilie.services.eliot.scolarite.Etablissement
import org.lilie.services.eliot.impression.TemplateDocument
import org.lilie.services.eliot.securite.impl.DefaultSecuriteSessionFactory
TemplateDocument template,
DemandeTraitement demande) {
- org.lilie.services.eliot.impression.publipostage.PublipostageAbsencesParams parametresSelectionPublipostage =
+ AbsencesPublipostageParams parametresSelectionPublipostage =
construitSelectionCommand(demande.getTraitementArgs())
return lectureDonneesEleve(
package org.lilie.services.eliot.absences
import grails.test.GrailsUnitTestCase
-import org.lilie.services.eliot.absences.consultation.PublipostageAbsencesService
+import org.lilie.services.eliot.absences.consultation.AbsencesPublipostageService
import org.lilie.services.eliot.annuaire.SecuriteSession
import org.lilie.services.eliot.impression.PublipostageSuivi
import org.lilie.services.eliot.impression.TemplateTypeFonctionnalite
import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
import org.lilie.services.eliot.scolarite.Etablissement
-class PublipostageAbsencesServiceTests extends GrailsUnitTestCase {
+class AbsencesPublipostageServiceTests extends GrailsUnitTestCase {
- PublipostageAbsencesService publipostageAbsencesService
+ AbsencesPublipostageService absencesPublipostageService
InitDonneesCommunesTestAbsenceService initDonneesCommunesTestAbsenceService
ImpressionTemplateDocumentService impressionTemplateDocumentService
InitDonneesCommunesTestPreferencesAbsencesService initDonneesCommunesTestPreferencesAbsencesService
void testGetListAbsences() {
- List<Map> listeInitiale = publipostageAbsencesService.getListAbsences(
+ List<Map> listeInitiale = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
initDonneesCommunesTestAbsenceService.creeAppelsDeTestSeptembre()
initDonneesCommunesTestAbsenceService.creeAppelsDeTestOctobre()
- List<Map> listeFinale = publipostageAbsencesService.getListAbsences(
+ List<Map> listeFinale = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
PublipostageCriteresRecherche criteriaLimit5 = getCriteria()
criteriaLimit5.nbLimit = 5
- List<Map> listeLimit5 = publipostageAbsencesService.getListAbsences(
+ List<Map> listeLimit5 = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
criteriaLimit5,
PublipostageCriteresRecherche criteriaLimit6 = getCriteria()
criteriaLimit6.nbLimit = 6
- List<Map> listeLimit6 = publipostageAbsencesService.getListAbsences(
+ List<Map> listeLimit6 = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
criteriaLimit6,
]
criteriaMotif1.nbLimit = 4
- List<Map> listeMotif1 = publipostageAbsencesService.getListAbsences(
+ List<Map> listeMotif1 = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
criteriaMotif1,
initDonneesCommunesTestAbsenceService.creeAppelsDeTestOctobre()
// Requêtes sans filtre
- List<Map> liste = publipostageAbsencesService.getListAbsences(
+ List<Map> liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
6,
liste.size())
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, mais il n'y a pas eu d'envoi dans la journée
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
6,
liste.size())
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, mais les envoi de la journée ne concernent pas les documents d'absences
creeSuivisNonAbsences()
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
6,
liste.size())
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, les envoi de la journée sont faits par SMS
List<PublipostageSuivi> suivisSMS = creeSuivisSMSAbsences()
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
6,
liste.size())
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, les envoi de la journée sont faits par courrier
List<PublipostageSuivi> suivisCourrier = creeSuivisCourrierAbsences()
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
0,
liste.size())
- liste = publipostageAbsencesService.getListAbsences(
+ liste = absencesPublipostageService.getListAbsences(
securiteSession,
prefEtab,
getCriteria(),
PublipostageCriteresRecherche criteria = getCriteria()
criteria.nbLimit = 4
- List<Map> listeFinale = publipostageAbsencesService.getListRetards(
+ List<Map> listeFinale = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
criteria,
PublipostageCriteresRecherche criteria = getCriteria()
// Requêtes sans filtre
- List<Map> liste = publipostageAbsencesService.getListRetards(
+ List<Map> liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
2,
liste.size())
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, mais il n'y a pas eu d'envoi dans la journée
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
2,
liste.size())
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, mais les envoi de la journée ne concernent pas les documents d'absences
creeSuivisNonAbsences()
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
2,
liste.size())
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, les envoi de la journée sont faits par SMS
List<PublipostageSuivi> suivisSMS = creeSuivisSMSAbsences()
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
2,
liste.size())
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
// Requêtes avec filtre, les envoi de la journée sont faits par courrier
List<PublipostageSuivi> suivisCourrier = creeSuivisCourrierAbsences()
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
0,
liste.size())
- liste = publipostageAbsencesService.getListRetards(
+ liste = absencesPublipostageService.getListRetards(
securiteSession,
prefEtab,
getCriteria(),
package org.lilie.services.eliot.notes.publipostage.selection
-import org.lilie.services.eliot.notes.publipostage.PublipostageNotesParams
+import org.lilie.services.eliot.notes.publipostage.NotesPublipostageParams
/**
* La classe de command du controleur est identique à celle des services.
* dépendant des classes de contrôleurs on fait cet héritage
* @author ; othe
*/
-class PublipostageCommand extends PublipostageNotesParams{
+class NotesPublipostageCommand extends NotesPublipostageParams{
}
* Impression différée
*/
@SuppressWarnings('CatchException')
- def publiposteDiffere = {PublipostageCommand command ->
+ def publiposteDiffere = {NotesPublipostageCommand command ->
Map resultats
Map modele = prepareBaseModele(Page.PUBLIPOSTAGE_SUIVI_IMPRESSION)
- Calendrier calendrier =
- calendrierService.getCalendrierForEtablissement(etablissementCourant())
-
- modele.anneeScolaire = [
- debutAnneeScolaire: calendrier.premierJour ? sdfJS.format(calendrier.premierJour) : null,
- finAnneeScolaire: calendrier.dernierJour ? sdfJS.format(calendrier.dernierJour) : null
- ] as JSON
-
- def listStatutImpression = []
- DemandeTraitementStatut.each { DemandeTraitementStatut statut ->
- if (statut != DemandeTraitementStatut.ANNULEE &&
- statut != DemandeTraitementStatut.SUPPRIMEE) {
- listStatutImpression <<
- [
- id: statut.getCode(),
- libelle: message(code: statut.getCodeMessage())
- ]
- }
- }
- modele.statuts = listStatutImpression as JSON
+ modele.anneeScolaire = getAnneeScolaireDates() as JSON
+
+ modele.statuts = getListStatusImpression() as JSON
ChampHistoriqueDemandeTraitement.each {
modele.put(it.name(), it.getNomChamp())
)
}
+ private LinkedHashMap<String, String> getAnneeScolaireDates() {
+ Calendrier cal =
+ calendrierService.getCalendrierForEtablissement(etablissementCourant())
+
+ [
+ debutAnneeScolaire: cal.premierJour ? sdfJS.format(cal.premierJour) : null,
+ finAnneeScolaire : cal.dernierJour ? sdfJS.format(cal.dernierJour) : null
+ ]
+ }
+
+ private List getListStatusImpression() {
+ List<DemandeTraitementStatut> list = DemandeTraitementStatut.findAll {
+ it != DemandeTraitementStatut.ANNULEE && it != DemandeTraitementStatut.SUPPRIMEE
+ }
+
+ list.collect {[id: it.getCode(), libelle: message(code: it.getCodeMessage())]}
+ }
+
/**
* Retourne la liste des demande de traitements lancées par l'utilisateur
*/
Date dateFin = sdf.parse(mapParams.dateFin.toString())
ChampHistoriqueDemandeTraitement champParam =
- (ChampHistoriqueDemandeTraitement) ChampHistoriqueDemandeTraitement.find {
- ChampHistoriqueDemandeTraitement chdt ->
- chdt.nomChamp == mapParams.sortInfo.field.toString()
- }
+ (ChampHistoriqueDemandeTraitement) ChampHistoriqueDemandeTraitement.find {
+ ChampHistoriqueDemandeTraitement chdt ->
+ chdt.nomChamp == mapParams.sortInfo.field.toString()
+ }
boolean trierAsc = mapParams.sortInfo.direction == "ASC"
)
List<DefaultDemandeTraitement> liste =
- demandeTraitementService.getHistoriqueDemandesTraitements(
- historique
- )
+ demandeTraitementService.getHistoriqueDemandesTraitements(
+ historique
+ )
List result = liste.collect {
[
it
),
date_fin_execution_traitement:
- notesDemandeTraitementService.getDateFinTraitement(
- it.statut,
- it.dateFinExecutionTraitement
- ),
+ notesDemandeTraitementService.getDateFinTraitement(
+ it.statut,
+ it.dateFinExecutionTraitement
+ ),
periode: notesDemandeTraitementService.getNomPeriode(it.id),
supprimable: (it.statut == DemandeTraitementStatut.TERMINEE ||
- it.statut == DemandeTraitementStatut.ERREUR)
+ it.statut == DemandeTraitementStatut.ERREUR)
]
}
[
data: result,
nbData:
- demandeTraitementService.getNombreDemandeTraitementHistorique(
- historique
- ),
+ demandeTraitementService.getNombreDemandeTraitementHistorique(
+ historique
+ ),
success: true
] as JSON
)
Long demandeId = params.id?.toLong()
DemandeTraitement demandeTraitement =
- demandeTraitementService.getDemandeTraitement(demandeId)
+ demandeTraitementService.getDemandeTraitement(demandeId)
verifieDroitAccesObjetDomaine(Etablissement.get(demandeTraitement.getEtablissementId()))
}
/**
- * Supprime une demande d'impression
+ * Supprime des demandes d'impression
*/
def supprimeDemandes = {
verifieDroitFonctionnalite(NotesFonctionnalite.NOTES_PUBLIPOST)
Map suppressionParams = (Map) JSON.parse(params.params)
try {
- demandeTraitementService.supprimeDemandeTraitements(
- suppressionParams.demandeIds.collect {(Long)it}
- )
- render([
- success: true
- ] as JSON)
- } catch (DemandeTraitementExecutionNonSupprimableException e) {
+ List<Long> demandeIds = suppressionParams.demandeIds*.toLong()
+ demandeTraitementService.supprimeDemandeTraitements(demandeIds)
+ render([success: true] as JSON)
+ }
+ catch (DemandeTraitementExecutionNonSupprimableException e) {
render([
success: false,
message: message(code: 'eliot.publipostage.suiviImpression.suppressionEchec')
import org.lilie.services.eliot.impression.requetage.ImpressionSelectionRequeteService
import org.lilie.services.eliot.impression.requetage.ImpressionRequetageSelection
import org.codehaus.groovy.grails.web.json.JSONObject
-import org.lilie.services.eliot.notes.publipostage.PublipostageNotesParams
+import org.lilie.services.eliot.notes.publipostage.NotesPublipostageParams
import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
import org.lilie.services.eliot.scolarite.Periode
import org.lilie.services.eliot.securite.impl.DefaultSecuriteSessionFactory
* pas dans un contrôleur car en fait on va faire appel à cette méthode
* dans les jobs.
*/
- public PublipostageNotesParams construitSelectionCommand(String argsJSON) {
+ public NotesPublipostageParams construitSelectionCommand(String argsJSON) {
Map params = new JSONObject(argsJSON)
String elevesSelectionnes = params.elevesSelectionnes
params.typeIntervalle != null && params.typeIntervalle != 'null' ?
(TypeIntervalleEnum) TypeIntervalleEnum.valueOf(params.typeIntervalle) : null
- PublipostageNotesParams parametresSelectionPublipostage =
- new PublipostageNotesParams(
+ NotesPublipostageParams parametresSelectionPublipostage =
+ new NotesPublipostageParams(
typePeriodeId: params.typePeriodeId ? params.typePeriodeId.toLong() : null,
modeleId: Long.parseLong(params.modeleId),
elevesSelectionnes: elevesId,
/**
* @author bper, othe
*/
-class PublipostageNotesParams {
+class NotesPublipostageParams {
Long typePeriodeId
Long modeleId
String classesId
TemplateTypeFonctionnaliteEnum lectureTypeFonctionnalite(DemandeTraitement demande){
- PublipostageNotesParams parametresSelectionPublipostage =
+ NotesPublipostageParams parametresSelectionPublipostage =
impressionRequetageBulletinReleveService.construitSelectionCommand(demande.getTraitementArgs())
TemplateDocument templateDocument = TemplateDocument.get(parametresSelectionPublipostage.modeleId)
TemplateDocument template,
DemandeTraitement demande) {
- PublipostageNotesParams parametresSelectionPublipostage =
+ NotesPublipostageParams parametresSelectionPublipostage =
impressionRequetageBulletinReleveService.construitSelectionCommand(demande.getTraitementArgs())
TemplateTypeFonctionnaliteEnum templateTypeFonctionnaliteEnum =
/**
* Appel du requetage pour relevé et bulletin
*/
- private List<EleveImpressionInfo> findAllInfoForBulletinEtReleve(PublipostageNotesParams parametresSelectionPublipostage, SecuriteSession securiteSession, Etablissement etablissement, TemplateDocument template) {
+ private List<EleveImpressionInfo> findAllInfoForBulletinEtReleve(NotesPublipostageParams parametresSelectionPublipostage, SecuriteSession securiteSession, Etablissement etablissement, TemplateDocument template) {
List<Personne> eleves = localPersonneService.
findAllPersonne(
parametresSelectionPublipostage.elevesSelectionnes
* Appel du requetage pour brevet
*/
private List<EleveImpressionInfo> findAllInfoForBrevet(SecuriteSession securiteSession,
- PublipostageNotesParams parametresSelectionPublipostage,
+ NotesPublipostageParams parametresSelectionPublipostage,
Etablissement etablissement) {
List<Personne> eleves = localPersonneService.
border: false,
frame: false,
layout: 'fit',
- bodyStyle: 'padding-top:10px',
labelAlign: 'top',
items: this.suiviView.rechercheGrid
}
this.filtreItems = new Ext.FormPanel({
border : false,
cls:'x-panel-mc',
- bodyStyle:'padding:13px 0px',
+ bodyStyle:'padding:8px 0px',
layout: 'vbox',
items : [
{
{
header: this.Modele.header.periode,
dataIndex: this.Modele.dataIndex.periode,
- width : 100
+ width : 90
},
{
header: this.Modele.header.statut,
items:[
{
region : 'north',
- height : 120,
+ height : 110,
layout: 'fit',
items: this.historiqueView.getFiltreItems()
},
border: false,
frame: false,
layout: 'fit',
- bodyStyle: 'padding-top:10px',
labelAlign: 'top',
items: this.historiqueView.getItems()
}
this.filtreItems = new Ext.FormPanel({
border : false,
cls:'x-panel-mc',
- bodyStyle:'padding:13px 0px',
+ bodyStyle:'padding:8px 0px',
layout: 'vbox',
items : [
{
}
catch (Exception ex) {
success = false
- errorMsg = message(code: 'eliot.scolarite.message.erreurInconnue')
+ errorMsg = message(code: 'eliot.scolarite.messages.erreurInconnue')
log.error(errorMsg, ex)
}
ScolariteFonctionnalites.NOTIFICATION_PREFERNCE_UTILISATEUR
),
+ PUBLIPOSTAGE(
+ ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE
+ ),
+
+ PUBLIPOSTAGE_SELECTION(
+ ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE,
+ 'publipostage',
+ 'index'
+ ),
+
+ PUBLIPOSTAGE_SUIVI_PAR_ELEVE(
+ ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE,
+ 'suiviEleve',
+ 'index'
+ ),
+
+ PUBLIPOSTAGE_SUIVI_IMPRESSION(
+ ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE,
+ 'suiviImpression',
+ 'index'
+ ),
+
ETABLISSEMENT(
ScolariteFonctionnalites.ETABLISSEMENT
)
+
private EliotFonctionnalites fonctionnalite
private String controllerName
private String actionName
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.scolarite.publipostage.selection
+
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageParams
+
+/**
+ * La classe SelectionCommand est exactement la même que
+ * ParametresSelectionPublipostage, car en fait les services utilisants
+ * ParametresSelectionPublipostage sont en quelque sorte des contrôleurs.
+ * Ceci est lié au cas particulier des demandes de publipostage en différé.
+ * Pour éviter de manipuler au niveau service des classes command qui sont
+ * réservés pour faire interface entre la vue et le contrôleur.
+ * @author : othe
+ */
+class AbsencesPublipostageCommand extends AbsencesPublipostageParams {
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.scolarite.publipostage.selection
+
+import grails.converters.JSON
+import org.lilie.services.eliot.CodeComparator
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
+import org.lilie.services.eliot.impression.constantes.TypeMedia
+import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageDiffereService
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageDirectService
+import org.lilie.services.eliot.impression.template.ImpressionTemplateDocumentService
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.page.ScolaritePage
+import org.lilie.services.eliot.scolarite.publipostage.ScolaritePublipostageService
+import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
+import org.lilie.services.eliot.scolarite.AbstractScolariteController
+import org.lilie.services.eliot.scolarite.ScolariteFonctionnalites
+
+class PublipostageController extends AbstractScolariteController {
+
+ ImpressionTemplateDocumentService impressionTemplateDocumentService
+ ScolaritePublipostageService scolaritePublipostageService
+ AbsencesPublipostageDirectService absencesPublipostageDirectService
+ AbsencesPublipostageDiffereService absencesPublipostageDiffereService
+
+ def index = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ Map modele = prepareBaseModele(ScolaritePage.PUBLIPOSTAGE_SELECTION)
+
+ modele.structureEnseignements = getListeStructures() as JSON
+
+ modele.adresseDestinataires = getListAdresseDestinataire() as JSON
+
+ modele.seuil = grailsApplication.config.eliot.impression.seuil
+
+ List<TemplateDocument> templateDocuments =
+ impressionTemplateDocumentService.findAllTemplateDocByEtabtAndTemplateEliotEnums(
+ etablissementCourant(),
+ [TemplateEliotEnum.LETTRE_ADMIN_ABS]
+ )
+
+ modele.modeleDocuments = templateDocuments.collect {[id: it.id, libelle: it.nom]} as JSON
+
+ render(
+ view: '/publipostage/selection/index',
+ model: modele
+ )
+ }
+
+
+ private List getListeStructures() {
+ List<StructureEnseignement> structures = StructureEnseignement.withCriteria {
+ eq('etablissement', etablissementCourant())
+ eq('type', StructureEnseignement.TYPE_CLASSE)
+ }
+
+ CodeComparator cc = CodeComparator.create()
+
+ // Trie logique
+ structures.sort {a, b -> cc.compare(a.code, b.code)}
+
+ return structures.collect {[id: it.id, libelle: it.code]}
+ }
+
+
+ private List getListAdresseDestinataire() {
+ SelectionAdresseResponsableEnum.collect {
+ SelectionAdresseResponsableEnum selectionAdresseResponsableEnum ->
+ [
+ id: selectionAdresseResponsableEnum.toString(),
+ libelle: message(code: selectionAdresseResponsableEnum.getCodei18n())
+ ]
+ }
+ }
+
+
+ def recherche = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ List<Long> classeIds =
+ params.classeIds && params.classeIds != 'null' && params.classeIds != '-1' ?
+ params.classeIds.split(',')*.toLong() : null
+
+ List<StructureEnseignement> classes = classeIds ?
+ StructureEnseignement.findAllByIdInList(classeIds) : null
+
+ classes.each {verifieDroitAccesObjetDomaine(it)}
+
+ SelectionAdresseResponsableEnum destinataire =
+ SelectionAdresseResponsableEnum.valueOf(
+ SelectionAdresseResponsableEnum.class,
+ params.destinataire
+ )
+
+ List data = scolaritePublipostageService.recherche(
+ etablissementCourant(),
+ classes,
+ destinataire
+ )
+
+ render([data: data, success: true] as JSON)
+ }
+
+ /**
+ * Permet une impression directe
+ */
+ def publiposteDirecte = {AbsencesPublipostageCommand command ->
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ TemplateDocument templateDocument = impressionTemplateDocumentService.
+ findTemplateDocument(
+ command.modeleId
+ )
+
+ // on envoie la réponse en PDF
+ sendPdfFile(
+ response,
+ absencesPublipostageDirectService.publipostageDirect(
+ getSecuriteSession(),
+ etablissementCourant(),
+ (Personne) (session.personne),
+ command,
+ params
+ ),
+ templateDocument.nom
+ )
+ }
+
+ /**
+ * Permet une impression différée
+ * Ne gère pas les params. Ne fait que les passer comme demande de traitement,
+ * car cette action n'a pas besoin de connaitre les paramètres envoyés à
+ * l'utilisateur. C'est pourquoi la classe PublipostageCommand n'est pas
+ * utilisée.
+ */
+ def publiposteDiffere = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ // Ajout des paramètres par défaut des absence
+ params.mediaId = TypeMedia.COURRIER.code.toString()
+ params.tab = 'absence'
+
+ absencesPublipostageDiffereService.creeDemandeDifferee(
+ securiteSession.defaultAutorite,
+ etablissementCourant(),
+ params
+ )
+
+ render([success: true] as JSON)
+ }
+
+
+ protected List getBreadCrumbsInfo() {
+ List<BreadCrumbsItemInfo> breadCrumbsInfo = super.getBreadCrumbsInfo()
+ breadCrumbsInfo << new BreadCrumbsItemInfo(
+ codeLabel: 'scolarite.breadCrumbs.publipostage'
+ )
+ breadCrumbsInfo << new BreadCrumbsItemInfo(
+ codeLabel: 'scolarite.breadCrumbs.publipostage.selection'
+ )
+ return breadCrumbsInfo
+ }
+
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.scolarite.publipostage.suiviimpression
+
+import grails.converters.JSON
+import org.lilie.services.eliot.demon.ChampHistoriqueDemandeTraitement
+import org.lilie.services.eliot.demon.DemandeTraitement
+import org.lilie.services.eliot.demon.DemandeTraitementExecutionNonSupprimableException
+import org.lilie.services.eliot.demon.DemandeTraitementService
+import org.lilie.services.eliot.demon.DemandeTraitementStatut
+import org.lilie.services.eliot.demon.SuiviDemandeTraitementParams
+import org.lilie.services.eliot.demon.impl.DefaultTraitementType
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
+import org.lilie.services.eliot.impression.publipostage.AbsencesPublipostageDiffereService
+import org.lilie.services.eliot.impression.stockage.PublipostageStockageFichierService
+import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
+import org.lilie.services.eliot.scolarite.AbstractScolariteController
+import org.lilie.services.eliot.scolarite.Calendrier
+import org.lilie.services.eliot.scolarite.ScolariteFonctionnalites
+import org.lilie.services.eliot.scolarite.page.ScolaritePage
+
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
+
+class SuiviImpressionController extends AbstractScolariteController {
+
+ CalendrierService calendrierService
+ DemandeTraitementService demandeTraitementService
+ PublipostageStockageFichierService publipostageStockageFichierService
+ AbsencesPublipostageDiffereService absencesPublipostageDiffereService
+
+ SimpleDateFormat sdfJS = new SimpleDateFormat("dd/MM/yyyy", Locale.FRANCE)
+
+ def index = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ Map modele = prepareBaseModele(ScolaritePage.PUBLIPOSTAGE_SUIVI_IMPRESSION)
+
+ modele.anneeScolaire = getAnneeScolaireDates() as JSON
+
+ modele.statuts = getListStatusImpression() as JSON
+
+ modele.nbLigneParPage = grailsApplication.config.eliot.scolarite.publipostage.historique.nombreLignesParPage ?: 100
+
+ ChampHistoriqueDemandeTraitement.each {
+ modele.put(it.name(), it.getNomChamp())
+ }
+
+ Calendar cal = GregorianCalendar.getInstance()
+ modele.dateFin = sdfJS.format(cal.getTime())
+ cal.add(Calendar.MONTH, -1)
+ modele.dateDebut = sdfJS.format(cal.getTime())
+
+ render(
+ view: '/publipostage/suiviimpression/index',
+ model: modele
+ )
+ }
+
+
+ private Map getAnneeScolaireDates() {
+ Calendrier cal =
+ calendrierService.getCalendrierForEtablissement(etablissementCourant())
+
+ [
+ debutAnneeScolaire: cal.premierJour ? sdfJS.format(cal.premierJour) : null,
+ finAnneeScolaire: cal.dernierJour ? sdfJS.format(cal.dernierJour) : null
+ ]
+ }
+
+
+ private List getListStatusImpression() {
+ List<DemandeTraitementStatut> list = DemandeTraitementStatut.findAll {
+ it != DemandeTraitementStatut.ANNULEE && it != DemandeTraitementStatut.SUPPRIMEE
+ }
+
+ list.collect {[id: it.getCode(), libelle: message(code: it.getCodeMessage())]}
+ }
+
+ /**
+ * Retourne la liste des demande de traitements lancées par l'utilisateur
+ */
+ def getSuiviImpression = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+ Map mapParams = (Map) JSON.parse(params.params)
+
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd", Locale.FRANCE)
+ SimpleDateFormat sdfAffichage = new SimpleDateFormat("dd/MM/yyyy HH:mm", Locale.FRANCE)
+
+ Date dateDebut = sdf.parse(mapParams.dateDebut.toString())
+ Date dateFin = sdf.parse(mapParams.dateFin.toString())
+
+ ChampHistoriqueDemandeTraitement champParam =
+ (ChampHistoriqueDemandeTraitement) ChampHistoriqueDemandeTraitement.find {
+ ChampHistoriqueDemandeTraitement chdt ->
+ chdt.nomChamp == mapParams.sortInfo.field.toString()
+ }
+
+ boolean trierAsc = mapParams.sortInfo.direction == "ASC"
+
+ SuiviDemandeTraitementParams historique = creeSuiviDemandeTraitementParams(
+ mapParams,
+ dateDebut,
+ dateFin,
+ champParam,
+ trierAsc
+ )
+
+ // Si le filtreSql est null cela veut dire qu'il n'y a aucune modèle de doc
+ // correspondant au modèle Eliot LETTRE_ADMIN_ABS
+ List<DemandeTraitement> liste = historique.filtreSql ?
+ demandeTraitementService.getHistoriqueDemandesTraitements(historique) : []
+
+ List result = liste.collect {
+ return getDemandeTraitementInfo(it, sdfAffichage)
+ }
+
+ render([
+ data: result,
+ nbData: demandeTraitementService.getNombreDemandeTraitementHistorique(historique),
+ success: true
+ ] as JSON)
+ }
+
+
+ private def getDemandeTraitementInfo(DemandeTraitement demande,
+ SimpleDateFormat sdfAffichage) {
+ Map result = (Map) [:]
+ result.put("id", demande.getId())
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.DATE_HEURE.getNomChamp(),
+ sdfAffichage.format(demande.dateDemande)
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.SUPPORT.getNomChamp(),
+ message(code: absencesPublipostageDiffereService.getNomSupport(demande.id))
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.NOM.getNomChamp(),
+ demande.nom
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.STATUT.getNomChamp(),
+ message(code: demande.statut.codeMessage)
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.TELECHARGER_DOC.getNomChamp(),
+ (demande.statut == DemandeTraitementStatut.TERMINEE)
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.DOC_EXISTE.getNomChamp(),
+ publipostageStockageFichierService.fichierExiste(
+ securiteSession,
+ demande
+ )
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.DATE_DU_DOCUMENT.getNomChamp(),
+ absencesPublipostageDiffereService.
+ getDateFinTraitement(
+ demande.statut,
+ demande.dateFinExecutionTraitement
+ )
+ )
+
+ result.put(
+ ChampHistoriqueDemandeTraitement.SUPPRIMABLE.getNomChamp(),
+ (demande.statut == DemandeTraitementStatut.TERMINEE ||
+ demande.statut == DemandeTraitementStatut.ERREUR)
+ )
+
+ return result
+ }
+
+
+ private SuiviDemandeTraitementParams creeSuiviDemandeTraitementParams(Map mapParams,
+ Date dateDebut,
+ Date dateFin,
+ ChampHistoriqueDemandeTraitement champParam,
+ boolean trierAsc) {
+
+ List<TemplateDocument> templates = TemplateDocument.withCriteria {
+ eq('etablissement', etablissementCourant())
+ templateEliot {
+ eq('code', TemplateEliotEnum.LETTRE_ADMIN_ABS.toString())
+ }
+ }
+
+ List filtreSqlTemplates = templates.collect {"traitement_args LIKE '%\"modeleId\":\"${it.id}\"%'"}
+ String filtreSql = filtreSqlTemplates ? " AND (${filtreSqlTemplates.join(' OR ')})" : null
+
+ return new SuiviDemandeTraitementParams(
+ etablissementId: etablissementCourantId(),
+ filtreStatut: absencesPublipostageDiffereService.parseCriteriaStatut(mapParams.statuts),
+ filtreType: [DefaultTraitementType.PUBLIPOSTAGE_ABSENCES],
+ dateDebut: dateDebut,
+ dateFin: dateFin,
+ start: mapParams.start ?: 0,
+ limit: mapParams.limit ?: grailsApplication.config.eliot.scolarite.publipostage.historique.nombreLignesParPage ?: 100,
+ sortField: champParam,
+ sortAsc: trierAsc,
+ filtreSql: filtreSql
+ )
+ }
+
+ /**
+ * Retourne un flux vers le fichier résultant de la demande
+ */
+ def getFichier = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ Long demandeId = Long.parseLong(params.id)
+ DemandeTraitement demandeTraitement = demandeTraitementService.
+ getDemandeTraitement(demandeId)
+
+ InputStream flux = publipostageStockageFichierService.getFichierInputStream(
+ securiteSession,
+ demandeTraitement
+ )
+
+ response.setHeader(
+ "Content-disposition", 'attachment; filename="' +
+ publipostageStockageFichierService.calculeNomFichier(demandeTraitement) + '"'
+ )
+
+ response.contentType = "application/pdf"
+ response.characterEncoding = "UTF-8"
+ response.outputStream << flux
+ }
+
+ /**
+ * Supprime des demandes d'impression
+ */
+ def supprimeDemandes = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ Map suppressionParams = (Map) JSON.parse(params.params)
+ try {
+ List<Long> demandeIds = suppressionParams.demandeIds*.toLong()
+ demandeTraitementService.supprimeDemandeTraitements(demandeIds)
+ render([success: true] as JSON)
+ }
+ catch (DemandeTraitementExecutionNonSupprimableException e) {
+ render([
+ success: false,
+ message: message(code: 'scolarite.suiviImpression.suppressionEchec')
+ ] as JSON)
+ }
+ }
+
+
+ protected List getBreadCrumbsInfo() {
+ List<BreadCrumbsItemInfo> breadCrumbsInfo = super.getBreadCrumbsInfo()
+ breadCrumbsInfo << new BreadCrumbsItemInfo(
+ codeLabel: 'scolarite.breadCrumbs.publipostage'
+ )
+ breadCrumbsInfo << new BreadCrumbsItemInfo(
+ codeLabel: 'eliot.scolarite.menu.publipostage.suiviImpression.titrePrincipal'
+ )
+ return breadCrumbsInfo
+ }
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.scolarite.publipostage.suivipareleve
+
+import grails.converters.JSON
+import org.lilie.services.eliot.impression.ImpressionSuiviEleveService
+import org.lilie.services.eliot.impression.PublipostageSuivi
+import org.lilie.services.eliot.impression.TemplateDocument
+import org.lilie.services.eliot.impression.constantes.TemplateEliotEnum
+import org.lilie.services.eliot.impression.constantes.TypeMedia
+import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
+import org.lilie.services.eliot.scolarite.AbstractScolariteController
+import org.lilie.services.eliot.scolarite.Calendrier
+import org.lilie.services.eliot.scolarite.ScolariteFonctionnalites
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.page.ScolaritePage
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
+
+import java.text.SimpleDateFormat
+
+
+class SuiviEleveController extends AbstractScolariteController {
+
+ LocalStructureEnseignementService localStructureEnseignementService
+ CalendrierService calendrierService
+ ImpressionSuiviEleveService impressionSuiviEleveService
+
+ private SimpleDateFormat sdfJS = new SimpleDateFormat("dd/MM/yyyy", Locale.FRANCE)
+
+ def index = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ Map modele = prepareBaseModele(ScolaritePage.PUBLIPOSTAGE_SUIVI_PAR_ELEVE)
+
+ // Liste des classes
+ modele.classes = getClasses() as JSON
+
+ modele.modeles = getAllTemplateLettreAdminAbs() as JSON
+
+ modele.anneeScolaire = getAnneeScolaireDates() as JSON
+
+ modele.nombreLignesParPage = 100
+
+ render(
+ view: '/publipostage/suivipareleve/index',
+ model: modele
+ )
+ }
+
+
+ private List<Map> getClasses() {
+ List<StructureEnseignement> classes = localStructureEnseignementService.
+ findAllClasseByEtablissement(etablissementCourant()).
+ sort {a, b -> cc.compare(a.code, b.code)}
+
+ classes.collect {[id: it.id, libelle: it.code]}
+ }
+
+
+ private List<TemplateDocument> getAllTemplateLettreAdminAbs() {
+ List<TemplateDocument> modeles = TemplateDocument.withCriteria {
+ eq('etablissement', etablissementCourant())
+ templateEliot {
+ eq('code', TemplateEliotEnum.LETTRE_ADMIN_ABS.toString())
+ }
+ }
+
+ modeles.collect {[id: it.id, libelle: it.nom]}
+ }
+
+
+ private Map getAnneeScolaireDates() {
+ Calendrier cal =
+ calendrierService.getCalendrierForEtablissement(etablissementCourant())
+
+ [
+ debutAnneeScolaire: cal.premierJour ? sdfJS.format(cal.premierJour) : null,
+ finAnneeScolaire: cal.dernierJour ? sdfJS.format(cal.dernierJour) : null
+ ]
+ }
+
+
+ def recherche = {
+ verifieDroitFonctionnalite(ScolariteFonctionnalites.SCOL_PUBLIPOSTAGE)
+
+ Map result = [:]
+
+ SimpleDateFormat sdfAffichage = new SimpleDateFormat("dd/MM/yyyy HH:mm", Locale.FRANCE)
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.FRANCE)
+
+ Map mapParams = (Map) JSON.parse(params.params)
+
+ Date dateDebut = mapParams.dateDebut ? sdf.parse(mapParams.dateDebut) : null
+ Date dateFin = mapParams.dateFin ? sdf.parse(mapParams.dateFin) : null
+
+ List<StructureEnseignement> classes = StructureEnseignement.getAll(mapParams.classeIds)
+ classes.each {verifieDroitAccesObjetDomaine(it)}
+
+ List<TemplateDocument> modeles = TemplateDocument.getAll(mapParams.modeleIds)
+
+ dateFin.setTime(dateFin.getTime() + 24 * 3600 * 1000)
+
+ int start = mapParams.start ?: 0
+
+ Map listeEnvoi = impressionSuiviEleveService.listeEnvoi(
+ etablissementCourant(),
+ dateDebut,
+ dateFin,
+ classes,
+ modeles,
+ start,
+ mapParams.sortInfo
+ )
+
+ List<PublipostageSuivi> suivis = listeEnvoi.liste
+
+ result.data = suivis.collect {
+ [
+ id: it.id,
+ date: sdfAffichage.format(it.dateEnvoi),
+ nom: it.personne?.nomAffichage(),
+ classe: it.classe?.code,
+ type: message(code: TypeMedia.typeMediaForCode(it.media).libelle),
+ responsable: it?.responsable?.nomAffichage(),
+ modele: it?.templateDocument.nom,
+ portable: it?.responsable?.getTelephonePortable()
+ ]
+ }
+
+ result.nbData = listeEnvoi.nbData
+ result.success = true
+
+ render result as JSON
+ }
+
+
+ protected List getBreadCrumbsInfo() {
+ List<BreadCrumbsItemInfo> breadCrumbsInfo = super.getBreadCrumbsInfo()
+ breadCrumbsInfo << new BreadCrumbsItemInfo(
+ codeLabel: 'scolarite.breadCrumbs.publipostage'
+ )
+ breadCrumbsInfo << new BreadCrumbsItemInfo(
+ codeLabel: 'eliot.scolarite.menu.publipostage.suiviParEleve.titrePrincipal'
+ )
+ return breadCrumbsInfo
+ }
+}
eliot.scolarite.menu.vieScolaire.titrePrincipal=Vie Scolaire
eliot.scolarite.menu.magistere.titrePrincipal=Vie Scolaire
eliot.scolarite.menu.parametrages.titrePrincipal=Paramétrages
+eliot.scolarite.menu.publipostage.titrePrincipal=Publipostage
eliot.scolarite.menu.parametrages.matieres=Matières
eliot.scolarite.menu.parametrages.accesVieScolaire=Accès vie scolaire
eliot.scolarite.menu.parametrages.calendrierHebdo.titrePrincipal=Calendrier hebdomadaire
eliot.scolarite.menu.parametrages.notification=Notifications
eliot.scolarite.menu.parametrages.niveau=Niveaux
eliot.scolarite.menu.parametrages.accesfonction=Accès aux fonctions
+eliot.scolarite.menu.publipostage.selection.titrePrincipal=Sélection
+eliot.scolarite.menu.publipostage.suiviParEleve.titrePrincipal=Suivi pas élève
+eliot.scolarite.menu.publipostage.suiviImpression.titrePrincipal=Suivi des impressions
+
+
## file ariane
filAriane.accueil=Scolarité de l''établissement {0} ({1})
scolarite.breadCrumbs.parametrage.calendrier.hebdo=Calendrier hebdomadaire
scolarite.breadCrumbs.parametrage.calendrier.annuel=Calendrier annuel
-
scolarite.breadCrumbs.parametrage.accesfonction=Accès aux fonctions
scolarite.breadCrumbs.parametrage.modeleDeDocument=Modèle de documents
scolarite.breadCrumbs.parametrage.creerModeleDeDocument=Création d'un modèle de documents
scolarite.breadCrumbs.parametrage.modifierModeleDeDocument=Modification d'un modèle de documents
scolarite.breadCrumbs.preferences=Préférences
+scolarite.breadCrumbs.publipostage.selection=Sélection
+scolarite.breadCrumbs.publipostage=Publipostage
+
+
scolarite.formulaire.titreDebut=Début
scolarite.formulaire.titreFin=Fin
eliot.scolarite.message.modifie.attention=Attention
eliot.scolarite.message.AutorisationException=Accès refusé
-eliot.scolarite.message.erreurInconnue=Pour des raisons techniques, votre requête n'a pas été prise en compte. Veuillez renouveler votre opération
eliot.scolarite.message.modificationNonEnregistree =Vous devez enregistrer ou annuler votre saisie avant de poursuivre.
eliot.libelle.utilisateur=Utilisateur
fonctionnalite.parametrage.SCOL_PARAM_TYP_ACT_DEV=Types activit\u00e9s/devoirs
fonctionnalite.parametrage.SCOL_PARAM_CAL_HEBDO_ANNU=Calendrier hebdomadaire/annuel
fonctionnalite.parametrage.SCOL_PARAM_MODELES_DOC=Mod\u00e8les de documents
+fonctionnalite.parametrage.SCOL_PUBLIPOSTAGE=Publipostage
fonctionnalite.parametrage.FICHE_ELEVE=Fiche \u00e9l\u00e8ve
fonctionnalite.parametrage.FICHE_ELEVE_COMMENTAIRE=Commentaire
fonctionnalite.parametrage.FICHE_ELEVE_ABSENCES=Absences
scolarite.parametrage.fonctionnalite.fonction.modifieEchec=La modification des fonctionnalités par fonctions a échoué.
scolarite.parametrage.fonctionnalite.utilisateur.modifieSucces=Utilisateur enregistrés avec succès.
-menu.etablissement.titre=Etablissements
\ No newline at end of file
+menu.etablissement.titre=Etablissements
+
+eliot.publipostage.selectionAdresse.responsable1=Responsable 1
+eliot.publipostage.selectionAdresse.responsable2=Responsable 2
+eliot.publipostage.selectionAdresse.adresse2Responsables=Responsable 1 et 2
+
+eliot.libelle.nomPrenom=Non prénom
+eliot.libelle.classes=Classes
+eliot.libelle.adresse=Adresse
+eliot.libelle.cpVille=Cp - Ville
+eliot.libelle.responsable=Responsable
+eliot.libelle.rechercher=Rechercher
+eliot.libelle.tous=Tous
+eliot.libelle.listeEleve=Liste d'élèves
+eliot.libelle.publiposter=Publiposter
+
+
+eliot.publipostage.message.adresseInvalide=Les adresses des parents des élèves signalés en rouge sont vides ou incomplètes.
+eliot.publipostage.message.infoResponsable2=Seuls les élèves ayant un responsable 2 avec une adresse différente du responsable 1 sont cochés par défaut.
+eliot.publipostage.message.demandeAjouteOK=La demande d'impression a été ajoutée avec succès.
+eliot.publipostage.message.demandeAjouteKO=Une erreur s'est produite lors de l'enregistrement de la demande d'impression.
+eliot.publipostage.message.rechercheKO=Une erreur s'est produite lors de la recherche.
+
+eliot.libelle.titreErreur=Erreur
+eliot.libelle.titreSuccess=Confirmation
+eliot.libelle.dateDebut=Date de début
+eliot.libelle.dateFin=date de fin
+eliot.libelle.statuts=Statuts
+eliot.libelle.actualiser=Actualiser
+eliot.libelle.supprimer=Supprimer
+
+demande.traitement.statut.enAttente=En attente
+demande.traitement.statut.enCours=En cours
+demande.traitement.statut.terminee=Terminé
+demande.traitement.statut.erreur=Erreur
+demande.traitement.statut.annulee=Annulé
+demande.traitement.statut.supprimee=Supprimmé
+eliot.libelle.datesIncorrectes= Les dates sont incorrectes. La date de fin doit être supérieure ou égale à la date de début
+
+scolarite.suiviimpression.dateHeure=Date heure
+scolarite.suiviimpression.support=Support
+scolarite.suiviimpression.nomImpression=Nom de l'impression
+scolarite.suiviimpression.statut=Statut
+scolarite.suiviimpression.document=Document
+scolarite.suiviimpression.dateDuDocument=Date du document
+scolarite.suiviImpression.suppressionEchec=La suppression a échoué. La demande d'impression est en cours de traitement ou a déjà été supprimée.
+scolarite.suiviImpression.docNonDisponible=Le document n'est pas disponible
+eliot.suiviImpression.suppressionTitre=Sélection impossible
+eliot.suiviImpression.suppressionMessage=Vous ne pouvez sélectionner pour la suppression que des demandes terminées ou en erreur.
+eliot.scolarite.message.erreurSuppression=Une erreur s'est produite. La suppression a été annulée.
+eliot.scolarite.message.supprime.succes=La suppression a été effectuée avec succès.
+
+
+scolarite.suivipareleve.dateDebut=Date de début
+scolarite.suivipareleve.dateFin=Date de fin
+scolarite.suivipareleve.classes=Classes
+scolarite.suivipareleve.modeles=Modèles
+scolarite.suivipareleve.chercher=Chercher
+scolarite.suivipareleve.dateHeure=Date heure
+scolarite.suivipareleve.nom=Nom
+scolarite.suivipareleve.classe=Classe
+scolarite.suivipareleve.support=Support
+scolarite.suivipareleve.modele=Modèle
+
ScolaritePage.PARAMETRAGE
),
+ PUBLIPOSTAGE(
+ 'eliot.scolarite.menu.publipostage.titrePrincipal',
+ ScolaritePage.PUBLIPOSTAGE
+ ),
+
ETABLISSEMENT(
'',
ScolaritePage.ETABLISSEMENT,
ScolaritePage.MAGISTERE,
MenuEntete.PARAMETRAGE_TITRE_PRINCIPAL,
SousMenuMagister
+ ),
+
+ PUBLIPOSTAGE_SELECTION(
+ 'eliot.scolarite.menu.publipostage.selection.titrePrincipal',
+ ScolaritePage.PUBLIPOSTAGE_SELECTION,
+ MenuEntete.PUBLIPOSTAGE
+ ),
+
+ PUBLIPOSTAGE_SUIVI_IMPRESSION(
+ 'eliot.scolarite.menu.publipostage.suiviImpression.titrePrincipal',
+ ScolaritePage.PUBLIPOSTAGE_SUIVI_IMPRESSION,
+ MenuEntete.PUBLIPOSTAGE
+ ),
+
+ PUBLIPOSTAGE_SUIVI_PAR_ELEVE(
+ 'eliot.scolarite.menu.publipostage.suiviParEleve.titrePrincipal',
+ ScolaritePage.PUBLIPOSTAGE_SUIVI_PAR_ELEVE,
+ MenuEntete.PUBLIPOSTAGE
)
+
public String codeLabel
public Object page
public MenuEntete menuEnteteEnum
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.scolarite.publipostage
+
+import org.lilie.services.eliot.annuaire.FonctionEnum
+import org.lilie.services.eliot.impression.constantes.TypeMedia
+import org.lilie.services.eliot.impression.donnees.eleve.EleveImpressionInfo
+import org.lilie.services.eliot.impression.donnees.eleve.SelectionAdresseResponsableEnum
+import org.lilie.services.eliot.impression.publipostage.PublipostageService
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+
+class ScolaritePublipostageService extends PublipostageService {
+
+ static transactional = true
+
+ List recherche(Etablissement etablissement,
+ List<StructureEnseignement> classes,
+ SelectionAdresseResponsableEnum destinataire,
+ TypeMedia typeMedia = TypeMedia.COURRIER) {
+
+ String hql = """
+ select pps.personne
+ from PersonneProprietesScolarite pps
+ inner join fetch pps.personne.autorite
+ inner join pps.proprietesScolarite ps
+ inner join ps.structureEnseignement se
+ where pps.proprietesScolarite.fonction.code = :fonctionCode
+ and pps.estActive = true
+ and se.etablissement = :etablissement
+ """
+
+ Map params = [
+ fonctionCode: FonctionEnum.ELEVE.getCode(),
+ etablissement: etablissement
+ ]
+
+ if (classes) {
+ hql += " and ps.structureEnseignement in (:structures)"
+ params.structures = classes
+ }
+
+ List<Personne> eleves = Personne.executeQuery(hql, params)
+
+ List<EleveImpressionInfo> eleveImpressionInfos = getEleveImpressionInfos(
+ etablissement,
+ eleves as Set,
+ destinataire,
+ typeMedia
+ )
+
+ return metEnFormeResultat(eleveImpressionInfos, destinataire)
+ }
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+
+
+package org.lilie.services.eliot.scolarite
+
+class ScolariteJsTagLib {
+
+ def setJsNs = { attr, body ->
+ request.setAttribute('jsNs', attr.value)
+ }
+
+ def setJsVar = { attr, body ->
+ request.setAttribute('jsVar', attr.value)
+ }
+
+ def setJsValue = { attr, body ->
+ def value = attr.value
+ if (value != null) {
+ out << getProperty(attr, request) + ' = \'' + value.encodeAsJavaScript() + '\';'
+ }
+ }
+
+ def setJsValueJson = { attr, body ->
+ def value = attr.value
+
+ if (value != null) {
+ out << getProperty(attr, request) + ' = ' + value + ';'
+ }
+ }
+
+ def setJsValueNumeric = { attr, body ->
+ def value = attr.value
+
+ if (value != null) {
+ out << getProperty(attr, request) + ' = ' + value.encodeAsJavaScript() + ';'
+ }
+ }
+
+ def setJsValueBoolean = setJsValueNumeric
+
+ def setJsValueMessage = { attr, body ->
+ def message = g.message(code: attr.code, args: attr.args)
+
+ if (message != null) {
+ if (attr.encoded == 'false') {
+ out << getProperty(attr, request) + ' = \'' + message + '\';'
+ }
+ else {
+ out << getProperty(attr, request) + ' = \'' + message.encodeAsJavaScript() + '\';'
+ }
+ }
+ }
+
+
+ def setJsValueLink = { attr, body ->
+ def link = createLink(action: attr.action, controller: attr.controller)
+
+ if (link) {
+ out << getProperty(attr, request) + ' = \'' + link.encodeAsJavaScript() + '\';'
+ }
+ }
+
+ def setJsValueResource = { attr, body ->
+ def ressource = resource(dir: attr.dir, file: attr.file)
+
+ if (ressource) {
+ out << getProperty(attr, request) + ' = \'' + ressource.encodeAsJavaScript() + '\';'
+ }
+ }
+
+ private String getProperty(def attr, def request) {
+ def ns = request.getAttribute('jsNs');
+ def var = request.getAttribute('jsVar');
+ def name = attr.name
+
+ def property = ''
+
+ if (ns) {
+ property = ns + '.'
+ }
+
+ if (var) {
+ property = property + var + '.'
+ }
+
+ property = property + name
+
+ return property
+ }
+
+}
src="${url(uri: 'js/commons/src/Toolbar.js')}">
</script>
+ <script type="text/javascript"
+ src="${url(uri: 'js/commons/src/Encoder.js')}">
+ </script>
+
%{-- --}%
<script type="text/javascript"
src="${url(uri: 'js/commons/src/BarreSuperieure.js')}">
<script type="text/javascript"
src="${url(uri: 'js/commons/src/decoder.js')}">
</script>
- <script type="text/javascript"
- src="${url(uri: 'js/commons/src/Encoder.js')}">
- </script>
<!-- Template pour les définitions des constantes -->
--- /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>.
+ --}%
+
+<g:javascript>
+
+ <eliotjs:ns name="eliot.scolarite.publipostage.selection.ConfigServeur">
+
+ <eliotjs:ns name="libelle">
+ <eliotjs:varI18n name="classes" code="eliot.libelle.classes"/>
+ <eliotjs:varI18n name="responsable" code="eliot.libelle.responsable"/>
+ <eliotjs:varI18n name="rechercher" code="eliot.libelle.rechercher"/>
+ <eliotjs:varI18n name="tous" code="eliot.libelle.tous"/>
+ <eliotjs:varI18n name="listeEleve" code="eliot.libelle.listeEleve"/>
+ <eliotjs:varI18n name="modele" code="eliot.scolarite.libelle.modele"/>
+ <eliotjs:varI18n name="publiposter" code="eliot.libelle.publiposter"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="message">
+ <eliotjs:varI18n name="adresseInvalide"
+ code="eliot.publipostage.message.adresseInvalide"/>
+ <eliotjs:varI18n name="infoResponsable2"
+ code="eliot.publipostage.message.infoResponsable2"/>
+ <eliotjs:varI18n name="titreSuccess"
+ code="eliot.libelle.titreSuccess"/>
+ <eliotjs:varI18n name="titreErreur"
+ code="eliot.libelle.titreErreur"/>
+ <eliotjs:varI18n name="demandeAjouteOK"
+ code="eliot.publipostage.message.demandeAjouteOK"/>
+ <eliotjs:varI18n name="demandeAjouteKO"
+ code="eliot.publipostage.message.demandeAjouteKO"/>
+ <eliotjs:varI18n name="rechercheKO"
+ code="eliot.publipostage.message.rechercheKO"/>
+
+ </eliotjs:ns>
+
+ <eliotjs:ns name="header">
+ <eliotjs:varI18n name="nomPrenom" code="eliot.libelle.nomPrenom"/>
+ <eliotjs:varI18n name="classes" code="eliot.libelle.classes"/>
+ <eliotjs:varI18n name="responsable" code="eliot.libelle.responsable"/>
+ <eliotjs:varI18n name="adresse" code="eliot.libelle.adresse"/>
+ <eliotjs:varI18n name="cpVille" code="eliot.libelle.cpVille"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="data">
+ <eliotjs:varJson name="classes" value="${structureEnseignements}"/>
+ <eliotjs:varJson name="responsables" value="${adresseDestinataires}"/>
+ <eliotjs:varJson name="modeles" value="${modeleDocuments}"/>
+ <eliotjs:varNumeric name="seuilImpression" value="${seuil}"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="url">
+ <eliotjs:varLink name="rechercher" action="recherche"
+ controller="publipostage"/>
+
+ <eliotjs:varLink name="publiposteDirecte" action="publiposteDirecte"
+ controller="publipostage"/>
+
+ <eliotjs:varLink name="publiposteDiffere" action="publiposteDiffere"
+ controller="publipostage"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="icon">
+ <eliotjs:varResource name="rechercher" dir="images"
+ file="rechercher.gif"/>
+ </eliotjs:ns>
+
+ </eliotjs:ns>
+
+</g:javascript>
+
--- /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>.
+ --}%
+
+<%--
+ Created by IntelliJ IDEA.
+ User: bah
+ Date: 03/11/14
+ Time: 11:32
+ To change this template use File | Settings | File Templates.
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" %>
+<html>
+<head>
+ <title>Publipostage - Sélection</title>
+
+ <meta name="layout" content="eliot.simple.extjs.3.2.0">
+
+ <link rel="stylesheet" type="text/css"
+ href="${resource(dir: 'js/lib/extensionsextjs/lovcombo', file: 'Ext.ux.form.LovCombo.css')}"/>
+
+
+ <g:javascript library="src/views/publipostage/selection/Constantes"/>
+ <g:javascript library="src/views/publipostage/selection/ConfigServeur"/>
+
+ <g:render template="/publipostage/selection/modele"/>
+
+
+ <g:javascript library="src/views/commun/Message"/>
+ <g:javascript library="lib/extensionsextjs/lovcombo/Ext.ux.form.LovCombo"/>
+ <g:javascript library="src/views/commun/LovComboView"/>
+ <g:javascript library="src/views/publipostage/selection/CriteresView"/>
+ <g:javascript library="src/views/publipostage/selection/ResultatsView"/>
+ <g:javascript library="src/views/publipostage/selection/PublipostageView"/>
+ <g:javascript library="src/views/publipostage/selection/SelectionController"/>
+ <g:javascript library="src/views/publipostage/selection/Application"/>
+
+</head>
+
+<body>
+%{-- Message --}%
+<div id="messages" class="portal-messages"/>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+%{--
+ - Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ - This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ -
+ - Lilie is free software. You can redistribute it and/or modify since
+ - you respect the terms of either (at least one of the both license) :
+ - under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ - License, or any later version
+ -
+ - There are special exceptions to the terms and conditions of the
+ - licenses as they are applied to this software. View the full text of
+ - the exception in file LICENSE.txt in the directory of this software
+ - distribution.
+ -
+ - Lilie is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - Licenses for more details.
+ -
+ - You should have received a copy of the GNU General Public License
+ - and the CeCILL-C along with Lilie. If not, see :
+ - <http://www.gnu.org/licenses/> and
+ - <http://www.cecill.info/licences.fr.html>.
+ --}%
+
+<g:javascript>
+
+ <eliotjs:ns name="eliot.scolarite.publipostage.suiviimpression.ConfigServeur">
+
+ <eliotjs:ns name="libelle">
+ <eliotjs:varI18n name="dateDebut" code="eliot.libelle.dateDebut"/>
+ <eliotjs:varI18n name="dateFin" code="eliot.libelle.dateFin"/>
+ <eliotjs:varI18n name="statuts" code="eliot.libelle.statuts"/>
+ <eliotjs:varI18n name="chercher" code="eliot.libelle.rechercher"/>
+ <eliotjs:varI18n name="actualiser" code="eliot.libelle.actualiser"/>
+ <eliotjs:varI18n name="supprimer" code="eliot.libelle.supprimer"/>
+ <eliotjs:varI18n name="tous" code="eliot.libelle.tous"/>
+ <eliotjs:varI18n name="supprimer" code="eliot.libelle.supprimer"/>
+ <eliotjs:varI18n name="actualiser" code="eliot.libelle.actualiser"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="header">
+ <eliotjs:varI18n name="dateHeure"
+ code="scolarite.suiviimpression.dateHeure"/>
+ <eliotjs:varI18n name="support" code="scolarite.suiviimpression.support"/>
+ <eliotjs:varI18n name="nomimpression"
+ code="scolarite.suiviimpression.nomImpression"/>
+ <eliotjs:varI18n name="statut" code="scolarite.suiviimpression.statut"/>
+ <eliotjs:varI18n name="telechargerDoc"
+ code="scolarite.suiviimpression.document"/>
+ <eliotjs:varI18n name="dateDuDocument"
+ code="scolarite.suiviimpression.dateDuDocument"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="message">
+ <eliotjs:varI18n name="datesIncorrectes"
+ code="eliot.libelle.datesIncorrectes"/>
+ <eliotjs:varI18n name="docNonDisponible"
+ code="scolarite.suiviImpression.docNonDisponible"/>
+ <eliotjs:varI18n name="suppressionTitre"
+ code="eliot.suiviImpression.suppressionTitre"/>
+ <eliotjs:varI18n name="suppressionMessage"
+ code="eliot.suiviImpression.suppressionMessage"/>
+ <eliotjs:varI18n name="suppressionSucces"
+ code="eliot.scolarite.message.supprime.succes"/>
+ <eliotjs:varI18n name="erreurSuppression"
+ code="eliot.scolarite.message.erreurSuppression"/>
+ <eliotjs:varI18n name="erreurInconnue"
+ code="eliot.scolarite.messages.erreurInconnue"/>
+ <eliotjs:varI18n name="rechercheKO"
+ code="eliot.publipostage.message.rechercheKO"/>
+ </eliotjs:ns>
+
+
+ <eliotjs:ns name="data">
+ <eliotjs:varString name="dateDebut" value="${dateDebut}"/>
+ <eliotjs:varString name="dateFin" value="${dateFin}"/>
+ <eliotjs:varJson name="statuts" value="${statuts}"/>
+ <eliotjs:varJson name="anneeScolaire" value="${anneeScolaire}"/>
+ <eliotjs:varNumeric name="nbLigneParPage" value="${nbLigneParPage}"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="url">
+ <eliotjs:varLink name="rechercher" action="getSuiviImpression"
+ controller="suiviImpression"/>
+
+ <eliotjs:varLink name="telechargeDocument" action="getFichier"
+ controller="suiviImpression"/>
+
+ <eliotjs:varLink name="supprimer" action="supprimeDemandes"
+ controller="suiviImpression"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="icon">
+ <eliotjs:varResource name="rechercher" dir="images"
+ file="rechercher.gif"/>
+
+ <eliotjs:varResource name="telechargerDoc" dir="images"
+ file="download_doc2.gif"/>
+
+ <eliotjs:varResource name="docNonDispo" dir="images"
+ file="Sans_Document.gif"/>
+
+ <eliotjs:varResource name="supprimer" dir="images"
+ file="delete.gif"/>
+
+ <eliotjs:varResource name="actualiser" dir="images"
+ file="refresh.gif"/>
+ </eliotjs:ns>
+
+ </eliotjs:ns>
+
+</g:javascript>
+
--- /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>.
+ --}%
+
+
+
+<%--
+ Created by IntelliJ IDEA.
+ User: bah
+ Date: 03/11/14
+ Time: 11:32
+ To change this template use File | Settings | File Templates.
+--%>
+
+<%@ page contentType="text/html;charset=UTF-8" %>
+<html>
+<head>
+ <title>Publipostage - Suivi des impressions</title>
+
+
+ <meta name="layout" content="eliot.simple.extjs.3.2.0">
+
+ <link rel="stylesheet" type="text/css"
+ href="${resource(dir: 'js/lib/extensionsextjs/lovcombo', file: 'Ext.ux.form.LovCombo.css')}"/>
+
+ <g:javascript library="src/views/publipostage/suiviimpression/Constantes"/>
+ <g:javascript library="src/views/publipostage/suiviimpression/ConfigServeur"/>
+
+ <g:render template="/publipostage/suiviimpression/modele"/>
+
+
+ <g:javascript library="src/views/commun/Message"/>
+ <g:javascript library="lib/extensionsextjs/lovcombo/Ext.ux.form.LovCombo"/>
+ <g:javascript library="src/views/commun/LovComboView"/>
+ <g:javascript library="src/views/publipostage/suiviimpression/CriteresView"/>
+ <g:javascript library="src/views/publipostage/suiviimpression/ResultatsView"/>
+ <g:javascript
+ library="src/views/publipostage/suiviimpression/SuiviController"/>
+ <g:javascript library="src/views/publipostage/suiviimpression/Application"/>
+
+</head>
+
+<body>
+
+%{-- Message --}%
+<div id="messages" class="portal-messages"/>
+</body>
+</html>
\ No newline at end of file
--- /dev/null
+%{--
+ - Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ - This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ -
+ - Lilie is free software. You can redistribute it and/or modify since
+ - you respect the terms of either (at least one of the both license) :
+ - - under the terms of the GNU Affero General Public License as
+ - published by the Free Software Foundation, either version 3 of the
+ - License, or (at your option) any later version.
+ - - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ - License, or any later version
+ -
+ - There are special exceptions to the terms and conditions of the
+ - licenses as they are applied to this software. View the full text of
+ - the exception in file LICENSE.txt in the directory of this software
+ - distribution.
+ -
+ - Lilie is distributed in the hope that it will be useful,
+ - but WITHOUT ANY WARRANTY; without even the implied warranty of
+ - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ - Licenses for more details.
+ -
+ - You should have received a copy of the GNU General Public License
+ - and the CeCILL-C along with Lilie. If not, see :
+ - <http://www.gnu.org/licenses/> and
+ - <http://www.cecill.info/licences.fr.html>.
+ --}%
+
+<html>
+ <head>
+ <meta name="layout" content="eliot.simple.extjs.3.2.0">
+ <title><g:message code="eliot.scolarite.menu.publipostage.suiviParEleve.titrePrincipal"/></title>
+ <g:render template="/loadingMask"></g:render>
+
+ <link rel="stylesheet" type="text/css" href="${resource(dir: 'js/lib/extensionsextjs/lovcombo', file: 'Ext.ux.form.LovCombo.css')}"/>
+
+ <g:javascript library="src/views/publipostage/suivipareleve/Constantes"/>
+ <g:javascript library="src/views/publipostage/suivipareleve/ConfigServeur"/>
+
+ <g:javascript>
+
+ <g:setJsNs value="eliot.scolarite.publipostage.suivipareleve"/>
+
+ // Messages
+ <g:setJsVar value="ConfigServeur.messages"/>
+ <g:setJsValueMessage name="erreurRecherche" code="eliot.scolarite.messages.erreurInconnue"/>
+ <g:setJsValueMessage name="erreurDesDates" code="eliot.libelle.datesIncorrectes"/>
+
+ // Url
+ <g:setJsVar value="ConfigServeur.url"/>
+ <g:setJsValueLink name="recherche" controller="suiviEleve" action="recherche"/>
+
+ // Libellés
+ <g:setJsVar value="ConfigServeur.libelle"/>
+ <g:setJsValueMessage name="dateDebut" code="scolarite.suivipareleve.dateDebut"/>
+ <g:setJsValueMessage name="dateFin" code="scolarite.suivipareleve.dateFin"/>
+ <g:setJsValueMessage name="classes" code="scolarite.suivipareleve.classes"/>
+ <g:setJsValueMessage name="modeles" code="scolarite.suivipareleve.modeles"/>
+ <g:setJsValueMessage name="chercher" code="scolarite.suivipareleve.chercher"/>
+
+ <g:setJsValueMessage name="dateHeure" code="scolarite.suivipareleve.dateHeure"/>
+ <g:setJsValueMessage name="nom" code="scolarite.suivipareleve.nom"/>
+ <g:setJsValueMessage name="classe" code="scolarite.suivipareleve.classe"/>
+ <g:setJsValueMessage name="support" code="scolarite.suivipareleve.support"/>
+ <g:setJsValueMessage name="modele" code="scolarite.suivipareleve.modele"/>
+
+ // Icônes
+ <g:setJsVar value="ConfigServeur.icon"/>
+ <g:setJsValueResource name="chercher" dir="images" file="rechercher.gif"/>
+
+ // Data
+ <g:setJsVar value="ConfigServeur.data"/>
+ <g:setJsValueJson name="classes" value="${classes}"/>
+ <g:setJsValueJson name="modeles" value="${modeles}"/>
+ <g:setJsValueJson name="anneeScolaire" value="${anneeScolaire}"/>
+ <g:setJsValueJson name="nbLigneParPage" value="${nombreLignesParPage}"/>
+
+ </g:javascript>
+
+ <g:javascript library="src/views/commun/Message"/>
+
+ <g:javascript library="lib/extensionsextjs/lovcombo/Ext.ux.form.LovCombo"/>
+ <g:javascript library="src/views/commun/LovComboView"/>
+
+
+ <g:javascript library="src/views/publipostage/suivipareleve/HistoriqueController"/>
+ <g:javascript library="src/views/publipostage/suivipareleve/HistoriqueView"/>
+
+ <g:javascript library="src/views/publipostage/suivipareleve/Application"/>
+
+ </head>
+ <body>
+ %{-- Message --}%
+ <div id="messages" class="portal-messages"/>
+ </body>
+</html>
\ No newline at end of file
* @version $Id: Ext.ux.form.LovCombo.js 285 2008-06-06 09:22:20Z jozo $
*
* @license Ext.ux.form.LovCombo.js is licensed under the terms of the Open Source
- * LGPL 3.0 license. Commercial use is permitted to the extent that the
+ * LGPL 3.0 license. Commercial use is permitted to the extent that the
* code/component(s) do NOT become part of another Open Source or Commercially
* licensed development library or toolkit without explicit permission.
- *
+ *
* License details: http://www.gnu.org/licenses/lgpl.html
*/
-
+
/*global Ext */
// add RegExp.escape if it has not been already added
// create namespace
Ext.ns('Ext.ux.form');
-
+
/**
*
* @class Ext.ux.form.LovCombo
* Change it only if it collides with your normal field.
*/
checkField:'checked'
-
+
/**
* @cfg {String} separator separator to use between values and texts
*/
,separator:','
/**
- * @cfg {String/Array} tpl Template for items.
+ * @cfg {String/Array} tpl Template for items.
* Change it only if you know what you are doing.
*/
// }}}
// {{{
,initComponent:function() {
-
+
// template with checkbox
if(!this.tpl) {
- this.tpl =
+ this.tpl =
'<tpl for=".">'
+'<div class="x-combo-list-item">'
+'<img src="' + Ext.BLANK_IMAGE_URL + '" '
}
-
+
// call parent
Ext.ux.form.LovCombo.superclass.initComponent.apply(this, arguments);
this.el.dom.value = v;
}
});
-
+
} // e/o function initComponent
// }}}
// {{{
*/
,deselectAll:function() {
this.clearValue();
- } // eo full deselectAll
+ } // eo full deselectAll
// }}}
}); // eo extend
-
+
// register xtype
-Ext.reg('lovcombo', Ext.ux.form.LovCombo);
-
+Ext.reg('lovcombo', Ext.ux.form.LovCombo);
+
// eof
--- /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>.
+ */
+
+/**
+ * Composant graphique qui permet de sélectionner
+ * plusieurs élément dans une liste
+ *
+ * Utilisé pour les quatres critères de recherche suivants :
+ * - Type d'absence
+ * - Classe
+ * - Groupe de motif
+ * - Motif
+ * - Eleves
+ * @author bahj
+ * @author ywan
+ */
+
+Ext.ns('eliot.scolarite.commons');
+
+eliot.scolarite.commons.LovComboViewConstantes = {
+ eventId:{
+ actionValeurChange:'actionValeurChange'
+ }
+};
+
+eliot.scolarite.commons.LovComboViewModele = {
+ libelle:{
+ tous:'Tous'
+ }
+};
+
+
+eliot.scolarite.commons.LovComboView = Ext.extend(Ext.util.Observable, {
+ constructor:function (config) {
+ this.NameSpace = eliot.scolarite.commons;
+ this.addEvents(
+ /**
+ * @event déclenché lors de la seléction
+ * de nouvelles valeurs dans la liste
+ * @param newValue l'ensemble des identifiants des éléments choisis
+ */
+ this.NameSpace.LovComboViewConstantes.eventId.actionValeurChange,
+ /**
+ * @event actionMAJIdSelectionne est déclenché pour mettre à jours
+ * les éléments sélectionnés dans lovCombo
+ * @param nbData nombre d'éléments chargés
+ */
+ this.NameSpace.LovComboViewConstantes.eventId.actionMAJIdSelectionne
+ );
+ // Définition de la configuration par défaut
+ var defaultConfig = {
+ width:280,
+ label:'',
+ valeurInitiale:'-1',
+ defaultValue:'-1',
+ actifField:undefined,
+ disabled:false
+ };
+
+
+ // Charge la config passée en paramètre
+ Ext.applyIf(config, defaultConfig);
+ this.config = config;
+
+ this.lovCombo = new Ext.ux.form.LovCombo({
+ id:config.id,
+ store:config.store,
+ fieldLabel:config.label,
+ labelSeparator:' : ',
+ valueField:'id',
+ displayField:'libelle',
+ triggerAction:'all',
+ mode:'local',
+ value:config.valeurInitiale,
+ width:config.width,
+ editable:false,
+ disabled:config.disabled
+ });
+
+ if (this.config.actifField != null) {
+ this.lovCombo.tpl =
+ '<tpl for=".">'
+ + '<div class="x-combo-list-item">'
+ + '<img src="' + Ext.BLANK_IMAGE_URL + '" '
+ + 'class="ux-lovcombo-icon ux-lovcombo-icon-'
+ + '{[values.' + this.lovCombo.checkField + '?"checked":"unchecked"' + ']}">'
+ + '<div class="ux-lovcombo-item-text{[values.actif == false?" inactif":""]}"'
+ + '>{' + (this.lovCombo.displayField || 'text' ) + '}</div>'
+ + '</div>'
+ + '</tpl>'
+ ;
+ }
+
+ this.observeLovCombo();
+ },
+
+ observeLovCombo:function () {
+ this.lovCombo.addListener({
+ change:{
+ fn:function (combo, newValue, oldValue) {
+ if (!newValue) {
+ newValue = '-1';
+ combo.selectAll();
+ }
+ this.fireEvent(
+ this.NameSpace.LovComboViewConstantes.eventId.actionValeurChange,
+ newValue
+ )
+ },
+ scope:this
+ },
+
+ beforeselect:{
+ fn:function (combo, record, index) {
+ if (index !== 0) {
+ var tous = combo.store.getAt(0);
+ tous.set(combo.checkField, false);
+ }
+ },
+ scope:this
+ },
+
+ select:{
+ fn:function (combo, record, index) {
+ if (index == 0) {
+ if (record.data.checked) {
+ combo.selectAll();
+ } else {
+ combo.deselectAll();
+ }
+ } else {
+ var tous = combo.store.getAt(0);
+ tous.set(combo.checkField, false);
+ }
+ },
+ scope:this
+ },
+
+ afterrender:{
+ fn:function (combo) {
+ if (combo.store.getCount() != 0) {
+ combo.selectAll();
+ }
+ },
+ scope:this
+ }
+ });
+ }
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * Classe Application de la page sélection de publipostage
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.Application = function () {
+
+ var Clazz = Ext.extend(Ext.util.Observable, {
+
+ constructor:function () {
+
+ this.init();
+
+ var centerRegionItems = this.creeItems();
+
+ // Rendu du viewport
+ Ext.onReady(function () {
+ eliot.layout.doLayout(
+ 'viewPort',
+ 'northPanel',
+ 'centerPanel',
+ centerRegionItems
+ );
+ });
+ },
+
+ init:function () {
+ this.ns = eliot.scolarite.publipostage.selection;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ },
+
+ creeItems:function () {
+
+ var selectionController = new this.ns.SelectionController();
+
+ var criteresView = new this.ns.CriteresView({
+ storeClasses:selectionController.getClassesStore(),
+ storeResponsable:selectionController.getResponsableStore()
+ });
+ selectionController.observeCriteresView(criteresView);
+
+
+ var resultatsView = new this.ns.ResultatsView({
+ resultatStore:selectionController.resultatsStore
+ });
+ selectionController.observeResultatsView(resultatsView);
+
+
+ var publipostageView = new this.ns.PublipostageView({
+ modeleStore:selectionController.getModeleStore()
+ });
+ publipostageView.observeSelectionController(selectionController);
+ selectionController.observePublipostageView(publipostageView);
+
+
+ return {
+ xtype:'panel',
+ layout:'border',
+ defaults:{
+ border:false
+ },
+ items:[
+ {
+ region:'north',
+ height:35,
+ items:criteresView.panel
+ },
+ {
+ region:'center',
+ layout:'fit',
+ items:resultatsView.panel
+ },
+ {
+ region:'south',
+ height:80,
+ items:publipostageView.panel
+ }
+ ]
+ };
+ }
+
+ });
+ // Construit l'instance singleton
+ return new Clazz();
+}();
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+
+/**
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.ConfigServeur = {
+
+ libelle:{
+ classes:undefined,
+ responsable:undefined,
+ listeEleve:undefined,
+ modele:undefined,
+ publiposter:undefined
+ },
+
+ message:{
+ adresseInvalide:undefined,
+ infoResponsable2:undefined,
+ demandeAjouteKO:undefined,
+ demandeAjouteOK:undefined,
+ titreSuccess:undefined,
+ titreErreur:undefined,
+ rechercheKO:undefined
+ },
+
+ data:{
+ classes:undefined,
+ responsables:undefined,
+ modeles:undefined,
+ seuilImpression:undefined
+ },
+
+ header:{
+ nomPrenom:undefined,
+ classes:undefined,
+ responsable:undefined,
+ adresse:undefined,
+ cpVille:undefined
+ },
+
+ url:{
+ rechercher:undefined,
+ publiposter:undefined,
+ publiposteDirecte:undefined,
+ publiposteDiffere:undefined
+ },
+
+ icon:{
+ rechercher:undefined
+ }
+
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.Constantes = {
+ eventId:{
+ actionChercher:'actionChercher',
+ actionPubliposter:'actionPubliposter',
+ critereChange:'critereChange',
+ selectionChange:'selectionChange',
+ modeleChange:'modeleChange',
+ activePubliposter:'activePubliposter',
+ actionAfficheEleveInvalide:'actionAfficheEleveInvalide',
+ updateZoneMessage:'updateZoneMessage'
+ },
+
+ valeurParDefaut:{
+ responsable:'ADRESSE_DES_RESPONSABLES',
+ classe:'-1'
+ },
+
+ dataIndex:{
+ nomPrenom:'nomPrenom',
+ classe:'classe',
+ responsable:'responsable',
+ adresse:'adresse',
+ selection:'selection',
+ id:'id',
+ valide:'valide',
+ cpVille:'cpVille'
+ }
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+
+/**
+ * Classe view des critères de recherche
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.CriteresView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.init(config);
+ this.creeItems();
+ },
+
+ init:function (config) {
+ this.ns = eliot.scolarite.publipostage.selection;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ this.config = Ext.apply(this.creeConfig(), config);
+
+ this.addEvents(
+ this.Constantes.eventId.actionChercher,
+
+ this.Constantes.eventId.critereChange
+ );
+ },
+
+ creeConfig:function () {
+ this.config = {
+ classes:this.Constantes.valeurParDefaut.classe,
+ responsable:this.Constantes.valeurParDefaut.responsable,
+ storeClasses:undefined,
+ storeResponsable:undefined
+ };
+ return this.config;
+ },
+
+ creeItems:function () {
+
+ var classesLovCombo = new eliot.scolarite.commons.LovComboView({
+ ajoutItemTous:true,
+ store:this.config.storeClasses,
+ label:this.ConfigServeur.libelle.classes,
+ width:180,
+ valeurInitiale:this.config.classes
+ });
+ this.observeClassesLovCombo(classesLovCombo);
+
+ var responsableCombo = new Ext.form.ComboBox({
+ width:160,
+ store:this.config.storeResponsable,
+ fieldLabel:this.ConfigServeur.libelle.responsable,
+ labelSeparator:' : ',
+ triggerAction:'all',
+ selectOnFocus:true,
+ forceSelection:true,
+ mode:'local',
+ valueField:'id',
+ displayField:'libelle',
+ editable:false,
+ value:this.config.responsable,
+ listeners:{
+ select:{
+ fn:function (combo, record) {
+ this.config.responsable = record.id;
+ this.notifieCriteresChange();
+ },
+ scope:this
+ }
+ }
+ });
+
+ var chercherBouton = new Ext.Button({
+ width:90,
+ icon:this.ConfigServeur.icon.rechercher,
+ text:this.ConfigServeur.libelle.rechercher,
+ handler:this.actionChercher,
+ scope:this
+ });
+
+ this.panel = new Ext.Panel({
+ height:50,
+ border:false,
+ frame:true,
+ layout:'column',
+ defaults:{
+ layout:'form',
+ labelAlign:'right',
+ labelSeparator:' : '
+ },
+ items:[
+ {
+ width:300,
+ items:classesLovCombo.lovCombo
+ },
+ {
+ width:300,
+ items:responsableCombo
+
+ } ,
+ {
+ width:150,
+ items:chercherBouton
+ }
+ ]
+ });
+ },
+
+ observeClassesLovCombo:function (classesLovCombo) {
+ classesLovCombo.addListener(
+ 'actionValeurChange',
+ function (newValue) {
+ this.config.classes = newValue;
+ this.notifieCriteresChange();
+ },
+ this
+ )
+ },
+
+ actionChercher:function () {
+ this.fireEvent(
+ this.Constantes.eventId.actionChercher,
+ this.config.classes,
+ this.config.responsable
+ )
+ },
+
+ notifieCriteresChange:function () {
+ this.fireEvent(
+ this.Constantes.eventId.critereChange
+ );
+ }
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * Classe view du choix de modèle et de publiposter
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.PublipostageView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.init(config);
+ this.creeItems();
+ },
+
+ init:function (config) {
+ this.ns = eliot.scolarite.publipostage.selection;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ this.config = Ext.apply(this.creeConfig(), config);
+
+ this.addEvents(
+ this.Constantes.eventId.actionPubliposter,
+
+ this.Constantes.eventId.modeleChange
+ );
+
+ },
+
+ creeConfig:function () {
+ this.config = {
+ modeleStore:undefined
+ };
+ return this.config;
+ },
+
+ creeItems:function () {
+
+ var modeleBox = new Ext.form.ComboBox({
+ width:250,
+ store:this.config.modeleStore,
+ fieldLabel:this.ConfigServeur.libelle.modele,
+ labelSeparator:' : ',
+ triggerAction:'all',
+ selectOnFocus:true,
+ forceSelection:true,
+ mode:'local',
+ valueField:'id',
+ displayField:'libelle',
+ editable:false,
+ value:this.config.responsable,
+ listeners:{
+ select:{
+ fn:function (combo, record) {
+ this.fireEvent(
+ this.Constantes.eventId.modeleChange,
+ record.id
+ )
+ },
+ scope:this
+ }
+ }
+ });
+
+
+ this.publiposterBouton = new Ext.Button({
+ width:90,
+ text:this.ConfigServeur.libelle.publiposter,
+ disabled:true,
+ handler:this.actionPubliposter,
+ scope:this
+ });
+
+ this.messagePanel = new Ext.Panel({
+ html:'',
+ border:false,
+ frame:false,
+ height:40
+ });
+
+ this.panel = new Ext.Panel({
+ bodyStyle:'padding:10px 20px 10px 20px',
+ border:false,
+ items:[
+ {
+ layout:'column',
+ border:false,
+ defaults:{
+ border:false
+ },
+ items:[
+ {
+ width:700,
+ layout:'form',
+ labelWidth:80,
+ items:modeleBox
+ },
+ {
+ width:150,
+ items:this.publiposterBouton
+ }
+ ]
+ },
+ this.messagePanel
+ ]
+ });
+ },
+
+ observeSelectionController:function (selectionController) {
+ selectionController.addListener(
+ this.Constantes.eventId.critereChange,
+ this.actionCritereChange,
+ this
+ );
+
+ selectionController.addListener(
+ this.Constantes.eventId.activePubliposter,
+ this.activePubliposter,
+ this
+ );
+
+
+ selectionController.addListener(
+ this.Constantes.eventId.updateZoneMessage,
+ this.updateMessage,
+ this
+ );
+ },
+
+
+ actionPubliposter:function () {
+ this.fireEvent(
+ this.Constantes.eventId.actionPubliposter
+ );
+ },
+
+ actionCritereChange:function () {
+ this.disablePubliposateButton();
+
+ this.updateMessage(undefined, undefined);
+ },
+
+ updateMessage:function (message1, message2) {
+ if (!message1 && !message2) {
+ this.messagePanel.update('');
+ return;
+ }
+
+ var message = '<div style="color:red;font-size: 12px;">' + message1 + '</div></p>';
+
+ if (message2) {
+ message += '<div style="color:black;font-size: 12px;">' + message2 + '</div></p>';
+ }
+
+ this.messagePanel.update(message);
+ },
+
+ disablePubliposateButton:function () {
+ this.publiposterBouton.disable();
+ },
+
+ activePubliposter:function (active) {
+ if (active) {
+ this.publiposterBouton.enable();
+ } else {
+ this.disablePubliposateButton();
+ }
+ }
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * Classe de présentation des résultats de recherche
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.ResultatsView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.init(config);
+ this.creeItems();
+ this.observe();
+ },
+
+ init:function (config) {
+ this.ns = eliot.scolarite.publipostage.selection;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ this.config = Ext.apply(this.creeConfig(), config);
+
+ this.addEvents(this.Constantes.eventId.selectionChange);
+ },
+
+ creeConfig:function () {
+ this.config = {
+ resultatStore:undefined
+ };
+ return this.config;
+ },
+
+ creeItems:function () {
+
+ this.creeGrille();
+
+ this.creeCompteurSelection();
+
+ this.panel = new Ext.Panel({
+ bodyStyle:'padding:10px 20px 10px 20px',
+ border:false,
+ items:[
+ {
+ layout:'form',
+ border:false,
+ labelWidth:90,
+ items:this.compteur
+ },
+ this.grid
+ ]
+ });
+ },
+
+ observe:function () {
+ this.grid.store.addListener({
+ load:{
+ fn:function () {
+ this.selectionneParDefaut();
+ this.setHeaderCheckboxChecked();
+ },
+ scope:this
+ }
+ });
+
+ this.grid.getSelectionModel().addListener({
+ rowselect:{
+ fn:function (checkbox, rowIndex, record) {
+ this.actionSelectionChange(record);
+ },
+ scope:this
+ },
+ rowdeselect:{
+ fn:function (checkbox, rowIndex, record) {
+ this.actionSelectionChange(record);
+ },
+ scope:this
+ }
+ });
+ },
+
+
+ actionSelectionChange:function (recordSelected) {
+ this.setValue(
+ this.getNbrCheckedRows(),
+ this.getNbrTotalRows()
+ );
+
+ this.fireEvent(
+ this.Constantes.eventId.selectionChange,
+ this.grid.getSelectionModel().getSelections()
+ )
+ },
+
+ selectionneParDefaut:function () {
+ if (this.grid.store.getCount() > 0) {
+ this.grid.store.each(
+ function (record) {
+ var valide = Ext.util.Format.undef(record.get('valide'));
+ if (record.get('selection') && (valide || valide === '')) {
+ var index = this.grid.store.indexOf(record);
+ this.grid.getSelectionModel().selectRow(
+ index,
+ true
+ );
+ }
+ },
+ this
+ );
+ }
+ },
+
+ creeGrille:function () {
+ var checkBox = new Ext.grid.CheckboxSelectionModel({
+ singleSelect:false,
+ checkOnly:true,
+ width:23
+ });
+
+ var cm = this.getColumnModele(checkBox);
+
+ this.grid = new Ext.grid.GridPanel({
+ store:this.config.resultatStore,
+ enableColumnMove:false,
+ enableColumnResize:true,
+ enableHdMenu:false,
+ height:360,
+ width:870,
+ border:true,
+ columnLines:true,
+ stripeRows:true,
+ selModel:checkBox,
+ cm:cm
+ });
+ },
+
+
+ getColumnModele:function (checkBox) {
+ return new Ext.grid.ColumnModel({
+ defaults:{
+ sortable:false
+ },
+ columns:[
+ checkBox,
+ {
+ header:this.createHeader(this.ConfigServeur.header.nomPrenom),
+ dataIndex:this.Constantes.dataIndex.nomPrenom,
+ width:140,
+ renderer:this.rendererEleve,
+ scope:this
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.classes),
+ dataIndex:this.Constantes.dataIndex.classe,
+ width:60,
+ renderer:this.rendererChamp,
+ scope:this
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.responsable),
+ dataIndex:this.Constantes.dataIndex.responsable,
+ width:160,
+ renderer:this.rendererChamp,
+ scope:this
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.adresse),
+ dataIndex:this.Constantes.dataIndex.adresse,
+ width:230,
+ renderer:this.rendererChamp,
+ scope:this
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.cpVille),
+ dataIndex:this.Constantes.dataIndex.cpVille,
+ width:220,
+ renderer:this.rendererChamp,
+ scope:this
+ }
+ ]
+ });
+ },
+
+ createHeader:function (libelle) {
+ return '<span style="font-weight: normal;white-space: normal; ">' +
+ libelle +
+ '</span>';
+ },
+
+ rendererChamp:function (val, obj, record) {
+ if (!record.get('valide')) {
+ return '<font color="red">' + val + '</font>'
+ } else {
+ return val;
+ }
+ },
+
+ rendererEleve:function (val, obj, record) {
+ if (record.get('valide')) {
+ return val;
+ }
+
+ this.fireEvent(
+ this.Constantes.eventId.actionAfficheEleveInvalide,
+ record.get('responsableNum')
+ );
+
+ return '<font color="red">' + val + '</font>';
+
+ },
+
+ creeCompteurSelection:function () {
+ this.compteur = new Ext.form.TextField({
+ value:'(0/0) :',
+ fieldLabel:this.ConfigServeur.libelle.listeEleve,
+ readOnly:true,
+ labelSeparator:'',
+ width:300,
+ height:20,
+ style:{
+ borderStyle:'none',
+ backgroundImage:'none',
+ color:'#3F61A0',
+ fontSize:'1em',
+ fontWeight:'bold'
+ }
+ });
+ },
+
+ setValue:function (nbrSelectionne, nbrTotal) {
+ this.compteur.setValue('(' + nbrSelectionne + '/' + nbrTotal + ') :')
+ },
+
+ getNbrCheckedRows:function () {
+ return this.grid.getSelectionModel().getCount();
+ },
+
+ getNbrTotalRows:function () {
+ return this.grid.store.getCount();
+ },
+
+ /**
+ * Permet de sélectionner ou désélectionner la checkbox dans l'entête
+ */
+ setHeaderCheckboxChecked:function () {
+ var headerCell = this.grid.getView().getHeaderCell(0);
+ var headerCB = Ext.getDom(headerCell).childNodes[0];
+ var isChecked = Ext.fly(headerCB).hasClass('x-grid3-hd-checker-on');
+
+ if (
+ !isChecked &&
+ this.getNbrCheckedRows() > 0
+ && (this.getNbrCheckedRows() == this.getNbrTotalRows())
+
+ ) {
+ Ext.fly(headerCB).addClass('x-grid3-hd-checker-on');
+ } else if (isChecked && !this.getNbrCheckedRows() > 0) {
+ Ext.fly(headerCB).removeClass('x-grid3-hd-checker-on');
+ }
+ }
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.selection');
+
+eliot.scolarite.publipostage.selection.SelectionController = Ext.extend(Ext.util.Observable, {
+
+ constructor:function () {
+ this.init();
+ this.creeItems();
+ },
+
+ init:function () {
+ this.ns = eliot.scolarite.publipostage.selection;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.eleveSelectionneIds = [];
+ this.modeleSelectionneId = undefined;
+ this.classeIds = undefined;
+ this.adresseId = undefined;
+
+ this.addEvents(
+ this.Constantes.eventId.critereChange,
+
+ this.Constantes.eventId.activePubliposter,
+
+ this.Constantes.eventId.updateZoneMessage
+ );
+ },
+
+
+ creeItems:function () {
+ var fields = this.getFields({
+ 1:this.Constantes.dataIndex.selection,
+ 2:this.Constantes.dataIndex.id,
+ 3:this.Constantes.dataIndex.nomPrenom,
+ 4:this.Constantes.dataIndex.classe,
+ 5:this.Constantes.dataIndex.responsable,
+ 6:this.Constantes.dataIndex.adresse,
+ 7:this.Constantes.dataIndex.cpVille,
+ 8:this.Constantes.dataIndex.valide
+ });
+
+ this.resultatsStore = new Ext.data.Store({
+ autoLoad:false,
+ autoDestroy:false,
+ reader:new Ext.data.JsonReader({
+ fields:fields,
+ idProperty:'id'
+ })
+ });
+ },
+
+ observeCriteresView:function (criteresView) {
+ criteresView.addListener(
+ this.Constantes.eventId.actionChercher,
+ this.executeChercher,
+ this
+ );
+
+ criteresView.addListener(
+ this.Constantes.eventId.critereChange,
+ this.actionCriteresChange,
+ this
+ );
+ },
+
+ observeResultatsView:function (resultatsView) {
+ resultatsView.addListener(
+ this.Constantes.eventId.selectionChange,
+ this.actionSelectionChange,
+ this
+ );
+
+ resultatsView.addListener(
+ this.Constantes.eventId.actionAfficheEleveInvalide,
+ this.actionEleveInvalide,
+ this
+ );
+ },
+
+ observePublipostageView:function (publipostageView) {
+ publipostageView.addListener(
+ this.Constantes.eventId.modeleChange,
+ this.actionModeleChange,
+ this
+ );
+
+ publipostageView.addListener(
+ this.Constantes.eventId.actionPubliposter,
+ this.executePubliposter,
+ this
+ );
+ },
+
+ actionEleveInvalide:function (responsableNum) {
+
+ this.fireEvent(
+ this.Constantes.eventId.updateZoneMessage,
+ this.ConfigServeur.message.adresseInvalide,
+ responsableNum != 1 ? this.ConfigServeur.message.infoResponsable2 : undefined
+ );
+
+ },
+
+ executePubliposter:function () {
+ if (this.ConfigServeur.data.seuilImpression >= this.eleveSelectionneIds.length) {
+ // Impression directe
+ this.executeImpressionDirecte();
+ return;
+ }
+
+ // Impresion différée
+ this.executeImpressionDifferee();
+
+ },
+
+ executeImpressionDirecte:function () {
+ var url = this.ConfigServeur.url.publiposteDirecte + '?' +
+ Ext.urlEncode(this.getPublipostageParametres());
+
+
+ window.open(
+ url,
+ "_blank",
+ "height=600, width=800, toolbar=yes,menubar=no,scrollbars=yes"
+ );
+ },
+
+ executeImpressionDifferee:function () {
+
+ Ext.Ajax.request({
+ scope:this,
+ url:this.ConfigServeur.url.publiposteDiffere,
+ params:this.getPublipostageParametres(), // todo
+
+ success:function (response, request) {
+ var resultats = Ext.decode(response.responseText);
+
+ var titre = resultats.success ? this.ConfigServeur.message.titreSuccess :
+ this.ConfigServeur.message.titreErreur;
+
+
+ eliot.scolarite.Message.afficherDialogAlert(
+ titre,
+ this.ConfigServeur.message.demandeAjouteOK
+ );
+ },
+
+ failure:function () {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.demandeAjouteKO
+ );
+ }
+ });
+ },
+
+ actionModeleChange:function (modeleId) {
+ this.modeleSelectionneId = modeleId;
+
+ this.activePubliposter();
+ },
+
+ actionCriteresChange:function () {
+ this.eleveSelectionneIds = [];
+
+ this.videResultatsStore();
+
+ this.fireEvent(
+ this.Constantes.eventId.critereChange
+ )
+ },
+
+ actionSelectionChange:function (selectedRecords) {
+ this.eleveSelectionneIds = [];
+
+ Ext.each(selectedRecords,
+ function (record) {
+ this.eleveSelectionneIds.push(record.id);
+ }, this);
+
+ this.activePubliposter();
+ },
+
+ activePubliposter:function () {
+ var active = this.eleveSelectionneIds.length > 0 && this.modeleSelectionneId;
+ this.fireEvent(
+ this.Constantes.eventId.activePubliposter,
+ active
+ );
+ },
+
+ videResultatsStore:function () {
+ this.resultatsStore.removeAll();
+ },
+
+ executeChercher:function (classeIds, destinataire) {
+ eliot.scolarite.Message.resetMessages();
+
+ this.classeIds = classeIds;
+ this.adresseId = destinataire;
+
+ Ext.Ajax.request({
+ url:this.ConfigServeur.url.rechercher,
+ params:{
+ classeIds:classeIds,
+ destinataire:destinataire
+ },
+ success:function (response, request) {
+ var reponse = Ext.decode(response.responseText);
+ if (reponse.success) {
+ this.resultatsStore.loadData(reponse.data);
+ } else {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.rechercheKO
+ );
+ }
+ },
+ failure:function () {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.rechercheKO
+ );
+ },
+ scope:this
+ });
+ },
+
+ getModeleStore:function () {
+ return this.creeStore(this.ConfigServeur.data.modeles, false);
+ },
+
+ getClassesStore:function () {
+ return this.creeStore(this.ConfigServeur.data.classes, true);
+ },
+
+ getResponsableStore:function () {
+ return this.creeStore(this.ConfigServeur.data.responsables, false);
+ },
+
+ creeStore:function (data, addTous) {
+ var store = new Ext.data.Store({
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ fields:[
+ {name:'id'},
+ {name:'libelle', type:'string'}
+ ],
+ id:'id'
+ })
+ });
+
+ if (addTous) {
+ data.unshift({
+ id:-1,
+ libelle:this.ConfigServeur.libelle.tous
+ });
+ }
+
+ store.loadData(data);
+ return store;
+ },
+
+ getFields:function (dataIndex) {
+ var key;
+ var fields = [];
+ for (key in dataIndex) {
+ fields.push({
+ name:dataIndex[key]
+ });
+ }
+ return fields;
+ },
+
+ getPublipostageParametres:function () {
+ return {
+ modeleId:this.modeleSelectionneId,
+ elevesSelectionnes:this.eleveSelectionneIds,
+ classesId:this.classeIds,
+ adresseId:this.adresseId
+ };
+ }
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * Classe Application de la page de suivi des impressions
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suiviimpression');
+
+eliot.scolarite.publipostage.suiviimpression.Application = function () {
+
+ var Clazz = Ext.extend(Ext.util.Observable, {
+
+ constructor:function () {
+
+ this.init();
+
+ var centerRegionItems = this.creeItems();
+
+ // Rendu du viewport
+ Ext.onReady(function () {
+ eliot.layout.doLayout(
+ 'viewPort',
+ 'northPanel',
+ 'centerPanel',
+ centerRegionItems
+ );
+ });
+ },
+
+ init:function () {
+ this.ns = eliot.scolarite.publipostage.suiviimpression;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ },
+
+ creeItems:function () {
+
+ var suiviController = new this.ns.SuiviController();
+
+ var criteresView = new this.ns.CriteresView({
+ statutsStore:suiviController.getStatutsStore()
+ });
+ suiviController.observeCriteresView(criteresView);
+
+ var resultatsView = new this.ns.ResultatsView({
+ resultatsStore:suiviController.resultatsStore
+ });
+ suiviController.observeResultatView(resultatsView);
+
+ return {
+ xtype:'panel',
+ border:false,
+ layout:'border',
+ defaults:{
+ border:false
+ },
+ items:[
+ {
+ region:'north',
+ height:70,
+ items:criteresView.panel
+ },
+ {
+ region:'center',
+ layout:'fit',
+ items:resultatsView.grid
+ }
+ ]
+ };
+ }
+
+ })
+ ;
+// Construit l'instance singleton
+ return new Clazz();
+}
+ ();
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+/*
+ * @author bbel
+ */
+
+
+Ext.ns('eliot.scolarite.publipostage.suiviimpression');
+
+eliot.scolarite.publipostage.suiviimpression.ConfigServeur = {
+
+ libelle:{
+ dateDebut:undefined,
+ dateFin:undefined,
+ statuts:undefined,
+ chercher:undefined,
+ actualiser:undefined,
+ supprimer:undefined
+ },
+
+ header:{
+ dateHeure:undefined,
+ dateDuDocument:undefined,
+ telechargerDoc:undefined,
+ docExiste:undefined,
+ nomimpression:undefined,
+ support:undefined,
+ statut:undefined,
+ periode:undefined,
+ supprimable:undefined
+ },
+
+ message:{
+ datesIncorrectes:undefined,
+ docNonDisponible:undefined,
+ suppressionMessage:undefined,
+ suppressionTitre:undefined,
+ erreurSuppression:undefined,
+ erreurInconnue:undefined,
+ rechercheKO:undefined
+ },
+
+ data:{
+ dateDebut:undefined,
+ dateFin:undefined,
+ nbLigneParPage:undefined
+ },
+
+ url:{
+ rechercher:undefined,
+ supprimer:undefined,
+ telechargeDocument:undefined
+ },
+
+ icon:{
+ rechercher:undefined,
+ telechargerDoc:undefined,
+ docNonDispo:undefined,
+ supprimer:undefined,
+ actualiser:undefined
+ }
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/*
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suiviimpression');
+
+eliot.scolarite.publipostage.suiviimpression.Constantes = {
+
+ eventId:{
+ actionChercher:'actionChercher',
+ actionPaginer:'actionPaginer',
+ actionClassementChange:'actionClassementChange',
+ actionSelectionChange:'actionSelectionChange',
+ actionSupprimer:'actionSupprimer',
+ actionActualiser:'actionActualiser'
+ },
+
+ dataIndex:{
+ dateHeure:'date_demande',
+ dateDuDocument:'date_fin_execution_traitement',
+ telechargerDoc:'telecharger_doc',
+ docExiste:'doc_existe',
+ nomimpression:'nom',
+ support:'support',
+ statut:'statut',
+ periode:'periode',
+ supprimable:'supprimable'
+ },
+
+ ordreClassement:{
+ DESC:'desc'
+ }
+
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+
+/**
+ * Classe view des critères de recherche
+ * @author bbel
+ */
+
+
+Ext.ns('eliot.scolarite.publipostage.suiviimpression');
+
+eliot.scolarite.publipostage.suiviimpression.CriteresView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.init(config);
+ this.creeItems();
+ },
+
+ init:function (config) {
+ this.ns = eliot.scolarite.publipostage.suiviimpression;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ this.config = Ext.apply(this.creeConfig(), config);
+
+ this.addEvents(
+ this.Constantes.eventId.actionChercher
+ );
+ },
+
+ creeConfig:function () {
+ this.config = {
+ statutsStore:undefined,
+ statuts:'-1',
+ dateDebut:this.getDateDebut(),
+ dateFin:this.getDateFin()
+ };
+ return this.config;
+ },
+
+ creeItems:function () {
+
+ var dateDebut = new Ext.form.DateField({
+ fieldLabel:this.ConfigServeur.libelle.dateDebut,
+ width:100,
+ format:'d/m/Y',
+ labelSeparator:' : ',
+ editable:false,
+ allowBlank:false,
+ value:this.config.dateDebut,
+ listeners:{
+ select:{
+ fn:function (datePicker, date) {
+ this.config.dateDebut = date;
+ }
+ },
+ scope:this
+ }
+ });
+
+
+ var dateFin = new Ext.form.DateField({
+ fieldLabel:this.ConfigServeur.libelle.dateFin,
+ width:100,
+ format:'d/m/Y',
+ labelSeparator:' : ',
+ editable:false,
+ allowBlank:false,
+ value:this.config.dateFin,
+ listeners:{
+ select:{
+ fn:function (datePicker, date) {
+ this.config.dateFin = date;
+ }
+ },
+ scope:this
+ }
+ });
+
+
+ var statusLovCombo = new eliot.scolarite.commons.LovComboView({
+ ajoutItemTous:true,
+ store:this.config.statutsStore,
+ label:this.ConfigServeur.libelle.statuts,
+ width:400,
+ editable:false,
+ valeurInitiale:this.config.statuts
+ });
+ this.observeClassesLovCombo(statusLovCombo);
+
+ var rechercheButton = new Ext.Button({
+ width:90,
+ text:this.ConfigServeur.libelle.chercher,
+ icon:this.ConfigServeur.icon.rechercher,
+ handler:this.actionChercher,
+ scope:this
+ });
+
+ this.panel = new Ext.Panel({
+ height:70,
+ border:false,
+ frame:true,
+ items:[
+ {
+ layout:'column',
+ height:30,
+ defaults:{
+ layout:'form',
+ border:false
+ },
+ items:[
+ {
+ width:320,
+ labelWidth:120,
+ labelAlign:'right',
+ items:dateDebut
+ },
+ {
+ width:300,
+ labelWidth:100,
+ labelAlign:'right',
+ items:dateFin
+ },
+ rechercheButton
+ ]
+ },
+ {
+ layout:'form',
+ height:30,
+ labelWidth:120,
+ width:600,
+ labelAlign:'right',
+ items:statusLovCombo.lovCombo
+ }
+ ]
+ });
+ },
+
+
+ observeClassesLovCombo:function (classesLovCombo) {
+ classesLovCombo.addListener(
+ 'actionValeurChange',
+ function (newValue) {
+ this.config.statuts = newValue;
+ },
+ this
+ )
+ },
+
+ getDateDebut:function () {
+ return Date.parseDate(this.ConfigServeur.data.dateDebut, 'd/m/Y');
+ },
+
+ getDateFin:function () {
+ return Date.parseDate(this.ConfigServeur.data.dateFin, 'd/m/Y');
+ },
+
+ actionChercher:function () {
+ eliot.scolarite.Message.resetMessages();
+
+ if (this.config.dateFin < this.config.dateDebut) {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.datesIncorrectes
+ );
+ return
+ }
+
+ this.fireEvent(
+ this.Constantes.eventId.actionChercher,
+ {
+ dateDebut:this.config.dateDebut,
+ dateFin:this.config.dateFin,
+ statuts:this.config.statuts
+ }
+ );
+ }
+
+
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+/**
+ * Classe view des résultats de la recherche
+ * @author bbel
+ */
+
+
+Ext.ns('eliot.scolarite.publipostage.suiviimpression');
+
+eliot.scolarite.publipostage.suiviimpression.ResultatsView = Ext.extend(Ext.util.Observable, {
+
+ constructor:function (config) {
+ this.init(config);
+
+ this.creeItems();
+
+ this.observe();
+ },
+
+ init:function (config) {
+ this.ns = eliot.scolarite.publipostage.suiviimpression;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ this.config = Ext.apply(this.creeConfig(), config);
+
+ this.addEvents(
+ this.Constantes.eventId.actionChercher,
+
+ this.Constantes.eventId.actionPaginer,
+
+ this.Constantes.eventId.actionClassementChange,
+
+ this.Constantes.eventId.actionSelectionChange,
+
+ this.Constantes.eventId.actionSupprimer,
+
+ this.Constantes.eventId.actionActualiser
+
+ );
+ },
+
+ creeConfig:function () {
+ this.config = {
+ resultatsStore:undefined
+ };
+ return this.config;
+ },
+
+ creeItems:function () {
+
+ var checkBox = new Ext.grid.CheckboxSelectionModel({
+ singleSelect:false,
+ width:25
+ });
+
+
+ // Initialiser toutes les colonnes de grille
+ var cm = new Ext.grid.ColumnModel({
+ columns:[
+ checkBox,
+ {
+ header:this.createHeader(this.ConfigServeur.header.dateHeure),
+ dataIndex:this.Constantes.dataIndex.dateHeure,
+ width:150,
+ sortable:true
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.support),
+ dataIndex:this.Constantes.dataIndex.support,
+ width:120
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.nomimpression),
+ dataIndex:this.Constantes.dataIndex.nomimpression,
+ width:300,
+ renderer:function (value) {
+ return Encoder.htmlEncode(value);
+ }
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.statut),
+ dataIndex:this.Constantes.dataIndex.statut,
+ width:120
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.telechargerDoc),
+ dataIndex:this.Constantes.dataIndex.telechargerDoc,
+ width:110,
+ align:'center',
+ renderer:this.rendererIcon.createDelegate(this)
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.header.dateDuDocument),
+ dataIndex:this.Constantes.dataIndex.dateDuDocument,
+ width:150,
+ hidden:true,
+ menuDisabled:true
+ }
+ ]
+ });
+
+ this.creeToolbar();
+
+ this.grid = new Ext.grid.GridPanel({
+ store:this.config.resultatsStore,
+ columnLines:true,
+ stripeRows:true,
+ cm:cm,
+ sm:checkBox,
+ border:false,
+ height:200,
+ autoSize:true,
+ enableColumnMove:false,
+ tbar:this.toolbar,
+ bbar:new Ext.PagingToolbar({
+ pageSize:this.ConfigServeur.data.nbLigneParPage,
+ store:this.config.resultatsStore
+ })
+ });
+
+ this.afficheBoutonRefreshBarrePagination(false);
+ },
+
+ observe:function () {
+ this.grid.getBottomToolbar().addListener({
+ beforechange:{
+ fn:function (pagingToolBar, pageData) {
+
+ this.fireEvent(
+ this.Constantes.eventId.actionPaginer,
+ pageData
+ );
+ },
+ scope:this
+ }
+
+ });
+
+ this.grid.addListener({
+ sortchange:{
+ fn:function (grid, sortInfo) {
+ if (grid.store.getCount()) {
+ this.fireEvent(
+ this.Constantes.eventId.actionClassementChange,
+ sortInfo
+ );
+ }
+ },
+ scope:this
+ }
+ });
+
+
+ this.grid.store.addListener({
+ load:{
+ fn:function () {
+
+ this.activeBoutonActualiser();
+ this.afficheBoutonRefreshBarrePagination(true);
+ },
+ scope:this
+ }
+ });
+
+
+ this.grid.getSelectionModel().addListener({
+ selectionchange:{
+ fn:function (selModel) {
+
+ this.actualiseEtatToolBar(this.toolbar, selModel);
+ var selectedExportIds = [];
+ var selectedRecords = selModel.getSelections();
+
+ for (var i = 0; i < selectedRecords.length; i++) {
+ selectedExportIds.push(selectedRecords[i].id)
+ }
+
+ this.fireEvent(
+ this.Constantes.eventId.actionSelectionChange,
+ selectedExportIds
+ );
+
+ },
+ scope:this
+ },
+ beforerowselect:{
+ fn:function (selectionModel, rowIndex, keepExisting, record) {
+ if (record.data[this.Constantes.dataIndex.supprimable] === false) {
+ eliot.scolarite.Message.afficherDialogAlert(
+ this.ConfigServeur.message.suppressionTitre,
+ this.ConfigServeur.message.suppressionMessage
+ );
+ return false;
+ }
+ },
+ scope:this
+ }
+
+ })
+ },
+
+
+ createHeader:function (libelle) {
+ return '<span style="font-weight: normal;white-space: normal; ">' +
+ libelle +
+ '</span>';
+ },
+
+ /**
+ * Si la valeur dans le cellule est true, alors il affiche un icon de
+ * téléchargement, sinon il affiche '-'
+ * @param value
+ */
+ rendererIcon:function (value, obj, record) {
+
+ if (!value) {
+ return '<img src=' + this.ConfigServeur.icon.docNonDispo + '>';
+ }
+
+ if (record.get(this.Constantes.dataIndex.docExiste)) {
+ return '<a href=' + this.ConfigServeur.url.telechargeDocument +
+ '?id=' + record.id + '>' +
+ '<img src=' + this.ConfigServeur.icon.telechargerDoc + '>' + '</a>';
+
+ } else {
+ obj.attr = 'ext:qtip="' + this.ConfigServeur.message.docNonDisponible + '"';
+ return '<img src=' + this.ConfigServeur.icon.telechargerDoc +
+ ' style="opacity:0.4;filter:alpha(opacity=40);" >';
+
+ }
+ },
+
+ creeToolbar:function () {
+
+ this.boutonSupprimer = new Ext.Button({
+ text:this.ConfigServeur.libelle.supprimer,
+ icon:this.ConfigServeur.icon.supprimer,
+ disabled:true,
+ listeners:{
+ click:function () {
+ this.fireEvent(this.Constantes.eventId.actionSupprimer);
+ },
+ scope:this
+ }
+ });
+
+ this.toolbar = new Ext.Toolbar({
+ height:36,
+ defaults:{
+ style:'margin-top:3px;'
+ },
+ items:[
+ {
+ text:this.ConfigServeur.libelle.actualiser,
+ icon:this.ConfigServeur.icon.actualiser,
+ disabled:true,
+ listeners:{
+ click:function () {
+ this.fireEvent(
+ this.Constantes.eventId.actionActualiser
+ );
+ eliot.scolarite.Message.resetMessages();
+ },
+ scope:this
+ }
+ },
+ {
+ xtype:'tbspacer',
+ width:20
+ },
+ this.boutonSupprimer
+ ]
+ });
+ },
+
+ actualiseEtatToolBar:function (toolbarView, selModel) {
+ var unSelected = selModel.getSelected();
+ this.activeBoutonSupprimer(unSelected != undefined)
+ },
+
+ activeBoutonSupprimer:function (boutonActif) {
+ if (boutonActif) {
+ this.boutonSupprimer.enable()
+ } else {
+ this.boutonSupprimer.disable()
+ }
+ },
+
+ activeBoutonActualiser:function () {
+ this.toolbar.items.get(0).enable();
+ },
+
+
+ /**
+ * Affiche le bouton refresh de la barre de pagination
+ */
+ afficheBoutonRefreshBarrePagination:function (active) {
+ if (active) {
+ this.grid.getBottomToolbar().refresh.show();
+ } else {
+ this.grid.getBottomToolbar().refresh.hide();
+ }
+ }
+
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+
+/**
+ * @author bbel
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suiviimpression');
+
+eliot.scolarite.publipostage.suiviimpression.SuiviController = Ext.extend(Ext.util.Observable, {
+
+ constructor:function () {
+ this.init();
+ this.creeItems();
+ },
+
+ init:function () {
+ this.ns = eliot.scolarite.publipostage.suiviimpression;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+ },
+
+ creeItems:function () {
+ this.selectedIds = [];
+
+ // Paramètre de classement
+ this.sortInfo = {
+ field:this.Constantes.dataIndex.dateHeure,
+ direction:this.Constantes.ordreClassement.DESC
+ };
+
+ // Les paramètres envoyé pour obtenir une liste de suivi d'impression
+ this.params = {
+ start:0,
+ limit:this.ConfigServeur.data.nbLigneParPage,
+ sortInfo:this.sortInfo
+ };
+
+ this.resultatsStore = new Ext.data.Store({
+ autoDestroy:true,
+ autoLoad:false,
+ url:this.ConfigServeur.url.rechercher,
+ reader:new Ext.data.JsonReader({
+ fields:[
+ {
+ name:'id'
+ },
+ {
+ name:this.Constantes.dataIndex.dateHeure
+ },
+ {
+ name:this.Constantes.dataIndex.dateDuDocument
+ },
+ {
+ name:this.Constantes.dataIndex.telechargerDoc
+ },
+ {
+ name:this.Constantes.dataIndex.docExiste,
+ type:"boolean"
+ },
+ {
+ name:this.Constantes.dataIndex.nomimpression
+ },
+ {
+ name:this.Constantes.dataIndex.support
+ },
+ {
+ name:this.Constantes.dataIndex.statut
+ },
+ {
+ name:this.Constantes.dataIndex.periode
+ },
+ {
+ name:this.Constantes.dataIndex.supprimable
+ }
+ ],
+ root:'data',
+ id:'id',
+ totalProperty:'nbData'
+ })
+ })
+ },
+
+ getStatutsStore:function () {
+ var store = new Ext.data.Store({
+ autoLoad:false,
+ reader:new Ext.data.JsonReader({
+ fields:[
+ {name:'id'},
+ {name:'libelle', type:'string'}
+ ],
+ id:'id'
+ })
+ });
+
+ var data = this.ConfigServeur.data.statuts;
+
+ data.unshift({
+ id:-1,
+ libelle:this.ConfigServeur.libelle.tous
+ });
+
+ store.loadData(data);
+ return store;
+ },
+
+ observeCriteresView:function (criteresView) {
+ criteresView.addListener(
+ this.Constantes.eventId.actionChercher,
+ this.executeChercher,
+ this
+ );
+ },
+
+ observeResultatView:function (resultatView) {
+
+ resultatView.addListener(
+ this.Constantes.eventId.actionPaginer,
+ function (pageData) {
+ this.params.start = pageData.start;
+ this.resultatsStore.setBaseParam(
+ 'params',
+ Ext.encode(this.params)
+ );
+ },
+ this);
+
+ resultatView.addListener(
+ this.Constantes.eventId.actionClassementChange,
+ this.executeClassementChange,
+ this
+ );
+
+ resultatView.addListener(
+ this.Constantes.eventId.actionSelectionChange,
+ this.executeSelectionChange,
+ this
+ );
+
+ resultatView.addListener(
+ this.Constantes.eventId.actionSupprimer,
+ this.executeSupprimer,
+ this
+ );
+
+ resultatView.addListener(
+ this.Constantes.eventId.actionActualiser,
+ this.executeActualiser,
+ this
+ );
+ },
+
+ executeSelectionChange:function (ids) {
+ this.selectedIds = ids;
+ },
+
+ executeClassementChange:function (newSortInfo) {
+ this.sortInfo = newSortInfo;
+ this.params.sortInfo = this.sortInfo;
+ this.executeActualiser()
+ },
+
+ executeChercher:function (params) {
+ eliot.scolarite.Message.resetMessages();
+
+ this.params.dateDebut = params.dateDebut;
+ this.params.dateFin = params.dateFin;
+ this.params.statuts = params.statuts;
+
+ Ext.Ajax.request({
+ url:this.ConfigServeur.url.rechercher,
+ params:{
+ params:Ext.encode(this.params)
+ },
+ success:function (response, request) {
+ var reponse = Ext.decode(response.responseText);
+ if (reponse.success) {
+ this.resultatsStore.loadData({
+ data:reponse.data,
+ nbData:reponse.nbData
+ });
+ } else {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.rechercheKO
+ );
+ }
+ },
+ failure:function () {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.rechercheKO
+ );
+ },
+ scope:this
+ });
+ },
+
+ executeSupprimer:function () {
+ eliot.scolarite.Message.resetMessages();
+
+ Ext.Ajax.request({
+ url:this.ConfigServeur.url.supprimer,
+ params:{
+ params:Ext.encode({
+ demandeIds:this.selectedIds
+ })
+ },
+ success:function (response, request) {
+ var reponse = Ext.decode(response.responseText);
+ if (reponse.success) {
+ this.executeActualiser();
+ eliot.scolarite.Message.showConfirmation(
+ this.ConfigServeur.message.suppressionSucces
+ );
+ } else {
+ eliot.scolarite.Message.showErreur(
+ this.ConfigServeur.message.erreurInconnue
+ );
+ }
+ },
+ failure:function (response) {
+ if (response !== undefined && response.message !== undefined && response.message !== '') {
+ eliot.scolarite.Message.showErreur(reponse.message);
+ }
+ else {
+ eliot.scolarite.Message.showErreur(this.ConfigServeur.message.erreurSuppression);
+ }
+ },
+ scope:this
+ });
+ },
+
+ executeActualiser:function () {
+ this.resultatsStore.setBaseParam('params', Ext.encode(this.params));
+
+ var lastOptions = this.resultatsStore.lastOptions;
+ if (lastOptions) {
+ Ext.apply(lastOptions.params, {
+ params:Ext.encode(this.params)
+ });
+ this.resultatsStore.reload(lastOptions);
+ } else {
+ this.resultatsStore.reload();
+ }
+ }
+
+});
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suivipareleve');
+
+/**
+ * Historique
+ */
+eliot.scolarite.publipostage.suivipareleve.Application = function() {
+
+ /**
+ * Définit la classe qui sera instanciée comme singleton
+ */
+ var Clazz = Ext.extend(Ext.util.Observable, {
+
+ constructor: function() {
+ // supprime le loadMask après un temps maximal
+ this.supprimeLoadMask();
+
+ this.ns = eliot.scolarite.publipostage.suivipareleve;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ // historique
+ this.historiqueController = new this.ns.HistoriqueController();
+ this.historiqueView = new this.ns.HistoriqueView({
+ rechercheStore: this.historiqueController.rechercheStore,
+ classesStore: this.historiqueController.classesStore,
+ modelesStore: this.historiqueController.modelesStore
+ });
+ this.historiqueController.observeHistoriqueView(this.historiqueView);
+
+ var centerRegionItems = [
+ {
+ id: 'eliot.scolarite.Constantes.viewport.idMainPane',
+ xtype: 'panel',
+ layout: 'border',
+ border: false,
+ autoScroll: true,
+ autoShow: true,
+ defaults: {
+ border: false,
+ frame: false
+ },
+ items:[
+ {
+ region : 'north',
+ height : 110,
+ layout: 'fit',
+ items: this.historiqueView.getFiltreItems()
+ },
+ {
+ region: 'center',
+ autoScroll: true,
+ layout: 'fit',
+ items: {
+ border: false,
+ frame: false,
+ layout: 'fit',
+ labelAlign: 'top',
+ items: this.historiqueView.getItems()
+ }
+ }
+ ]
+ }
+ ];
+
+ // Rendu du viewport
+ Ext.onReady(function() {
+ Ext.QuickTips.init();
+ eliot.layout.doLayout(
+ 'idViewport',
+ 'idNorthPanel',
+ 'idCenterPanel',
+ centerRegionItems
+ );
+
+ });
+
+ // Supprime la progresse barre
+ this.supprimeLoadMask(1);
+ },
+
+ supprimeLoadMask : function(time) {
+ setTimeout(function() {
+ var divLoading = Ext.get('loading');
+ var divLoadingMask = Ext.get('loading-mask');
+ if (divLoading && divLoadingMask) {
+ divLoading.remove();
+ divLoadingMask.fadeOut({remove:true});
+ }
+ }, time ? time : 30);
+ }
+
+ });
+
+ // Construit l'instance singleton
+ return new Clazz({
+ name: 'eliot-scolarite-publipostage-historique-app'
+ });
+}();
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suivipareleve');
+
+/**
+ * Configuration serveur
+ */
+eliot.scolarite.publipostage.suivipareleve.ConfigServeur = {
+
+ messages:{
+ erreurRecherche: undefined,
+ erreurDesDates: undefined
+ },
+
+ url:{
+ recherche: undefined
+ },
+
+ libelle: {
+ dateDebut: undefined,
+ dateFin: undefined,
+ classes: undefined,
+ modeles: undefined,
+ chercher: undefined,
+ dateHeure: undefined,
+ nom: undefined,
+ classe: undefined,
+ support: undefined,
+ modele: undefined
+ },
+
+ icon: {
+ chercher: undefined
+ },
+
+ data: {
+ classes: [],
+ modeles: [],
+ anneeScolaire : undefined,
+ nbLigneParPage : undefined
+ }
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suivipareleve');
+
+/**
+ * Constantes
+ */
+eliot.scolarite.publipostage.suivipareleve.Constantes = {
+
+ eventId: {
+ rechercher: 'rechercher',
+ actionPaginer : 'actionPaginer',
+ actionClassementChange : 'actionClassementChange'
+ },
+ ordreClassement : {
+ DESC : 'DESC'
+ }
+};
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suivipareleve');
+
+/**
+ * Historique
+ */
+eliot.scolarite.publipostage.suivipareleve.HistoriqueController = Ext.extend(Ext.util.Observable, {
+
+ /**
+ * Constructeur
+ */
+ constructor: function() {
+
+ this.ns = eliot.scolarite.publipostage.suivipareleve;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ Ext.apply(this, {
+ view: undefined,
+ rechercheStore: undefined,
+ classesStore: undefined,
+ modelesStore: undefined
+ });
+
+ this.initRechercheStore();
+ this.initClassesStore();
+ this.initModelesStore();
+ },
+
+ /**
+ * Initialise du store
+ */
+ initRechercheStore: function() {
+ // Paramètre de classement
+ this.sortInfo = {
+ field: 'date',
+ direction: this.Constantes.ordreClassement.DESC
+ };
+
+ // Les paramètres envoyé pour obtenir une liste de suivi d'impression
+ this.params = {
+ start: 0,
+ limit: this.ConfigServeur.data.nbLigneParPage,
+ sortInfo: this.sortInfo
+ };
+
+ var storeConfig = {
+ autoDestroy: true,
+ autoLoad: false,
+ url : this.ConfigServeur.url.recherche,
+ reader: new Ext.data.JsonReader({
+ root: 'data',
+ idProperty: 'id',
+ totalProperty: 'nbData',
+ fields: [
+ {name: 'id'},
+ {name: 'date'},
+ {name: 'nom'},
+ {name: 'classe'},
+ {name: 'type'},
+ {name: 'modele'}
+ ]
+ })
+ };
+
+ this.rechercheStore = new Ext.data.Store(storeConfig);
+ },
+
+ /**
+ * Initialise du store
+ */
+ initClassesStore: function() {
+
+ var classes = [
+ {
+ id: -1,
+ libelle: 'Toutes'
+ }
+ ];
+
+ Ext.each(this.ConfigServeur.data.classes, function(classe) {
+ classes.push(classe);
+ }, this);
+
+ this.classesStore = new Ext.data.Store({
+ autoDestroy: true,
+ autoLoad: false,
+ reader: new Ext.data.JsonReader({
+ root: 'classes',
+ idProperty: 'id',
+ fields: [
+ {name: 'id'},
+ {name: 'libelle'}
+ ]
+ }),
+ data: {
+ classes: classes
+ }
+ });
+ },
+
+ /**
+ * Initialise du store
+ */
+ initModelesStore: function() {
+
+ var modeles = [
+ {
+ libelle: 'Tous'
+ }
+ ];
+
+ Ext.each(this.ConfigServeur.data.modeles, function(modele) {
+ modeles.push(modele);
+ }, this);
+
+ this.modelesStore = new Ext.data.Store({
+ autoDestroy: true,
+ autoLoad: false,
+ reader: new Ext.data.JsonReader({
+ root: 'modeles',
+ fields: [
+ {name: 'id'},
+ {name: 'libelle'}
+ ]
+ }),
+ data: {
+ modeles: modeles
+ }
+ });
+ },
+
+ /**
+ * Lie à la vue
+ * @param view
+ */
+ observeHistoriqueView: function(view) {
+ view.addListener(
+ this.Constantes.eventId.rechercher,
+ function(params) {
+ this.actionRecherche(params);
+ },
+ this);
+
+ view.addListener(
+ this.Constantes.eventId.actionPaginer,
+ function(pageData) {
+ this.params.start = pageData.start;
+ this.rechercheStore.setBaseParam(
+ 'params',
+ Ext.encode(this.params)
+ );
+ },
+ this);
+
+ view.addListener(
+ this.Constantes.eventId.actionClassementChange,
+ this.executeClassementChange,
+ this
+ );
+ },
+
+ /**
+ * actionRecherche
+ * @param params
+ */
+ actionRecherche: function(params) {
+ this.params.dateDebut = params.dateDebut;
+ this.params.dateFin = params.dateFin;
+ this.params.classeIds = params.classeIds;
+ this.params.modeleIds = params.modeleIds;
+ this.params.start = 0;
+
+ eliot.scolarite.Message.resetMessages();
+ eliot.commun.AjaxHelper.request({
+
+ url: this.ConfigServeur.url.recherche,
+
+ params: {
+ params: Ext.encode(this.params)
+ },
+
+ success: function(reponse) {
+ this.rechercheStore.loadData({
+ data: reponse.data,
+ nbData : reponse.nbData
+ });
+ },
+
+ failure: function(reponse) {
+ if ((reponse.message !== undefined) && (reponse.message !== '')) {
+ eliot.scolarite.Message.showErreur(reponse.message);
+ }
+ else {
+ eliot.scolarite.Message.showErreur(this.ConfigServeur.messages.erreurRecherche);
+ }
+ },
+ scope: this
+ });
+ },
+
+ executeClassementChange : function(newSortInfo) {
+ this.sortInfo = newSortInfo;
+ this.params.sortInfo = this.sortInfo;
+ //Important : la modification de la valeur de 'sortInfo' est faite 2 fois
+ // différement, en pagination le setBaseParam a l'air de ne pas fonctionner
+ // sans pagination la modification dans les lastOptions n'a pas
+ // l'air de fonctionner correctement
+ this.rechercheStore.setBaseParam('params', Ext.encode(this.params));
+
+ var lastOptions = this.rechercheStore.lastOptions;
+ if (lastOptions) {
+ Ext.apply(lastOptions.params, {
+ params: Ext.encode(this.params)
+ });
+ this.rechercheStore.reload(lastOptions);
+ } else {
+ this.rechercheStore.reload();
+ }
+ }
+
+});
+
+
+
+
+
+
+
+
+
+
+
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+Ext.ns('eliot.scolarite.publipostage.suivipareleve');
+
+/**
+ * historique
+ */
+
+eliot.scolarite.publipostage.suivipareleve.HistoriqueView = Ext.extend(Ext.util.Observable, {
+
+ /**
+ * Constructeur
+ * @param config
+ * cfg rechercheStore
+ * cfg classesStore
+ * cfg modelesStore
+ */
+ constructor:function (config) {
+
+ this.ns = eliot.scolarite.publipostage.suivipareleve;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.addEvents(
+
+ /**
+ * Rechercher
+ * @event rechercher
+ * @param params
+ */
+ this.Constantes.eventId.rechercher,
+ /**
+ * @event actionPaginer déclenché quand le bouton 'Prochaine' ou
+ * 'Précendent' est cliqué qui se trouve dans le bar de pagination
+ * @param pageData qui paramètre 'start' et 'limit'
+ */
+ this.Constantes.eventId.actionPaginer,
+ /**
+ * @event actionClassementChange déclenché quand une colonne est classée
+ * @param sortInfo qui contient {field + order}
+ */
+ this.Constantes.eventId.actionClassementChange
+ );
+
+ Ext.apply(this, {
+ config:{
+ rechercheStore:undefined,
+ classesStore:undefined,
+ modelesStore:undefined
+ },
+ filtreItems:[],
+ items:[],
+ dateDebutComboBox:undefined,
+ dateFinComboBox:undefined,
+ classesComboBox:undefined,
+ modelesComboBox:undefined,
+ rechercheButton:undefined,
+ rechercheGrid:undefined
+ });
+
+ Ext.apply(this.config, config);
+
+ this.initComponents();
+
+ },
+
+ /**
+ * Initialise les composants
+ */
+ initComponents:function () {
+
+ this.dateDebutComboBox = new Ext.form.DateField({
+ fieldLabel:this.ConfigServeur.libelle.dateDebut,
+ width:100,
+ format:'d/m/Y',
+ labelSeparator:' : ',
+ editable:false,
+ allowBlank:false,
+ value:this.getDateDebut()
+ });
+
+ this.dateFinComboBox = new Ext.form.DateField({
+ fieldLabel:this.ConfigServeur.libelle.dateFin,
+ width:100,
+ format:'d/m/Y',
+ labelSeparator:' : ',
+ editable:false,
+ allowBlank:false,
+ value:new Date()
+ });
+
+ this.classesComboBox = new eliot.scolarite.commons.LovComboView({
+ ajoutItemTous:true,
+ store:this.config.classesStore,
+ label:this.ConfigServeur.libelle.classes,
+ width:400,
+ editable:false
+ });
+
+ this.modelesComboBox = new eliot.scolarite.commons.LovComboView({
+ ajoutItemTous:true,
+ store:this.config.modelesStore,
+ label:this.ConfigServeur.libelle.modeles,
+ width:400,
+ editable:false
+ });
+
+ this.rechercheButton = new Ext.Button({
+ width:90,
+ text:this.ConfigServeur.libelle.chercher,
+ icon:this.ConfigServeur.icon.chercher,
+ handler:function () {
+ eliot.scolarite.Message.resetMessages();
+ var dateDebut = this.dateDebutComboBox.getValue();
+ var dateFin = this.dateFinComboBox.getValue();
+
+ if (dateFin < dateDebut) {
+ eliot.scolarite.Message.showErreur(this.ConfigServeur.messages.erreurDesDates);
+ return
+ }
+
+ var params = {
+ dateDebut:this.dateDebutComboBox.getValue(),
+ dateFin:this.dateFinComboBox.getValue(),
+ classeIds:[],
+ modeleIds:[]
+ };
+
+ Ext.each(this.classesComboBox.lovCombo.getValue().split(','), function (classeId) {
+ if (classeId !== '-1') {
+ params.classeIds.push(classeId);
+ }
+ }, this);
+
+ Ext.each(this.modelesComboBox.lovCombo.getValue().split(','), function (modeleId) {
+ if (modeleId !== '-1') {
+ params.modeleIds.push(modeleId);
+ }
+ }, this);
+
+ this.fireEvent(this.Constantes.eventId.rechercher, params);
+ },
+ scope:this
+ });
+
+ this.filtreItems = new Ext.FormPanel({
+ border:false,
+ cls:'x-panel-mc',
+ bodyStyle:'padding:8px 0px',
+ layout:'vbox',
+ items:[
+ {
+ xtype:'panel',
+ layout:'column',
+ width:720,
+ height:30,
+ items:[
+ {
+ xtype:'panel',
+ layout:'form',
+ width:320,
+ labelWidth:120,
+ labelAlign:'right',
+ items:this.dateDebutComboBox
+ },
+ {
+ xtype:'panel',
+ layout:'form',
+ width:300,
+ labelWidth:100,
+ labelAlign:'right',
+ items:this.dateFinComboBox
+ },
+ this.rechercheButton
+ ]
+ },
+
+ {
+ xtype:'panel',
+ layout:'form',
+ height:30,
+ labelWidth:120,
+ width:600,
+ labelAlign:'right',
+ items:this.classesComboBox.lovCombo
+ },
+
+ {
+ xtype:'panel',
+ layout:'column',
+ height:30,
+ items:[
+ {
+ xtype:'panel',
+ layout:'form',
+ height:30,
+ labelWidth:120,
+ width:600,
+ labelAlign:'right',
+ items:this.modelesComboBox.lovCombo
+ }
+ ]
+ }
+ ]
+ });
+
+ var cm = new Ext.grid.ColumnModel({
+ columns:[
+ {
+ header:this.createHeader(this.ConfigServeur.libelle.dateHeure),
+ dataIndex:'date',
+ width:110,
+ sortable:true
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.libelle.nom),
+ dataIndex:'nom',
+ width:200,
+ sortable:true
+
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.libelle.classe),
+ dataIndex:'classe',
+ width:120,
+ sortable:true
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.libelle.support),
+ dataIndex:'type',
+ width:100,
+ sortable:true
+ },
+ {
+ header:this.createHeader(this.ConfigServeur.libelle.modele),
+ dataIndex:'modele',
+ width:210,
+ sortable:true,
+ renderer:function (value) {
+ return Encoder.htmlEncode(value);
+ }
+ }
+ ]
+ });
+
+ this.rechercheGrid = new Ext.grid.GridPanel({
+ store:this.config.rechercheStore,
+ columnLines:true,
+ stripeRows:true,
+ cm:cm,
+ border:false,
+ height:200,
+ autoSize:true,
+ enableColumnMove:false,
+ bbar:new Ext.PagingToolbar({
+ pageSize:this.ConfigServeur.data.nbLigneParPage,
+ store:this.config.rechercheStore
+ })
+ });
+
+ this.items = [this.rechercheGrid];
+ this.observeGrid(this.rechercheGrid);
+ },
+
+ /**
+ * Calcule date de début par rapport date actuelle.
+ * Si date actuelle est dehors de l'année soclaire, alors date de début est
+ * la date actuelle, sinon est début de l'année soclaire
+ */
+ getDateDebut:function () {
+ var dateActuelle = new Date();
+ var dateDebut = this.ConfigServeur.data.anneeScolaire.debutAnneeScolaire;
+ dateDebut = Date.parseDate(dateDebut, 'd/m/Y');
+ var dateFin = this.ConfigServeur.data.anneeScolaire.finAnneeScolaire;
+ dateFin = Date.parseDate(dateFin, 'd/m/Y');
+
+ if (dateActuelle > dateFin || dateActuelle < dateDebut) {
+ dateDebut = dateActuelle;
+ }
+ return dateDebut;
+ },
+
+ createHeader:function (libelle) {
+ return '<span style="font-weight: normal;white-space: normal; ">' +
+ libelle +
+ '</span>';
+ },
+
+ /**
+ * Composants
+ */
+ getItems:function () {
+ return this.items;
+ },
+
+ /**
+ * Composants Filtre
+ */
+ getFiltreItems:function () {
+ return this.filtreItems;
+ },
+
+ observeGrid:function (grid) {
+ grid.getBottomToolbar().addListener({
+ beforechange:{
+ fn:function (pagingToolBar, pageData) {
+
+ this.fireEvent(
+ this.Constantes.eventId.actionPaginer,
+ pageData
+ );
+ },
+ scope:this
+ }
+ });
+ grid.addListener({
+ sortchange:{
+ fn:function (grid, sortInfo) {
+ if (grid.store.getCount()) {
+ this.fireEvent(
+ this.Constantes.eventId.actionClassementChange,
+ sortInfo
+ );
+ }
+ },
+ scope:this
+ }
+ });
+ }
+
+});
\ No newline at end of file