eliot.libelle.tous = Tous
eliot.libelle.annuler = Annuler
+eliot.libelle.ok = Ok
eliot.recherche.encours= Recherche en cours...
eliot.recherche.aucunresultat=La recherche n'a donn\u00e9 aucun r\u00e9sultat.
eliot.recherche.message.erreur=Une erreur est survenue lors de la recherche effectu\u00e9e.
+
+
+eliot.impression.imprimer = Imprimer
+eliot.impression.titreDeDocument = Titre du document
\ No newline at end of file
-package org.lilie.services.eliot.export\r
-\r
-/**\r
- * Donnees pretes pour l'export CSV\r
- * @author msan\r
- */\r
-class DonneesPourExportCSV {\r
- List<String> colonnes = []\r
- List<List> lignes = []\r
-\r
-\r
- public String toString() {\r
- return "DonneesPourExportCSV{" +\r
- "colonnes=" + colonnes +\r
- ", lignes=" + lignes +\r
- '}';\r
- }\r
-}\r
+package org.lilie.services.eliot.export
+
+/**
+ * Donnees pretes pour l'export CSV
+ * @author msan
+ */
+class DonneesPourExportCSV {
+
+ List<String> colonnes = []
+ List<List> lignes = []
+
+ public String toString() {
+ return "DonneesPourExportCSV{" +
+ "colonnes=" + colonnes +
+ ", lignes=" + lignes +
+ '}';
+ }
+}
--- /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.export
+
+/**
+ * Liste des identifiant des données d'export csv
+ * @author othe
+ */
+class TypeDonneesExport {
+
+ public static final String MULTICRITERE = '-1'
+ public static final String ABS_JOURS = '1,2,3'
+ public static final String RETARDS_JOURS = '4'
+ public static final String DEPARTS_JOURS = '5'
+ public static final String DEMI_PENSION = '6'
+ public static final String INTERNAT = '7'
+ public static final String APPELS_OUBLIES = '8'
+ public static final String TABLEAU_DE_BORD = '9'
+ public static final String STAT_MENSUELLE = '10'
+
+}
* @param jasperPrint document final à imprimer
* @return un tableau d'octet contenant le fichier PDF
*/
- private ByteArrayOutputStream printPdf(JasperPrint jasperPrint
+ public ByteArrayOutputStream printPdf(JasperPrint jasperPrint
) throws ImpressionServiceException {
ByteArrayOutputStream byteArray = null
try {
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.impression.csv
+
+import net.sf.jasperreports.engine.JRStyle
+import net.sf.jasperreports.engine.type.HorizontalAlignEnum
+import net.sf.jasperreports.engine.design.JasperDesign
+import net.sf.jasperreports.engine.design.JRDesignBand
+import net.sf.jasperreports.engine.design.JRDesignStyle
+import net.sf.jasperreports.engine.design.JRDesignField
+import net.sf.jasperreports.engine.design.JRDesignExpression
+import net.sf.jasperreports.engine.design.JRDesignTextField
+import net.sf.jasperreports.engine.design.JRDesignSection
+import net.sf.jasperreports.engine.design.JRDesignStaticText
+
+/**
+ * Permet de construire un modèle jasper en fonction de données d'un fichier csv
+ * @author othe
+ */
+public class ImpressionCsvReportBuilder {
+
+ private final static int BAND_HEIGHT = 12
+
+ private final static int Y = 0
+
+ private JasperDesign jasperDesign
+
+ private List<String> colonnes
+ private List<Integer> largeurs
+ private List<Integer> colonnesvisibles
+
+ private JRDesignStyle styleCellule
+ private JRDesignStyle styleEntete
+
+ public ImpressionCsvReportBuilder(JasperDesign jasperDesign, ImpressionPresentationCsv impressionPresentationCsv) {
+
+ colonnes = impressionPresentationCsv.colonnes
+ largeurs = impressionPresentationCsv.largeurs
+ colonnesvisibles = impressionPresentationCsv.colonnesvisibles
+
+ if (colonnes.size() != colonnesvisibles.size()) {
+ throw new IllegalArgumentException("On doit avoir autant de largeurs de colonnes que de noms de colonnes ${colonnes.size()}, ${colonnesvisibles.size()}")
+ }
+
+ this.jasperDesign = jasperDesign
+
+ }
+
+ /**
+ * Ajoute les colonnes au modèles en fonction des données du fichier csv
+ */
+ public void addDynamicColumns() {
+
+ JRDesignBand detailBand = new JRDesignBand()
+ JRDesignBand headerBand = new JRDesignBand()
+
+ prepareStyles()
+
+ int numColumns = colonnes.size()
+
+ int xPos = 0
+
+ for (int i = 0; i < numColumns; i++) {
+
+ String nomColonne = colonnes[i]
+ Integer numeroColonne = colonnesvisibles[i]
+ Integer columnWidth = largeurs[numeroColonne]
+
+ JRDesignField field = new JRDesignField()
+ field.setName(nomColonne)
+ field.setValueClass(java.lang.String.class)
+ jasperDesign.addField(field)
+
+ headerBand.setHeight(BAND_HEIGHT)
+ JRDesignStaticText colHeaderField = new JRDesignStaticText()
+ colHeaderField.setX(xPos)
+ colHeaderField.setY(Y)
+ colHeaderField.setWidth(columnWidth)
+ colHeaderField.setHeight(BAND_HEIGHT)
+ colHeaderField.setStyle(styleEntete)
+ colHeaderField.text = nomColonne
+ headerBand.addElement(colHeaderField)
+
+ detailBand.setHeight(BAND_HEIGHT)
+ JRDesignTextField textField = new JRDesignTextField()
+ textField.setX(xPos)
+ textField.setY(Y)
+ textField.setWidth(columnWidth)
+ textField.setHeight(BAND_HEIGHT)
+ textField.setHorizontalAlignment(HorizontalAlignEnum.LEFT)
+ textField.setStyle(styleCellule)
+ JRDesignExpression expression = new JRDesignExpression()
+ expression.setValueClass(java.lang.String.class)
+ expression.setText('$F{' + nomColonne + '}')
+ textField.setExpression(expression)
+ detailBand.addElement(textField)
+
+ xPos = xPos + columnWidth
+ }
+
+ jasperDesign.setColumnHeader(headerBand);
+ ((JRDesignSection) jasperDesign.getDetailSection()).addBand(detailBand)
+ }
+
+ private void prepareStyles() {
+ JRStyle parent = findStyleCellule()
+ styleCellule = createStyleCellule(parent)
+ styleEntete = createStyleEntete(parent)
+ jasperDesign.addStyle(styleCellule)
+ jasperDesign.addStyle(styleEntete)
+ }
+
+ private JRDesignStyle createStyleCellule(JRStyle parent) {
+ JRDesignStyle resultat = new JRDesignStyle()
+ resultat.setName("Sans_Normal")
+ resultat.setFontName("Arial")
+ resultat.setFontSize(8)
+ resultat.setPdfFontName("Helvetica")
+ resultat.setPdfEmbedded(true)
+ resultat.parentStyle = parent
+ return resultat
+ }
+
+ private JRDesignStyle createStyleEntete(JRStyle parent) {
+ JRDesignStyle resultat = new JRDesignStyle()
+ resultat.setFontName("Arial")
+ resultat.setFontSize(8)
+ resultat.setPdfFontName("Helvetica")
+ resultat.setPdfEmbedded(true)
+ resultat.setName("entete")
+ resultat.horizontalAlignment = HorizontalAlignEnum.CENTER
+ resultat.parentStyle = parent
+ return resultat
+
+ }
+
+ private JRStyle findStyleCellule() {
+
+// if (jasperDesign.styles.length != 1) {
+// throw new IllegalStateException("Le modèle de base des tableaux dynamiques doit avoir un style pour les cellules.")
+// }
+
+ jasperDesign.styles[0]
+ }
+
+}
\ No newline at end of file
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.impression.csv
+
+import net.sf.jasperreports.engine.JasperPrint
+import net.sf.jasperreports.engine.design.JasperDesign
+import net.sf.jasperreports.engine.design.JRValidationException
+import net.sf.jasperreports.engine.xml.JRXmlLoader
+import net.sf.jasperreports.engine.xml.JRXmlWriter
+import net.sf.jasperreports.engine.JasperReport
+import net.sf.jasperreports.engine.JasperCompileManager
+import net.sf.jasperreports.engine.data.JRCsvDataSource
+import net.sf.jasperreports.engine.JasperFillManager
+import net.sf.jasperreports.engine.JREmptyDataSource
+import org.lilie.services.eliot.export.DonneesPourExportCSV
+import org.lilie.services.eliot.export.CsvExportService
+import org.lilie.services.eliot.impression.ImpressionMoteurService
+import org.codehaus.groovy.grails.commons.GrailsApplication
+
+/**
+ * Ce service est dédié à l'impression de fichiers csv en dynamique.
+ * @author othe
+ */
+class ImpressionCsvService {
+
+ @SuppressWarnings('GrailsStatelessService')
+ GrailsApplication grailsApplication
+
+ private static final String PATH_TEMPLATES =
+ 'WEB-INF/ressources/jasper/'
+
+ CsvExportService csvExportService
+ ImpressionMoteurService impressionMoteurService
+
+ /**
+ * Imprime les données csv dans un fichier PDF
+ * @param impressionPresentationCsv : données donnant les information de présentation du fichier pdf
+ * @param donneesPourExportCSV : fichier csv
+ * @return un array d'octet sous forme de flux contenant les données du fichier pdf
+ */
+ public ByteArrayOutputStream printPdf(ImpressionPresentationCsv impressionPresentationCsv,
+ DonneesPourExportCSV donneesPourExportCSV) {
+
+ JasperPrint jasperPrint = imprime(impressionPresentationCsv, donneesPourExportCSV)
+ return impressionMoteurService.printPdf(jasperPrint)
+ }
+
+ /**
+ * Imprime les données csv
+ * @param impressionPresentationCsv : données donnant les information de présentation du fichier pdf
+ * @param donneesPourExportCSV : fichier csv
+ * @return un objet jasper contenant les données de l'impression finale
+ */
+ public JasperPrint imprime(ImpressionPresentationCsv impressionPresentationCsv,
+ DonneesPourExportCSV donneesPourExportCSV) {
+
+ OutputStream data = csvExportService.exportVersOutputStream(donneesPourExportCSV, "UTF-8")
+
+ byte[] dataCsv = data.toByteArray()
+
+ ByteArrayInputStream istream = new ByteArrayInputStream(dataCsv)
+
+ return fusionne(impressionPresentationCsv, istream)
+ }
+
+ /**
+ * fusionne les données du fichier csv et les données de présentation
+ * @param impressionPresentationCsv : données de présentation
+ * @param data : fichier csv sous forme de flux
+ * @return un objet jasperprint pret pour être transformé en pdf, xls, doc, html, etc....
+ */
+ private JasperPrint fusionne(ImpressionPresentationCsv impressionPresentationCsv,
+ InputStream data
+ ) {
+
+ JasperDesign page = chargeModelePage()
+ JasperDesign tableau = chargeModeleTableau(impressionPresentationCsv)
+
+ // on compile le modèle pour avoir un fichier .jasper
+ JasperReport pageCompile = compile(page)
+ JasperReport tableauCompile = compile(tableau)
+
+ JRCsvDataSource ds = new JRCsvDataSource(data)
+ ds.fieldDelimiter = ';'
+ ds.recordDelimiter = '\n'
+ ds.useFirstRowAsHeader = true
+
+ Map parameters = [:]
+ parameters.dateDebut = impressionPresentationCsv.debut
+ parameters.dateFin = impressionPresentationCsv.fin
+ parameters.etablissement = impressionPresentationCsv.etablissement
+ parameters.titre = impressionPresentationCsv.titre
+ parameters.tableau = tableauCompile
+ parameters.csv = ds
+
+ // on fusionne le document à partir de la source de données
+ JasperPrint jasperPrint = JasperFillManager.fillReport(pageCompile, parameters, new JREmptyDataSource(1))
+
+ if (log.isDebugEnabled()) {
+ log.debug "Liste des colonnes : " + ds.columnNames.toString()
+ }
+
+ return jasperPrint
+
+ }
+
+ /**
+ * Charge et construit le modèle de tableau
+ * @param impressionPresentationCsv : paramètres pour définir l'impression du tableau
+ * @return modèle jasper
+ */
+ private JasperDesign chargeModeleTableau(ImpressionPresentationCsv impressionPresentationCsv) {
+ JasperDesign tableau = JRXmlLoader.load(chargeModele("tableau"))
+
+ ImpressionCsvReportBuilder dynamicReportBuilder = new ImpressionCsvReportBuilder(tableau,
+ impressionPresentationCsv)
+ dynamicReportBuilder.addDynamicColumns()
+
+ if (log.debugEnabled) {
+ JRXmlWriter.writeReport(tableau, "/tmp/tableau.jrxml", "UTF-8");
+ }
+ return tableau
+ }
+
+ /**
+ * charge le modèle de la feuille
+ * @return le modèle jasper
+ */
+ private JasperDesign chargeModelePage() {
+ JasperDesign page = JRXmlLoader.load(chargeModele("A4"))
+ return page
+ }
+
+ /**
+ * Compile et vérifie la compilation d'un fichier japser jrxml. En cas d'erreur, on vide le contenu du fichier
+ * jrxml dans un fichier; Utile, si le modèle est modifié par programmation
+ * @param page : modèle jasper non compilé
+ * @return le modèle compilé
+ */
+ private JasperReport compile(JasperDesign page) {
+ JasperReport pageCompile = null
+ try {
+ pageCompile = JasperCompileManager.compileReport(page)
+ } catch (JRValidationException e) {
+ log.error "Erreur validation modèle jasper pour export csv", e
+
+ if (log.debugEnabled) {
+ log.debug "Erreur sur validation jasper : le fichier modèle est /tmp/debug.jrxml"
+ JRXmlWriter.writeReport(page, "/tmp/debug.jrxml", "UTF-8");
+ }
+
+ }
+
+ if (!pageCompile) {
+ throw new IllegalStateException("Le fichier modèle est manquant pour l'impression csv.")
+ }
+
+ return pageCompile
+
+ }
+/**
+ * charge le code source d'un modèle jasper à partir des ressources
+ * @param nom : nom du fichier au format jrxml
+ * @return un flux contenant le fichier
+ */
+ public InputStream chargeModele(String nom) {
+
+ String cheminFichier = PATH_TEMPLATES + nom + '.jrxml'
+
+ return grailsApplication.mainContext.getResource(
+ cheminFichier
+ ).getInputStream()
+
+ }
+
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.impression.csv
+
+import org.lilie.services.eliot.export.TypeDonneesExport
+
+/**
+ * Contient les listes de largeurs des tableaux pour l'impression des résultats
+ * @author othe
+ */
+class ImpressionLargeursColonnesConstantes {
+
+ public static final List<Integer> LARGEURS_REGISTRE_APPEL = [47, 120, 90, 40, 90, 92, 106, 67, 75, 60]
+ public static final List<Integer> LARGEURS_APPEL_JOUR = [100, 125, 45, 75, 90, 90, 60, 67, 75, 60]
+ public static final List<Integer> LARGEURS_DEPART_RETARD = [150, 125, 45, 75, 90, 90, 60, 67, 75, 60]
+ public static final List<Integer> LARGEURS_INTERNAT = [100, 125, 45, 75, 90, 90, 60, 67, 75, 60]
+ public static final List<Integer> LARGEURS_DEMI_PENSION = [100, 125, 45, 75, 90, 90, 60, 67, 75, 60]
+ public static final List<Integer> LARGEURS_APPEL_OUBLIES = [100, 150, 45, 75, 90, 90, 60, 67, 75, 60]
+
+ private static final Integer TABLEAU_DE_BORD_COL = 55
+
+ public static final List<Integer> LARGEURS_TABLEAU_DE_BORD = [45, 80, TABLEAU_DE_BORD_COL,
+ TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL,
+ TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL,
+ TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL,
+ TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL, TABLEAU_DE_BORD_COL]
+
+ private static final Integer STATS_MENSUELLE_COL = 47
+
+ public static final List<Integer> LARGEURS_STAT_MENSUELLE = [80, STATS_MENSUELLE_COL,
+ STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL,
+ STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL,
+ STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL,
+ STATS_MENSUELLE_COL, STATS_MENSUELLE_COL, STATS_MENSUELLE_COL]
+
+
+ public static List<Integer> findAllLargeurColonnes(String typeDonnees) {
+
+ List<Integer> resultat
+
+ switch (typeDonnees) {
+
+ case TypeDonneesExport.MULTICRITERE:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_REGISTRE_APPEL
+ break
+
+ case TypeDonneesExport.ABS_JOURS:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_APPEL_JOUR
+ break
+
+ case TypeDonneesExport.RETARDS_JOURS:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_DEPART_RETARD
+ break
+
+ case TypeDonneesExport.DEPARTS_JOURS:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_DEPART_RETARD
+ break
+
+ case TypeDonneesExport.INTERNAT:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_INTERNAT
+ break
+
+ case TypeDonneesExport.DEMI_PENSION:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_DEMI_PENSION
+ break
+
+ case TypeDonneesExport.APPELS_OUBLIES:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_APPEL_OUBLIES
+ break
+
+ case TypeDonneesExport.TABLEAU_DE_BORD:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_TABLEAU_DE_BORD
+ break
+
+ case TypeDonneesExport.STAT_MENSUELLE:
+ resultat = ImpressionLargeursColonnesConstantes.LARGEURS_STAT_MENSUELLE
+ break
+
+ default:
+ throw new IllegalStateException("Tentative d'imprimer un modèle inconnu : ${typeDonnees}")
+
+ }
+
+ return resultat
+
+ }
+}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.impression.csv
+
+import org.lilie.services.eliot.temps.DateUtil
+import org.lilie.services.eliot.constantes.ConstDate
+
+/**
+ * Représente les données necessaire à la présentation des données d'un fichiers csv au moment de l'impression
+ * @author othe
+ */
+class ImpressionPresentationCsv {
+
+ String etablissement = ""
+ String titre = ""
+ String classe = ""
+ String debut = ""
+ String fin = ""
+
+ // Liste des largeurs de toutes les colonnes possibles
+ List<Integer> largeurs = []
+
+ // Liste numéro de colonne effectivement visible
+ List<Integer> colonnesvisibles = []
+
+ // Liste des nom de colonne du fichier csv
+ List<String> colonnes = []
+
+ public void parseDates(Map jsonParams) {
+ debut = DateUtil.parseDateJavascript(jsonParams.dateDebut).format(ConstDate.DATE_JJMMAAA)
+ fin = DateUtil.parseDateJavascript(jsonParams.dateFin).format(ConstDate.DATE_JJMMAAA)
+ }
+
+ public void parseDate(Map params) {
+ debut = DateUtil.parseDateJavascript(params.date).format(ConstDate.DATE_JJMMAAA)
+ fin = debut
+ }
+
+}
* indique si le responsable accepte l'envoi de sms
*/
public Boolean isAccepteSMS() {
+
switch (selectionAdresseResponsable) {
case SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1:
return (responsable1?.accepteSms)
case SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE2:
return (responsable2?.accepteSms)
}
+
}
/**
* Retourne le responsable associé choisit
*/
public Personne getResponsable() {
+
switch (selectionAdresseResponsable) {
case SelectionAdresseResponsableEnum.ADRESSE_RESPONSABLE1:
return responsable1
--- /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
+--%>
+
+
+<g:javascript library="commons/src/impressionresultats/ConfigServeur"
+ plugin="eliot-app-plugin"/>
+
+<g:render template="/commons/impressionresultats/modele"
+ plugin="eliot-app-plugin"/>
+
+<g:javascript library="commons/src/impressionresultats/Constantes"
+ plugin="eliot-app-plugin"/>
+<g:javascript library="commons/src/impressionresultats/BoutonImpressionView"
+ plugin="eliot-app-plugin"/>
+<g:javascript library="commons/src/impressionresultats/FenetreView"
+ plugin="eliot-app-plugin"/>
+<g:javascript library="commons/src/impressionresultats/ImpressionController"
+ plugin="eliot-app-plugin"/>
+
+<g:javascript library="commons/src/impressionresultats/Application"
+ plugin="eliot-app-plugin"/>
+
--- /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.impression.resultats.ConfigServeur">
+
+ <eliotjs:ns name="libelle">
+ <eliotjs:varI18n name="imprimer" code="eliot.impression.imprimer"/>
+ <eliotjs:varI18n name="ok" code="eliot.libelle.ok"/>
+ <eliotjs:varI18n name="annuler" code="eliot.libelle.annuler"/>
+ <eliotjs:varI18n name="titreDeDocument"
+ code="eliot.impression.titreDeDocument"/>
+ <eliotjs:varString name="titreDeDocumentParDefaut"
+ value="${impressionInfo.titreDocument}"/>
+ </eliotjs:ns>
+
+ <eliotjs:ns name="url">
+ <eliotjs:varLink name="imprimeDonnees" action="${impressionInfo.action}"
+ controller="${impressionInfo.controller}"/>
+ </eliotjs:ns>
+
+ </eliotjs:ns>
+</g:javascript>
\ 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.impression.resultats');
+
+/**
+ * @author bbel
+ */
+
+eliot.impression.resultats.Application = function () {
+ var Clazz = Ext.extend(Ext.util.Observable, {
+ constructor:function () {
+
+ this.ns = eliot.impression.resultats;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.boutonImpressionView = undefined;
+ },
+
+ getBoutonImpression:function (configs) {
+ if (this.boutonImpressionView) {
+ return this.boutonImpressionView.bouton;
+ }
+
+ this.boutonImpressionView = new this.ns.BoutonImpressionView({});
+
+ if (configs.composantModifieEtatBouton) {
+ this.boutonImpressionView.observeDemandeChangementEtat(
+ configs.composantModifieEtatBouton
+ );
+ }
+
+ var impressionController = new this.ns.ImpressionController({
+ callbackGetParametres1:configs.callbackGetParametres1,
+ callbackGetParametres2:configs.callbackGetParametres2
+ });
+
+ var fenetreView = new this.ns.FenetreView();
+ fenetreView.observeImpressionController(impressionController);
+
+ impressionController.observeBoutonImpressionView(this.boutonImpressionView);
+
+ impressionController.observeFenetreView(fenetreView);
+
+ return this.boutonImpressionView.bouton;
+ }
+
+
+ });
+
+ // Construit l'instance singleton
+ return new Clazz({
+ name:'eliot.impression.resultats-app'
+ });
+}();
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+Ext.ns('eliot.impression.resultats');
+
+/**
+ * @author bbel
+ */
+
+eliot.impression.resultats.BoutonImpressionView = Ext.extend(Ext.util.Observable, {
+ constructor:function (config) {
+
+ this.ns = eliot.impression.resultats;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.addEvents(
+ /**
+ * @event actionImprimer declancher sur un click
+ * permet de lancer l'impression des données en court
+ */
+ this.Constantes.eventId.actionImprimer
+ );
+
+ this.bouton = new Ext.Button({
+ disabled:true,
+ text:this.ConfigServeur.libelle.imprimer,
+ style:config.style,
+ width:config.width ? config.width : 60,
+ handler:function () {
+ this.fireEvent(
+ this.Constantes.eventId.actionImprimer
+ );
+ },
+ scope:this
+ });
+ },
+
+ observeDemandeChangementEtat:function (demandeur) {
+ demandeur.addListener(
+ this.Constantes.eventId.changeEtatBoutonImprimer,
+ this.setBoutonDesactive,
+ this
+ );
+ },
+
+ setBoutonDesactive:function (disactive) {
+ this.bouton.setDisabled(disactive);
+ }
+
+
+});
--- /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.impression.resultats');
+
+/**
+ * @author bbel
+ */
+
+eliot.impression.resultats.ConfigServeur = {
+
+ libelle:{
+ imprimer:undefined,
+ titreDeDocument:undefined,
+ titreDeDocumentParDefaut:undefined
+ },
+
+ url : {
+ imprimeDonnees : 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.impression.resultats');
+
+/**
+ * @author bbel
+ */
+
+eliot.impression.resultats.Constantes = {
+
+ eventId:{
+ actionImprimer:'actionImprimer',
+ changeEtatBoutonImprimer:'changeEtatBoutonImprimer',
+ executeImpression:'executeImpression',
+ afficheFenetreImpression:'afficheFenetreImpression'
+ }
+
+};
\ 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.impression.resultats');
+
+/**
+ * @author bbel
+ */
+
+eliot.impression.resultats.FenetreView = Ext.extend(Ext.util.Observable, {
+ constructor:function () {
+
+ this.ns = eliot.impression.resultats;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+
+ this.addEvents(
+ this.Constantes.eventId.executeImpression
+ );
+
+ this.window = new Ext.Window(this.getWindowConfig());
+ },
+
+
+ getWindowConfig:function () {
+ return {
+ title:this.ConfigServeur.libelle.imprimer,
+ modal:true,
+ closable:true,
+ border:true,
+ layout:'form',
+ labelWidth:110,
+ labelSeparator:' : ',
+ padding:10,
+ width:420,
+ height:120,
+ plain:true,
+ buttonAlign:'left',
+ closeAction:'hide',
+ items:[
+ this.getChampTitreDocument()
+ ],
+ buttons:this.getBouttons()
+ }
+ },
+
+ getChampTitreDocument:function () {
+ this.champTitreDocument = new Ext.form.TextField({
+ fieldLabel:this.ConfigServeur.libelle.titreDeDocument,
+ width:260
+ });
+
+ return this.champTitreDocument;
+ },
+
+ getBouttons:function () {
+
+ return [
+ '->',
+ {
+ text:this.ConfigServeur.libelle.ok,
+ handler:this.actionOk,
+ scope:this
+ }
+ ,
+ {
+ text:this.ConfigServeur.libelle.annuler,
+ handler:this.actionAnnuler,
+ scope:this
+ }
+ ]
+ },
+
+ actionOk:function () {
+ this.fireEvent(
+ this.Constantes.eventId.executeImpression,
+ this.champTitreDocument.getValue()
+ );
+ this.window.hide();
+ },
+
+ actionAnnuler:function () {
+ this.window.hide();
+ },
+
+ observeImpressionController:function (impressionController) {
+ impressionController.addListener(
+ this.Constantes.eventId.afficheFenetreImpression,
+ this.afficheFenetre,
+ this
+ )
+ },
+
+ afficheFenetre:function () {
+ this.champTitreDocument.setValue(this.ConfigServeur.libelle.titreDeDocumentParDefaut);
+ this.window.show();
+ }
+});
--- /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.impression.resultats');
+
+/**
+ * @author bbel
+ */
+
+eliot.impression.resultats.ImpressionController = Ext.extend(Ext.util.Observable, {
+ constructor:function (config) {
+
+ this.ns = eliot.impression.resultats;
+ this.ConfigServeur = this.ns.ConfigServeur;
+ this.Constantes = this.ns.Constantes;
+
+ this.Config = config;
+
+ this.addEvents(this.Constantes.eventId.afficheFenetreImpression);
+
+ },
+
+ observeBoutonImpressionView:function (boutonImpressionView) {
+ boutonImpressionView.addListener(
+ this.Constantes.eventId.actionImprimer,
+ this.actionImprimeDonnees,
+ this
+ )
+ },
+
+ observeFenetreView:function (fenetreView) {
+ fenetreView.addListener(
+ this.Constantes.eventId.executeImpression,
+ this.executeImprimeDonnees,
+ this
+ )
+ },
+
+
+ actionImprimeDonnees:function () {
+ this.fireEvent(this.Constantes.eventId.afficheFenetreImpression);
+ },
+
+ executeImprimeDonnees:function (titre) {
+ var lien = this.construitLien(titre);
+
+ window.open(
+ lien,
+ "_blank",
+ "height=600, width=800, toolbar=yes,menubar=no,scrollbars=yes"
+ );
+ },
+
+ construitLien:function (titre) {
+ var params = {
+ titre:titre
+ };
+
+ if (this.Config.callbackGetParametres1) {
+ this.addProperties(params, this.Config.callbackGetParametres1());
+ }
+
+ if (this.Config.callbackGetParametres2) {
+ this.addProperties(params, this.Config.callbackGetParametres2());
+ }
+
+ return this.ConfigServeur.url.imprimeDonnees + "?" + 'params=' + Ext.encode(params);
+ },
+
+ addProperties:function (object, properties) {
+ for (var key in properties) {
+ object[key] = properties[key];
+ }
+ return object;
+ }
+
+});
+
+
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.applications.absences.AbsencesType
import org.lilie.services.eliot.applications.absences.RegimeService
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.constantes.ConstDate
class AbstractConsultationController extends AbstractAbsencesController {
RegimeService regimeService
-/**
- * Récupère les paramètres de motifs
- * @param params : les paramètres de la requêtes
- * @param criteria : le criteria à compléter
- * @return un BilanCriteria complété avec les motifs
- * @author jbui
- */
- protected void parseCriteriaMotifs(def listeMotifs,
- listeGroupeMotifs,
- BasicCriteresRecherche criteria) {
- if (listeMotifs) {
- criteria.motifIds = (listeMotifs as String).split(',').collect {
- Long.parseLong(it)
- }
- } else {
- criteria.motifIds = []
- }
- if ((criteria.motifIds.size() > 0) &&
- (criteria.motifIds[0] == BasicCriteresRecherche.VALEUR_TOUS)) {
- parseCriteriaGroupeMotifs(listeGroupeMotifs, criteria)
- }
- }
-/**
- * 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
- */
- protected void parseCriteriaGroupeMotifs(def listeGroupeMotifs,
- BasicCriteresRecherche bilanCriteria) {
- List<Long> groupeMotifs
- if (listeGroupeMotifs) {
- groupeMotifs = (listeGroupeMotifs as String).split(',').collect {
- Long.parseLong(it)
- }
- } else {
- groupeMotifs = []
- }
- bilanCriteria.motifIds.clear()
- if ((groupeMotifs.size() > 0) && (groupeMotifs[0] == BasicCriteresRecherche.VALEUR_TOUS)) {
- bilanCriteria.motifIds << BasicCriteresRecherche.VALEUR_TOUS
- } else {
- groupeMotifs.each {
- bilanCriteria.motifIds.addAll(
- Motif.findAllByGroupeMotif(
- GroupeMotif.get(it)
- )*.id)
- }
- }
- }
/**
* Récupère les paramètres de dates
DateUtil.setFinJour(criteria.dateFin)
}
-/**
- * Récupère les paramètres de divisions
- * @param params : les paramètres de la requêtes
- * @return un BilanCriteria complété avec les divisions
- * @author jbui
- */
- protected void parseBilanCriteriaDivisions(def listeDivisions, BasicCriteresRecherche criteria) {
- if (listeDivisions) {
- criteria.structIds = (listeDivisions as String).split(',').collect {
- Long.parseLong(it)
- }
- } else {
- criteria.structIds = []
- }
- }
-
/**
- * Récupère les paramètres des élèves
- * @param params : les paramètres de la requêtes
- * @return un BilanCriteria complété avec les divisions
- * @author bahj
+ * Traduit le résultat du bilan
+ * @param la map contenant le bilan
+ * @return la même map traduite
+ * @author jbui
*/
- protected void parseBilanCriteriaEleves(def listeEleves, BasicCriteresRecherche criteria) {
- if (listeEleves) {
- List<Long> autoriteElevesId = []
- List personneElevesId = (listeEleves as String).split(',').collect {
- Long.parseLong((String) it)
- }
-
- // Elèves
- if (!personneElevesId.contains(VALEUR_TOUS)) {
- List<Personne> personneEleves = Personne.getAll(personneElevesId)
- autoriteElevesId = personneEleves*.autorite.id
+ protected ResultatConsultation traduitResultatBilan(ResultatConsultation liste) {
+ SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat(ConstDate.DATE_JJMMAAA,
+ Locale.FRANCE)
+ SimpleDateFormat simpleDateFormatHeure = new SimpleDateFormat(ConstDate.HEURE_HHMM,
+ Locale.FRANCE)
+ liste.lignes.each {
+ LigneConsultation it ->
+ it.absenceTypeMessage = message(code: it.absenceTypeMessageCode)
+ it.dateFormatee = simpleDateFormatDate.format(it.date)
+ if (it.heure) {
+ it.heureFormatee = message(code: it.heure.codeMessage,
+ args: [
+ simpleDateFormatHeure.format(it.heure.heure1),
+ simpleDateFormatHeure.format(it.heure.heure2)
+ ])
}
-
- criteria.eleveIds = autoriteElevesId
- }
- else {
- criteria.eleveIds = []
}
+ return liste
}
- /**
- * Récupère les paramètres des regimes
- * @param params : les paramètres de la requêtes
- * @return un BilanCriteria complété avec les regimes
- * @author msan
- */
- protected void parseCriteriaRegimes(def listeRegimes, BasicCriteresRecherche criteria) {
- if (listeRegimes) {
- List<Long> regimeIds = (listeRegimes as String).split(',').collect {
- Long.parseLong((String) it)
- }
- if (regimeIds.contains(VALEUR_TOUS)) {
- regimeIds = regimeService.findAll().collect{ it.id }
- }
- criteria.regimeIds = regimeIds
- } else {
- criteria.regimeIds = []
- }
- }
-/**
- * Récupère les paramètres de type
- * @param params : les paramètres de la requêtes
- * @return un BilanCriteria complété avec les types
- * @author jbui
- * @author bahj
- */
- protected void parseBilanCriteriaType(def listeTypes, BasicCriteresRecherche criteria) {
- List<Integer> typesEnInt
- if (listeTypes) {
- typesEnInt = (listeTypes as String).split(',').collect {
- Integer.parseInt((String) it)
- }
- } else {
- typesEnInt = []
- }
- if (typesEnInt.contains(BasicCriteresRecherche.VALEUR_TOUS as Integer)) {
- criteria.setTousTypes(true)
- criteria.demiPension = false
- criteria.internat = false
- }
- else {
- criteria.setTousTypes(false)
- for (int type: typesEnInt) {
- switch (type) {
- case AbsencesType.ABSENCE_VALABLE.id:
- criteria.absencesValables = true
- break
-
- case AbsencesType.ABSENCE_NON_VALABLE.id:
- criteria.absencesNonValables = true
- break
-
- case AbsencesType.ABSENCE_PREVISIONNELLE.id:
- criteria.absencesPrevisionnelles = true
- break
-
- case AbsencesType.RETARD.id:
- criteria.retards = true
- break
-
- case AbsencesType.DEPART_ANTICIPE.id:
- criteria.departsAnticipes = true
- break
-
- case AbsencesType.DEMI_PENSION.id:
- criteria.demiPension = true
- break
-
- case AbsencesType.INTERNAT.id:
- criteria.internat = true
- break
-
- }
- }
- }
- }
}
import org.lilie.services.eliot.urllabel.UrlLabelInfo
import org.lilie.services.eliot.absences.Motif
import org.lilie.services.eliot.applications.absences.PriseEnCompteMotif
-
import org.lilie.services.eliot.absences.AbsencesFonctionnalite
import org.lilie.services.eliot.constantes.ConstDate
import org.lilie.services.eliot.CodeComparator
+import org.lilie.services.eliot.export.TypeDonneesExport
class ConsultationController extends AbstractConsultationController {
EleveAnnuaireService eleveAnnuaireService
AbsencesPreparationExportCSVService absencesPreparationExportCSVService
ConsultationService consultationService
+ AbsencesSelonCriteresService absencesSelonCriteresService
def multicriteresIndex = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
// on complète le modèle
modele.bilanLignesParPage = grailsApplication.config.eliot.absences.bilan.nombreLignesParPage
- modele.actionListeBilan = 'listerBilanAbsenceRegroupeesRetard'
+ modele.actionListeBilan = 'listerBilanAbsenceRetard'
Boolean afficheMessageErreur = chainModel?.afficheMessageErreur ?: false
modele.afficheMessageErreur = afficheMessageErreur
] as JSON
modele.actionExporteDonnees = 'exporteDonneesAbsences'
+
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeDonneesAbsences',
+ 'eliot.impression.resultats.multiCriteres'
+ )
+
render(
view: '/consultation/multicriteres/index',
model: modele
)
}
-
def absencesIndex = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
// construction du modèle
// on complète le modèle
modele.bilanLignesParPage = grailsApplication.config.eliot.absences.bilan.nombreLignesParPage
- modele.actionListeBilan = 'listerBilanAbsenceRegroupeesRetard'
+ modele.actionListeBilan = 'listerBilanAbsenceRetard'
modele.actionExporteDonnees = 'exporteDonneesAbsences'
+
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeDonneesAbsences',
+ 'eliot.impression.resultats.absDuJour'
+ )
+
modele.motifIdsDefaut = getMotifIdsDefaut()
render(
)
}
+ private Map getImpressionInfo(String action, String titreI18N) {
+ return [
+ action: action,
+ controller: "consultationImpression",
+ titreDocument: message(code: titreI18N)
+ ]
+ }
+
def retardsIndex = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
// construction du modèle
modele.actionExporteDonnees = 'exporteDonneesAbsences'
modele.motifIdsDefaut = getMotifIdsDefaut()
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeDonneesAbsences',
+ 'eliot.impression.resultats.retardDuJour'
+ )
+
render(
view: '/consultation/retards/index',
model: modele
modele.actionExporteDonnees = 'exporteDonneesAbsences'
modele.motifIdsDefaut = getMotifIdsDefaut()
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeDonneesAbsences',
+ 'eliot.impression.resultats.departAnticipesDuJour'
+ )
+
render(
view: '/consultation/departs/index',
model: modele
modele.actionExporteDonnees = 'exporteInternats'
modele.motifIdsDefaut = getMotifIdsDefaut()
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeInternats',
+ 'eliot.impression.resultats.internat'
+ )
+
render(
view: '/consultation/demipensioninternat/index',
model: modele
modele.actionExporteDonnees = 'exporteDemiPensions'
modele.motifIdsDefaut = getMotifIdsDefaut()
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeDemiPensions',
+ 'eliot.impression.resultats.demiPension'
+ )
+
render(
view: '/consultation/demipensioninternat/index',
model: modele
def jsonParams = JSON.parse(params.params)
- def exportFonction
-
- String nomFichier
+ String nomFichier = ""
switch (jsonParams.type) {
- case '-1':
+ case TypeDonneesExport.MULTICRITERE:
nomFichier = 'liste-multi-critere'
- jsonParams.map = absencesPreparationExportCSVService.MULTICRITERS_COLONNES
- exportFonction = exporteCsvAbsencesRegroupees(jsonParams, response, nomFichier)
break
- case '1,2,3':
+ case TypeDonneesExport.ABS_JOURS:
nomFichier = 'absences-jour'
- jsonParams.map = absencesPreparationExportCSVService.ABS_JOUR_COLONNES
- exportFonction = exporteCsvAbsencesRegroupees(jsonParams, response, nomFichier)
break
- case '4':
+ case TypeDonneesExport.RETARDS_JOURS:
nomFichier = 'retards-jour'
- jsonParams.map = absencesPreparationExportCSVService.RETARD_DEPART_JOUR_COLONNES
- exportFonction = exporteCsv(jsonParams, response, nomFichier)
break
- case '5':
+ case TypeDonneesExport.DEPARTS_JOURS:
nomFichier = 'departs-jour'
- jsonParams.map = absencesPreparationExportCSVService.RETARD_DEPART_JOUR_COLONNES
- exportFonction = exporteCsv(jsonParams, response, nomFichier)
break
+
+ default:
+ throw new IllegalArgumentException("On en peut pas appeler cette action avec le type : ${jsonParams.type}")
}
- exportFonction(jsonParams, response, nomFichier)
+ exporteCsv(jsonParams, response, nomFichier)
}
/**
def exporteDemiPensions = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
def jsonParams = JSON.parse(params.params)
- jsonParams.type = AbsencesType.DEMI_PENSION.id
- jsonParams.map = absencesPreparationExportCSVService.DEMI_PENSION_INETRNAT
+ jsonParams.type = TypeDonneesExport.DEMI_PENSION
exporteCsv(jsonParams, response, 'absences-demi-pension')
}
def exporteInternats = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
def jsonParams = JSON.parse(params.params)
- jsonParams.type = AbsencesType.INTERNAT.id
- jsonParams.map = absencesPreparationExportCSVService.DEMI_PENSION_INETRNAT
+ jsonParams.type = TypeDonneesExport.INTERNAT
exporteCsv(jsonParams, response, 'absences-internat')
}
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesSelonCriteres(
+ absencesSelonCriteresService.getAbsencesSelonCriteres(
+ getSecuriteSession(),
+ etablissementCourant(),
jsonParams,
'',
'-1',
)
)
- DonneesPourExportCSV donnees = absencesPreparationExportCSVService.
- prepareExportAbsencesMulticritere(listeBilan, jsonParams.colonnes, jsonParams.map)
-
- sendCsvFile(response, donnees, nomFichier ?: 'absences')
-
- }
-
- /**
- * Exporte les données au format CSV
- * @param jsonParams Paramètres parsés
- * @param response HTTP
- */
- private def exporteCsvAbsencesRegroupees(def jsonParams, HttpServletResponse response, String nomFichier) {
-
- verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
-
- ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesRegroupeesSelonCriteres(
- jsonParams,
- '',
- '-1',
- jsonParams.sortInfo.field,
- jsonParams.sortInfo.direction
- )
- )
+ Map organisationTableau = absencesPreparationExportCSVService.findOrganisationTableau(params.type)
DonneesPourExportCSV donnees = absencesPreparationExportCSVService.
- prepareExportAbsencesMulticritere(listeBilan, jsonParams.colonnes, jsonParams.map)
+ prepareExportAbsencesMulticritere(listeBilan, jsonParams.colonnes, organisationTableau)
sendCsvFile(response, donnees, nomFichier ?: 'absences')
parametres.groupeMotifs = '-1'
ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesSelonCriteres(
+ absencesSelonCriteresService.getAbsencesSelonCriteres(
+ getSecuriteSession(),
+ etablissementCourant(),
parametres,
params.start,
params.limit,
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesSelonCriteres(
- (Map) JSON.parse(params.params),
- params.start,
- params.limit,
- params.sort,
- params.dir,
- true
- )
- )
-
- render listeBilan.toMap() as JSON
- }
-
- /**
- * Pour la vue des bilans d'absences et retards
- */
- def listerBilanAbsenceRegroupeesRetard = {
- verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
-
- ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesRegroupeesSelonCriteres(
+ absencesSelonCriteresService.getAbsencesSelonCriteres(
+ getSecuriteSession(),
+ etablissementCourant(),
(Map) JSON.parse(params.params),
params.start,
params.limit,
Map parametres = JSON.parse(params.params)
parametres.type = AbsencesType.DEMI_PENSION.id
ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesSelonCriteres(
+ absencesSelonCriteresService.getAbsencesSelonCriteres(
+ getSecuriteSession(),
+ etablissementCourant(),
parametres,
params.start,
params.limit,
Map parametres = JSON.parse(params.params)
parametres.type = AbsencesType.INTERNAT.id
ResultatConsultation listeBilan = traduitResultatBilan(
- getAbsencesSelonCriteres(
+ absencesSelonCriteresService.getAbsencesSelonCriteres(
+ getSecuriteSession(),
+ etablissementCourant(),
parametres,
params.start,
params.limit,
}
/**
- * @param compteEleves si true, compte le total des eleves
+ * Retourne une liste des divisions de l'établissement pour un directeur/CPE,
+ * de l'enseignant pour un enseignant.
*/
- @SuppressWarnings('CatchException')
- private ResultatConsultation getAbsencesSelonCriteres(Map params,
- String start,
- String limit,
- String sortField,
- String sens,
- Boolean compteEleves = false
- ) {
-
- BilanCriteresRecherche criteria = getBilanCriteresRecherche(params,
- compteEleves, sortField, sens, start, limit)
- ResultatConsultation listeBilan = new ResultatConsultation()
- try {
- listeBilan = traduitProfilAppelant(consultationService.listeDesAbsencesEtRetards(
- criteria,
- getSecuriteSession(),
- etablissementCourant()
- ),
- ConsultationService.SEPARATEUR_PROFILS)
- } catch (Exception e) {
- log.error("Une erreur inconnue est survenue lors de la récupération des absences/retards.", e)
- listeBilan.success = false
- listeBilan.message = message(code: "absences.bilan.erreur")
- }
-
- return listeBilan
- }
-
- @SuppressWarnings('CatchException')
- private ResultatConsultation getAbsencesRegroupeesSelonCriteres(Map params,
- String start,
- String limit,
- String sortField,
- String sens,
- Boolean compteEleves = false
- ) {
-
- BilanCriteresRecherche criteria = getBilanCriteresRecherche(params,
- compteEleves, sortField, sens, start, limit)
- ResultatConsultation listeBilan = new ResultatConsultation()
- try {
- listeBilan = traduitProfilAppelant(consultationService.listeDesAbsencesEtRetardsRegroupes(
- criteria,
- getSecuriteSession(),
- etablissementCourant()
- ),
- ConsultationService.SEPARATEUR_PROFILS_AFFICHAGE)
- } catch (Exception e) {
- log.error("Une erreur inconnue est survenue lors de la récupération des absences/retards.", e)
- listeBilan.success = false
- listeBilan.message = message(code: "absences.bilan.erreur")
- }
-
- return listeBilan
- }
-
- private BilanCriteresRecherche getBilanCriteresRecherche(Map params,
- boolean compteEleves,
- String sortField,
- String sens,
- String start,
- String limit) {
- BilanCriteresRecherche criteria = parseBilanCriteria(params)
- criteria.etablissementId = etablissementCourantId()
- criteria.compteEleves = compteEleves
-
- criteria.colonneClassement = sortField ?:
- ConstantesNomColBilanAbsences.NOM_COL_NOM_PRENOM
- criteria.classementAscendant = (sens != 'DESC')
- criteria.start = start ? Integer.parseInt(start) : 0
- criteria.limit = limit ? Integer.parseInt(limit) :
- grailsApplication.config.eliot.absences.bilan.nombreLignesParPage
- return criteria
- }
-
-/**
- * Retourne une liste des divisions de l'établissement pour un directeur/CPE,
- * de l'enseignant pour un enseignant.
- */
def listeDivisions = {
List listeDivision = formateStructureEnseignement(
return calendrier
}
-/**
- * Traduit le résultat du bilan
- * @param la map contenant le bilan
- * @return la même map traduite
- * @author jbui
- */
- private ResultatConsultation traduitResultatBilan(ResultatConsultation liste) {
- SimpleDateFormat simpleDateFormatDate = new SimpleDateFormat(ConstDate.DATE_JJMMAAA,
- Locale.FRANCE)
- SimpleDateFormat simpleDateFormatHeure = new SimpleDateFormat(ConstDate.HEURE_HHMM,
- Locale.FRANCE)
- liste.lignes.each {
- LigneConsultation it ->
- it.absenceTypeMessage = message(code: it.absenceTypeMessageCode)
- it.dateFormatee = simpleDateFormatDate.format(it.date)
- if (it.heure) {
- it.heureFormatee = message(code: it.heure.codeMessage,
- args: [
- simpleDateFormatHeure.format(it.heure.heure1),
- simpleDateFormatHeure.format(it.heure.heure2)
- ])
- }
- }
- return liste
- }
-
-/**
- * Récupère les critères de sélection et de classement dans Params
- * @param params : les paramètres de la requêtes
- * @return un BilanCriteria rempli
- * @author jbui
- */
- private BilanCriteresRecherche parseBilanCriteria(Map params) {
- BilanCriteresRecherche criteria = new BilanCriteresRecherche()
- parseBilanCriteriaType(params.type, criteria)
- parseBilanCriteriaDates(params, criteria)
- parseCriteriaMotifs(params.motif, params.groupeMotifs, criteria)
- parseBilanCriteriaDivisions(params.division, criteria)
- parseBilanCriteriaEleves(params.elevesId, criteria)
- parseCriteriaRegimes(params.regimeIds, criteria)
- return criteria
- }
-
-
private List formateStructureEnseignement(List<StructureEnseignement> structures) {
return structures.collect {StructureEnseignement struct ->
[
return breadCrumbsInfo
}
- protected void parseBilanCriteriaDates(Map params,
- BasicCriteresRecherche criteria) {
- String dateDebut = params.dateDebut
- String dateFin = params.dateFin
-
- criteria.dateDebut.setTime(DateUtil.parseDateJavascript(dateDebut))
- criteria.dateFin.setTime(DateUtil.parseDateJavascript(dateFin))
- }
-
/**
* traduit les codes I18n correspondant à profilAppelant
*/
String separateurAAfficher) {
resultatConsultation.lignes.each {LigneConsultation ligne ->
String profils = ligne.profilAppelant.split(ConsultationService.SEPARATEUR_PROFILS)
- .toList()
- .collect {message(code: it)}
- .join(separateurAAfficher)
+ .toList()
+ .collect {message(code: it)}
+ .join(separateurAAfficher)
ligne.setProfilAppelant(profils)
}
return resultatConsultation
}
+ /**
+ * @return une chaine contenant les id des motifs par defaut, séparés par
+ * des virgules
+ */
+ private String getMotifIdsDefaut() {
+ List<Motif> motifDefauts = motifService.findAllMotifForPriseEnCompteMotif(
+ preferencesEtablissementCourant,
+ PriseEnCompteMotif.STATS,
+ false
+ )
+ return motifDefauts*.id.join(',')
+ }
+
protected Boolean traiteChangementEtablissement(Map params, Page page) {
Boolean changeEtab = false
if (params.etablissementId) {
return changeEtab
}
- /**
- * @return une chaine contenant les id des motifs par defaut, séparés par
- * des virgules
- */
- private String getMotifIdsDefaut() {
- List<Motif> motifDefauts = motifService.findAllMotifForPriseEnCompteMotif(
- preferencesEtablissementCourant,
- PriseEnCompteMotif.STATS,
- false
- )
- return motifDefauts*.id.join(',')
+ protected void parseBilanCriteriaDates(Map params,
+ BasicCriteresRecherche criteria) {
+ String dateDebut = params.dateDebut
+ String dateFin = params.dateFin
+
+ criteria.dateDebut.setTime(DateUtil.parseDateJavascript(dateDebut))
+ criteria.dateFin.setTime(DateUtil.parseDateJavascript(dateFin))
}
}
--- /dev/null
+/*
+ * Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ * This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ *
+ * Lilie is free software. You can redistribute it and/or modify since
+ * you respect the terms of either (at least one of the both license) :
+ * - under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ * - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ * License, or any later version
+ *
+ * There are special exceptions to the terms and conditions of the
+ * licenses as they are applied to this software. View the full text of
+ * the exception in file LICENSE.txt in the directory of this software
+ * distribution.
+ *
+ * Lilie is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Licenses for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the CeCILL-C along with Lilie. If not, see :
+ * <http://www.gnu.org/licenses/> and
+ * <http://www.cecill.info/licences.fr.html>.
+ */
+
+package org.lilie.services.eliot.absences.consultation
+
+import org.lilie.services.eliot.absences.AbsencesFonctionnalite
+import org.lilie.services.eliot.absences.impression.ImpressionCsvAbsencesService
+import grails.converters.JSON
+
+import org.lilie.services.eliot.export.TypeDonneesExport
+import org.lilie.services.eliot.absences.consultation.appelsoublies.AppelsOubliesCommand
+import org.lilie.services.eliot.absences.consultation.appelsoublies.AppelsOubliesInfo
+import org.lilie.services.eliot.export.DonneesPourExportCSV
+import org.lilie.services.eliot.absences.consultation.appelsoublies.AppelsOubliesService
+import org.lilie.services.eliot.absences.export.AppelsOubliesPreparationExportCSVService
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.constantes.ConstDate
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+
+/**
+ * Dédié à l'impression en pdf des fichier csv
+ * @author othe
+ */
+class ConsultationImpressionController extends AbstractConsultationController {
+
+ private final static VALEUR_TOUS_ENSEIGNANTS = 'Enseignants_Tous'
+
+ ImpressionCsvAbsencesService impressionCsvAbsencesService
+ AbsencesSelonCriteresService absencesSelonCriteresService
+ AppelsOubliesService appelsOubliesService
+ AppelsOubliesPreparationExportCSVService appelsOubliesPreparationExportCSVService
+
+ def imprimeDonneesAbsences = {
+
+ verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
+
+ def jsonParams = JSON.parse(params.params)
+
+ exportePdf(jsonParams, response)
+
+ }
+
+ def imprimeDemiPensions = {
+
+ verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
+
+ def jsonParams = JSON.parse(params.params)
+
+ jsonParams.type = TypeDonneesExport.DEMI_PENSION
+
+ exportePdf(jsonParams, response)
+ }
+
+ def imprimeInternats = {
+
+ verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
+
+ def jsonParams = JSON.parse(params.params)
+
+ jsonParams.type = TypeDonneesExport.INTERNAT
+
+ exportePdf(jsonParams, response)
+ }
+
+ def imprimeAppelsOublies = {
+
+ verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
+
+ // préparation de la command
+ Map jsonParams = JSON.parse(params.params)
+ jsonParams.limit = -1
+ if (jsonParams.enseignantId == VALEUR_TOUS_ENSEIGNANTS) {
+ jsonParams.enseignantId = null
+ }
+
+ ByteArrayOutputStream pdf = impressionCsvAbsencesService.imprimeAppelsOublies(
+ jsonParams,
+ etablissementCourant())
+
+ String fileName = jsonParams.titre ?: 'appelsoublies'
+
+ sendFile(
+ response,
+ pdf,
+ fileName,
+ ".pdf",
+ "application/pdf"
+ )
+
+ }
+
+ private def exportePdf(def jsonParams, def response) {
+
+ ResultatConsultation liste = absencesSelonCriteresService.getAbsencesSelonCriteres(
+ getSecuriteSession(),
+ etablissementCourant(),
+ jsonParams,
+ '',
+ '-1',
+ jsonParams.sortInfo.field,
+ jsonParams.sortInfo.direction
+ )
+
+ ResultatConsultation listeBilan = traduitResultatBilan(
+ liste
+ )
+
+ ByteArrayOutputStream pdf = impressionCsvAbsencesService.imprimeDonneesAbsences(jsonParams,
+ listeBilan,
+ jsonParams.titre,
+ etablissementCourant())
+
+ String fileName = jsonParams.titre ?: 'absences'
+
+ sendFile(
+ response,
+ pdf,
+ fileName,
+ ".pdf",
+ "application/pdf"
+ )
+
+ }
+
+}
String structureIds
Long start
Long limit
+ String titre
Date parsedDate = null
List<Long> parsedStructureIds
import org.lilie.services.eliot.export.DonneesPourExportCSV
import org.lilie.services.eliot.absences.export.AppelsOubliesPreparationExportCSVService
-import org.lilie.services.eliot.securite.impl.Autorite
-
/**
* Contrôleur de consultation des appels oubliés
* @author jtra
AppelsOubliesPreparationExportCSVService appelsOubliesPreparationExportCSVService
private final static VALEUR_TOUS_ENSEIGNANTS = 'Enseignants_Tous'
- private final static Long VALEUR_TOUS_STRUCTURES = (Long) -1
+
private final static SimpleDateFormat SDF_HH_MM = new SimpleDateFormat("HH:mm")
def index = {
modele.nomsFields = getNomsFields()
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeAppelsOublies',
+ 'eliot.impression.resultats.appelsOublies'
+ )
+
render(
view: '/consultation/appelsoublies/index',
model: modele
)
}
+ private Map getImpressionInfo(String action, String titreI18N) {
+ return [
+ action: action,
+ controller : 'consultationImpression',
+ titreDocument: message(code: titreI18N)
+ ]
+ }
+
def majHeuresDebutEtFinPlages = {
Calendrier calendrier = getCalendrier()
Map modele = [:]
modele.put('date', params.date)
getHeuresDebutEtFinPlages(calendrier, modele)
Map resultats = [
- heureDebutDefaut : modele.heureDebutDefaut,
- heureFinDefaut : modele.heureFinDefaut,
- listeHeureDebut : modele.listeHeureDebut,
- listeHeureFin : modele.listeHeureFin
+ heureDebutDefaut: modele.heureDebutDefaut,
+ heureFinDefaut: modele.heureFinDefaut,
+ listeHeureDebut: modele.listeHeureDebut,
+ listeHeureFin: modele.listeHeureFin
]
render resultats as JSON
DateUtil.parseDateJavascript(modele.date) :
getDate(calendrier.premierJour, calendrier.dernierJour)
- List<PlageHoraire> plagesHorairesOuvertes = plages.findAll{plageHoraireService.isPlageHoraireOuverte(date,
- jourFeries, it, calendrier)}
+ List<PlageHoraire> plagesHorairesOuvertes = plages.findAll {
+ plageHoraireService.isPlageHoraireOuverte(date,
+ jourFeries, it, calendrier)
+ }
- List<Date> heuresDebut = plagesHorairesOuvertes.collect{SDF_HH_MM.format(new Date(it.debut.getTime()))}
- List<Date> heuresFin = plagesHorairesOuvertes.collect{SDF_HH_MM.format(new Date(it.fin.getTime()))}
+ List<Date> heuresDebut = plagesHorairesOuvertes.collect {SDF_HH_MM.format(new Date(it.debut.getTime()))}
+ List<Date> heuresFin = plagesHorairesOuvertes.collect {SDF_HH_MM.format(new Date(it.fin.getTime()))}
Map<Long, String> heuresDebutMap = (Map<Long, String>) [:]
Map<Long, String> heuresFinMap = (Map<Long, String>) [:]
Long id = 1
PlageHoraire plageHoraireActuelle = plageHoraireService.getPlageHoraireActuelle(plagesHorairesOuvertes)
Date heureDebutDefaut = plageHoraireActuelle?.debut
Date heureFinDefaut = plageHoraireActuelle?.fin
- String heureDebutDefautStr = heureDebutDefaut ? SDF_HH_MM.format(heureDebutDefaut).replaceFirst(":","h") : ""
- String heureFinDefautStr = heureFinDefaut ? SDF_HH_MM.format(heureFinDefaut).replaceFirst(":","h") : ""
+ String heureDebutDefautStr = heureDebutDefaut ? SDF_HH_MM.format(heureDebutDefaut).replaceFirst(":", "h") : ""
+ String heureFinDefautStr = heureFinDefaut ? SDF_HH_MM.format(heureFinDefaut).replaceFirst(":", "h") : ""
modele.heureDebutDefaut = heureDebutDefautStr
modele.heureFinDefaut = heureFinDefautStr
]
}
+// AppelsOubliesService AppelsOubliesService
+
def recherche = { AppelsOubliesCommand command ->
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
- consolideListeStructures(command)
+ appelsOubliesService.consolideListeStructures(command, etablissementCourant())
if (command.enseignantId == VALEUR_TOUS_ENSEIGNANTS) {
command.enseignantId = null
return msg
}
-
def exporteAppelsOublies = {
+
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_CONSULT_DIR)
// préparation de la command
}
AppelsOubliesCommand command = new AppelsOubliesCommand(jsonParams)
command.validate()
- consolideListeStructures(command)
+ appelsOubliesService.consolideListeStructures(command, etablissementCourant())
AppelsOubliesInfo info = appelsOubliesService.listeAppelsOublies(command)
sendCsvFile(response, donnees, 'appels oublies')
}
- /**
- * Filtre ou complète la liste des structures
- */
- private void consolideListeStructures(AppelsOubliesCommand command) {
- List<StructureEnseignement> structuresAutorisees =
- findStructuresAutorisees(command)
- if (command.parsedStructureIds?.contains(VALEUR_TOUS_STRUCTURES)) {
- command.parsedStructureIds = structuresAutorisees*.id
- } else {
- List<Long> structureIds = []
- command.parsedStructureIds.each {
- structureId ->
- if (structuresAutorisees.find {
- structAutorisee ->
- structAutorisee.id == structureId
- }) {
- structureIds << structureId
- }
- }
- }
- }
-
- /**
- * Retourne la liste des structures autorisées en fonction de la requête
- */
- private List<StructureEnseignement> findStructuresAutorisees(AppelsOubliesCommand command) {
- List<StructureEnseignement> structuresAutorisees = []
- if (command.enseignantId) {
- Autorite enseignant = Autorite.get(command.enseignantId)
- structuresAutorisees.addAll(
- localStructureEnseignementService.
- findAllStructureEnseignementByEnseignantAndEtablissement(
- enseignant,
- etablissementCourant()
- )
- )
- }
- else {
- structuresAutorisees.addAll(
- localStructureEnseignementService.
- findAllClasseByEtablissement(etablissementCourant()
- )
- )
- }
- return structuresAutorisees
- }
-
private Closure closureFormatHeure = {
Date heureDebut, Date heureFin ->
SimpleDateFormat sdf = new SimpleDateFormat(ConstDate.HEURE_HHMM, Locale.FRANCE)
import org.lilie.services.eliot.absences.Motif
import org.lilie.services.eliot.temps.DateUtil
import org.lilie.services.eliot.CodeComparator
+import org.lilie.services.eliot.absences.consultation.AbsencesSelonCriteresService
class PublipostageController extends AbstractConsultationController {
ImpressionTemplateDocumentService impressionTemplateDocumentService
PublipostageDirectService publipostageDirectService
PublipostageDiffereService publipostageDiffereService
+ AbsencesSelonCriteresService absencesSelonCriteresService
def index = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_PUBLIPOSTAGE)
result.departsAnticipes = false
result.demiPension = false
result.internat = false
- result.etablissementId = securiteSession.getEtablissementCourant().id
+ result.etablissementId = etablissementCourant().id
return result
}
private PublipostageCriteresRecherche parseCriteriaCommuns(Map params) {
PublipostageCriteresRecherche result = new PublipostageCriteresRecherche()
- this.parseCriteriaMotifs(
+ absencesSelonCriteresService.parseCriteriaMotifs(
params.motifId,
params.groupeDeMotifId,
result)
- this.parseBilanCriteriaDates(
+ absencesSelonCriteresService.parseBilanCriteriaDates(
params,
result)
- this.parseBilanCriteriaDivisions(
+ absencesSelonCriteresService.parseBilanCriteriaDivisions(
params.classesId,
result)
- this.parseBilanCriteriaType(
+ absencesSelonCriteresService.parseBilanCriteriaType(
params.typeAbsenceId,
result)
* <http://www.gnu.org/licenses/> and
* <http://www.cecill.info/licences.fr.html>.
*
- * @author: onicollet
*/
package org.lilie.services.eliot.absences.statistique
import org.lilie.services.eliot.absences.statistiques.StatsMarshallerService
import org.lilie.services.eliot.absences.statistiques.mensuelle.AbsencesStatsMensuellesService
import org.lilie.services.eliot.absences.AbsencesFonctionnalite
+import org.lilie.services.eliot.absences.statistiques.StatistiqueParserService
class StatistiqueHebdomadaireController extends AbstractAbsencesController {
--- /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.statistique
+
+import org.lilie.services.eliot.absences.AbsencesFonctionnalite
+import grails.converters.JSON
+import org.lilie.services.eliot.absences.consultation.AbstractConsultationController
+import org.lilie.services.eliot.absences.impression.ImpressionCsvAbsencesService
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+
+/**
+ * Impression des tablaux de statistiques
+ * @author othe
+ */
+class StatistiqueImpressionController extends AbstractConsultationController {
+
+ ImpressionCsvAbsencesService impressionCsvAbsencesService
+ LocalStructureEnseignementService localStructureEnseignementService
+
+ def imprimeTempsReel = {
+
+ verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_STATS)
+
+ Map mapParams = (Map) JSON.parse(params.params)
+ ByteArrayOutputStream pdf = impressionCsvAbsencesService.imprimeTempsReel(getSecuriteSession(),
+ mapParams,
+ etablissementCourant(),
+ preferencesEtablissementCourant
+ )
+
+ String fileName = mapParams.titre ?: 'tableauDebord'
+
+ sendFile(
+ response,
+ pdf,
+ fileName,
+ ".pdf",
+ "application/pdf"
+ )
+
+ }
+
+ def imprimeTableauDeBord = {
+
+ verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_STATS)
+
+ Map paramDatas = (Map) JSON.parse(params.params)
+
+ ByteArrayOutputStream pdf = impressionCsvAbsencesService.imprimeTableauDeBord(paramDatas,
+ preferencesEtablissementCourant,
+ etablissementCourant())
+
+ String fileName = paramDatas.titre ?: 'tableauDebord'
+
+ sendFile(
+ response,
+ pdf,
+ fileName,
+ ".pdf",
+ "application/pdf"
+ )
+
+ }
+
+}
(preferencesEtablissementCourant.pasDecompte !=
PreferencesEtablissementAbsences.DECOMPTE_HEURE)
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeTableauDeBord',
+ 'eliot.impression.resultats.tableauDeBord'
+ )
+
render(
view: '/statistique/tableaudebord/index',
model: modele
)
}
+ private Map getImpressionInfo(String action, String titreI18N) {
+ return [
+ action: action,
+ controller : 'statistiqueImpression',
+ titreDocument: message(code: titreI18N)
+ ]
+ }
+
@SuppressWarnings('CatchException')
def calculeTableauDeBord = {
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_STATS)
import org.lilie.services.eliot.constantes.ConstDate
import org.lilie.services.eliot.parametrages.calendrier.CalendrierService
-import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
import org.lilie.services.eliot.absences.Motif
-import org.lilie.services.eliot.temps.DateUtil
import org.lilie.services.eliot.export.DonneesPourExportCSV
import org.lilie.services.eliot.urllabel.breadcrumbs.BreadCrumbsItemInfo
import org.lilie.services.eliot.urllabel.UrlLabelInfo
import org.lilie.services.eliot.applications.absences.PriseEnCompteMotif
-import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.absences.AppelLigne
import org.lilie.services.eliot.SessionUtils
import org.springframework.web.servlet.support.RequestContextUtils as RCU
import org.lilie.services.eliot.absences.statistiques.commons.NiveauDetail
import org.lilie.services.eliot.absences.AbsencesFonctionnalite
import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
+import org.lilie.services.eliot.absences.export.ExportParserService
/**
* @author bahj
AbsencesStatsMensuellesService absencesStatsMensuellesService
AbsencesPreparationExportCSVService absencesPreparationExportCSVService
StatsMarshallerService statsMarshallerService
- StatistiqueParserService statistiqueParserService
LocalPersonneService localPersonneService
-
- private static final def LISTE_TOUS = [(Long) (-1)]
+ ExportParserService exportParserService
def index = {
- SecuriteSession securiteSession = SessionUtils.securiteSession(session)
+ SecuriteSession securiteSession = getSecuriteSession()
Map modele
AppelLigne.withTransaction {
Map mapParams = [:]
if (params.params) {
mapParams = (Map) JSON.parse(params.params)
- StatsMensuellesParams statsMensuellesParams = parseParams(mapParams)
+ StatsMensuellesParams statsMensuellesParams = exportParserService.parseParamsTempsReel(mapParams, etablissementCourant())
Map<String, Object> datasTempsReel =
construitDatasTempsReel(statsMensuellesParams)
- if(statsMensuellesParams.type in [Type.INCIDENTS, Type.PUNITIONS, Type.SANCTIONS]){
+ if (statsMensuellesParams.type in [Type.INCIDENTS, Type.PUNITIONS, Type.SANCTIONS]) {
mapParams.isResultatsParNiveau = false
}
modele.paramsTempsReel = mapParams as JSON
- switch(statsMensuellesParams.niveauDetail){
+ switch (statsMensuellesParams.niveauDetail) {
case NiveauDetail.ELEVE:
datasTempsReel.niveauDetail = 'resultatsParEleve'
break
modele += prepareModeleMotifs(pref, mapParams)
}
+ // modèle d'impression
+ modele.impressionInfo = getImpressionInfo(
+ 'imprimeTempsReel',
+ 'eliot.impression.resultats.statistiquesMensuelles'
+ )
+
render(
view: '/statistique/tempsreel/index',
model: modele
)
}
+ private Map getImpressionInfo(String action, String titreI18N) {
+ return [
+ action: action,
+ controller: 'statistiqueImpression',
+ titreDocument: message(code: titreI18N)
+ ]
+ }
+
private Map prepareModeleMotifs(
PreferencesEtablissementAbsences pref,
Map mapParams
verifieDroitFonctionnalite(AbsencesFonctionnalite.ABS_STATS)
Map mapParams = (Map) JSON.parse(params.params)
- StatsMensuellesParams statsMensuellesParams = parseParams(mapParams)
+ StatsMensuellesParams statsMensuellesParams = exportParserService.parseParamsTempsReel(mapParams, etablissementCourant())
Map datasTempsReel = construitDatasTempsReel(statsMensuellesParams)
sendCsvFile(response, donnees, 'statistiques mensuelles')
}
- /**
- * Parse les paramètres de la requête et retourne un StatsMensuellesParams
- * @return un StatsMensuellesParams
- */
- protected StatsMensuellesParams parseParams(Map mapParams) {
- List<StructureEnseignement> structures =
- statistiqueParserService.parseParamStructures(
- mapParams.structuresEnseignement,
- etablissementCourant()
- )
-
- List<Long> eleveIds = parseEleve(mapParams.eleves, structures)
-
- StatsMensuellesParams result = new StatsMensuellesParams(
- type: Type.parseByCode(mapParams.type),
- modeCalcul: ModeCalcul.parseByCode(mapParams.modeCalcul),
- motifIds: statistiqueParserService.parseParamMotifs(mapParams.motifs),
- structIds: structures*.id,
- typesDiscipline: parseParamTypesDiscipline(
- Type.parseByCode(mapParams.type),
- mapParams.typesDiscipline
- ),
- absencesValables: true,
- absencesNonValables: true,
- eleveIds: eleveIds,
- isResultatsParNiveau: mapParams.isResultatsParNiveau,
- etablissementId: etablissementCourantId()
- )
- if(result.type in [Type.PUNITIONS, Type.INCIDENTS, Type.SANCTIONS]){
- result.isResultatsParNiveau = false
- }
- result.dateDebut.setTime(DateUtil.parseDateJavascript(mapParams.dateDebut))
- result.dateFin.setTime(DateUtil.parseDateJavascript(mapParams.dateFin))
-
- if ((eleveIds.size() > 0) && (eleveIds[0] != -1)) {
- result.elevesActifsSeulement = false
- }
-
- return result
- }
-
-
- private List<Long> parseEleve(String eleves, List<StructureEnseignement> structures) {
- List<Personne> elevePersonnes
- List<Long> eleveIds
- if (eleves) {
- eleveIds = eleves.split(',').collect {Long.parseLong(it)}
- } else {
- eleveIds = [(Long) -1]
- }
- if (eleveIds.contains((Long) (-1))) {
- elevePersonnes = localStructureEnseignementService.
- findAllPersonnesElevesForAllStructures((Set<StructureEnseignement>) structures)
- } else {
- elevePersonnes = localPersonneService.findAllPersonne(eleveIds)
- }
- return elevePersonnes*.autorite*.id
- }
-
- /**
- * Parse les types de discipline
- * (type punitions, sanctions, incidents)
- */
- protected List parseParamTypesDiscipline(Type type, String typesDisciplineIds) {
- List resultats = []
- if (typesDisciplineIds) {
- List<Long> ids = typesDisciplineIds.split(',').collect {Long.parseLong(it)}
-
- if (ids == LISTE_TOUS) {
- resultats = (type.type).getAll()
- } else {
- resultats = ids.collect {(type.type).get(it)}
- }
- }
-
- return resultats
- }
-
/**
* Retourne la liste des motifs selon les groupes de motifs de choisis
*/
}
}
+
+
eliot.impression.sms.statut.TERMINE=Terminé
eliot.impression.sms.statut.ERREUR_TECHNIQUE=Erreur technique
+eliot.impression.resultats.multiCriteres=Registre d'appels
+eliot.impression.resultats.absDuJour=Absences du jour
+eliot.impression.resultats.retardDuJour=Retard du jour
+eliot.impression.resultats.departAnticipesDuJour=Départs anticipé du jour
+eliot.impression.resultats.demiPension=Absences à la demi-pension
+eliot.impression.resultats.internat=Absences à l'internat
+eliot.impression.resultats.appelsOublies=Appels oubliés
+eliot.impression.resultats.tableauDeBord=Tableau de bord
+eliot.impression.resultats.statistiquesMensuelles=Statistiques mensuelles
+
absences.libelle.ordre=Ordre
absences.libelle.bulletin=Bulletin
absences.libelle.stat=Consult./Stat.
--- /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.consultation
+
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.codehaus.groovy.grails.commons.GrailsApplication
+import org.codehaus.groovy.grails.commons.ApplicationHolder
+import org.springframework.context.MessageSource
+import org.springframework.beans.factory.BeanCreationException
+import org.lilie.services.eliot.applications.absences.BasicCriteresRecherche
+import org.lilie.services.eliot.applications.absences.AbsencesType
+import org.lilie.services.eliot.temps.DateUtil
+import org.lilie.services.eliot.absences.Motif
+import org.lilie.services.eliot.absences.GroupeMotif
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.applications.absences.RegimeService
+
+/**
+ * Service de parsing pour du requetage
+ * @author othe
+ */
+class AbsencesSelonCriteresService {
+
+ final static Long VALEUR_TOUS = -1
+
+ GrailsApplication grailsApplication
+
+ ConsultationService consultationService
+ RegimeService regimeService
+
+ /**
+ * @param compteEleves si true, compte le total des eleves
+ */
+ @SuppressWarnings('CatchException')
+ private ResultatConsultation getAbsencesSelonCriteres(SecuriteSession securiteSession,
+ Etablissement etablissement,
+ Map params,
+ String start,
+ String limit,
+ String sortField,
+ String sens,
+ Boolean compteEleves = false
+ ) {
+
+ BilanCriteresRecherche criteria = parseBilanCriteria(params)
+ criteria.etablissementId = etablissement.id
+ criteria.compteEleves = compteEleves
+
+ criteria.colonneClassement = sortField ?:
+ ConstantesNomColBilanAbsences.NOM_COL_NOM_PRENOM
+ criteria.classementAscendant = (sens != 'DESC')
+ criteria.start = start ? Integer.parseInt(start) : 0
+ criteria.limit = limit ? Integer.parseInt(limit) :
+ grailsApplication.config.eliot.absences.bilan.nombreLignesParPage
+ ResultatConsultation listeBilan = new ResultatConsultation()
+ try {
+ listeBilan = traduitProfilAppelant(consultationService.listeDesAbsencesEtRetards(
+ criteria,
+ securiteSession,
+ etablissement
+ ))
+ } catch (Exception e) {
+ log.error("Une erreur inconnue est survenue lors de la récupération des absences/retards.", e)
+ listeBilan.success = false
+ listeBilan.message = message("absences.bilan.erreur")
+ }
+
+ return listeBilan
+ }
+
+ /**
+ * Récupère les critères de sélection et de classement dans Params
+ * @param params : les paramètres de la requêtes
+ * @return un BilanCriteria rempli
+ * @author jbui
+ */
+ private BilanCriteresRecherche parseBilanCriteria(Map params) {
+ BilanCriteresRecherche criteria = new BilanCriteresRecherche()
+ parseBilanCriteriaType(params.type, criteria)
+ parseBilanCriteriaDates(params, criteria)
+ parseCriteriaMotifs(params.motif, params.groupeMotifs, criteria)
+ parseBilanCriteriaDivisions(params.division, criteria)
+ parseBilanCriteriaEleves(params.elevesId, criteria)
+ parseCriteriaRegimes(params.regimeIds, criteria)
+ return criteria
+ }
+
+ private String message(String code, Object[] args = [], Locale locale = null) {
+ def ctx = ApplicationHolder.getApplication().getMainContext()
+ MessageSource messageSource = (MessageSource) ctx.getBean("messageSource");
+ if (messageSource == null) {
+ throw new BeanCreationException("Pas de bean de gestion i18n");
+ }
+ return messageSource.getMessage(code, args, locale);
+ }
+
+ /**
+ * traduit les codes I18n correspondant à profilAppelant
+ */
+ private ResultatConsultation traduitProfilAppelant(ResultatConsultation resultatConsultation) {
+ resultatConsultation.lignes.each {LigneConsultation ligne ->
+ String profils = ligne.profilAppelant?.split(ConsultationService.SEPARATEUR_PROFILS)?.
+ toList()?.collect {message(it)}?.join(ConsultationService.SEPARATEUR_PROFILS)
+ ligne.setProfilAppelant(profils)
+ }
+ return resultatConsultation
+ }
+
+ /**
+ * Récupère les paramètres de type
+ * @param params : les paramètres de la requêtes
+ * @return un BilanCriteria complété avec les types
+ * @author jbui
+ * @author bahj
+ */
+ public void parseBilanCriteriaType(def listeTypes, BasicCriteresRecherche criteria) {
+ List<Integer> typesEnInt
+ if (listeTypes) {
+ typesEnInt = (listeTypes as String).split(',').collect {
+ Integer.parseInt((String) it)
+ }
+ } else {
+ typesEnInt = []
+ }
+ if (typesEnInt.contains(BasicCriteresRecherche.VALEUR_TOUS as Integer)) {
+ criteria.setTousTypes(true)
+ criteria.demiPension = false
+ criteria.internat = false
+ }
+ else {
+ criteria.setTousTypes(false)
+ for (int type : typesEnInt) {
+ switch (type) {
+ case AbsencesType.ABSENCE_VALABLE.id:
+ criteria.absencesValables = true
+ break
+
+ case AbsencesType.ABSENCE_NON_VALABLE.id:
+ criteria.absencesNonValables = true
+ break
+
+ case AbsencesType.ABSENCE_PREVISIONNELLE.id:
+ criteria.absencesPrevisionnelles = true
+ break
+
+ case AbsencesType.RETARD.id:
+ criteria.retards = true
+ break
+
+ case AbsencesType.DEPART_ANTICIPE.id:
+ criteria.departsAnticipes = true
+ break
+
+ case AbsencesType.DEMI_PENSION.id:
+ criteria.demiPension = true
+ break
+
+ case AbsencesType.INTERNAT.id:
+ criteria.internat = true
+ break
+
+ }
+ }
+ }
+ }
+
+ public void parseBilanCriteriaDates(Map params,
+ BasicCriteresRecherche criteria) {
+ String dateDebut = params.dateDebut
+ String dateFin = params.dateFin
+
+ criteria.dateDebut.setTime(DateUtil.parseDateJavascript(dateDebut))
+ criteria.dateFin.setTime(DateUtil.parseDateJavascript(dateFin))
+ }
+
+/**
+ * Récupère les paramètres de motifs
+ * @param params : les paramètres de la requêtes
+ * @param criteria : le criteria à compléter
+ * @return un BilanCriteria complété avec les motifs
+ * @author jbui
+ */
+ public void parseCriteriaMotifs(def listeMotifs,
+ listeGroupeMotifs,
+ BasicCriteresRecherche criteria) {
+ if (listeMotifs) {
+ criteria.motifIds = (listeMotifs as String).split(',').collect {
+ Long.parseLong(it)
+ }
+ } else {
+ criteria.motifIds = []
+ }
+ if ((criteria.motifIds.size() > 0) &&
+ (criteria.motifIds[0] == BasicCriteresRecherche.VALEUR_TOUS)) {
+ parseCriteriaGroupeMotifs(listeGroupeMotifs, criteria)
+ }
+ }
+
+ /**
+ * 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 void parseCriteriaGroupeMotifs(def listeGroupeMotifs,
+ BasicCriteresRecherche bilanCriteria) {
+ List<Long> groupeMotifs
+ if (listeGroupeMotifs) {
+ groupeMotifs = (listeGroupeMotifs as String).split(',').collect {
+ Long.parseLong(it)
+ }
+ } else {
+ groupeMotifs = []
+ }
+ bilanCriteria.motifIds.clear()
+ if ((groupeMotifs.size() > 0) && (groupeMotifs[0] == BasicCriteresRecherche.VALEUR_TOUS)) {
+ bilanCriteria.motifIds << BasicCriteresRecherche.VALEUR_TOUS
+ } else {
+ groupeMotifs.each {
+ bilanCriteria.motifIds.addAll(
+ Motif.findAllByGroupeMotif(
+ GroupeMotif.get(it)
+ )*.id)
+ }
+ }
+ }
+
+/**
+ * Récupère les paramètres de divisions
+ * @param params : les paramètres de la requêtes
+ * @return un BilanCriteria complété avec les divisions
+ * @author jbui
+ */
+ public void parseBilanCriteriaDivisions(def listeDivisions, BasicCriteresRecherche criteria) {
+ if (listeDivisions) {
+ criteria.structIds = (listeDivisions as String).split(',').collect {
+ Long.parseLong(it)
+ }
+ } else {
+ criteria.structIds = []
+ }
+ }
+
+ /**
+ * Récupère les paramètres des élèves
+ * @param params : les paramètres de la requêtes
+ * @return un BilanCriteria complété avec les divisions
+ * @author bahj
+ */
+ protected void parseBilanCriteriaEleves(def listeEleves, BasicCriteresRecherche criteria) {
+ if (listeEleves) {
+ List<Long> autoriteElevesId = []
+ List personneElevesId = (listeEleves as String).split(',').collect {
+ Long.parseLong((String) it)
+ }
+
+ // Elèves
+ if (!personneElevesId.contains(VALEUR_TOUS)) {
+ List<Personne> personneEleves = Personne.getAll(personneElevesId)
+ autoriteElevesId = personneEleves*.autorite.id
+ }
+
+ criteria.eleveIds = autoriteElevesId
+ }
+ else {
+ criteria.eleveIds = []
+ }
+ }
+
+ /**
+ * Récupère les paramètres des regimes
+ * @param params : les paramètres de la requêtes
+ * @return un BilanCriteria complété avec les regimes
+ * @author msan
+ */
+ private void parseCriteriaRegimes(def listeRegimes, BasicCriteresRecherche criteria) {
+ if (listeRegimes) {
+ List<Long> regimeIds = (listeRegimes as String).split(',').collect {
+ Long.parseLong((String) it)
+ }
+ if (regimeIds.contains(VALEUR_TOUS)) {
+ regimeIds = regimeService.findAll().collect { it.id }
+ }
+ criteria.regimeIds = regimeIds
+ } else {
+ criteria.regimeIds = []
+ }
+ }
+
+
+}
import org.lilie.services.eliot.scolarite.Personne
import org.lilie.services.eliot.temps.DateUtil
import org.hibernate.SQLQuery
-import org.hibernate.SessionFactory
-import org.hibernate.Session
import org.lilie.services.eliot.scolarite.Service
import org.lilie.services.eliot.scolarite.Matiere
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.requetage.RequetageUtilsService
/**
* @author jbui
*/
-class AppelsOubliesService {
+class AppelsOubliesService extends RequetageUtilsService {
+
+ private final static Long VALEUR_TOUS_STRUCTURES = (Long) -1
EnseignementService enseignementService
LocalStructureEnseignementService localStructureEnseignementService
+ /**
+ * Filtre ou complète la liste des structures
+ */
+ public void consolideListeStructures(AppelsOubliesCommand command, Etablissement etablissement) {
+ List<StructureEnseignement> structuresAutorisees =
+ findStructuresAutorisees(command,etablissement)
+ if (command.parsedStructureIds?.contains(VALEUR_TOUS_STRUCTURES)) {
+ command.parsedStructureIds = structuresAutorisees*.id
+ } else {
+ List<Long> structureIds = []
+ command.parsedStructureIds.each {
+ structureId ->
+ if (structuresAutorisees.find {
+ structAutorisee ->
+ structAutorisee.id == structureId
+ }) {
+ structureIds << structureId
+ }
+ }
+ }
+ }
+
+
/**
* Recherche les appels oubliés
* @param command : les critères de recherche
* @return une Map
*/
- AppelsOubliesInfo listeAppelsOublies(AppelsOubliesCommand command) {
+ public AppelsOubliesInfo listeAppelsOublies(AppelsOubliesCommand command) {
//Recherche de la liste des enseignements associés aux structures et aux enseignants
List<Enseignement> enseignements = findEnseignements(command)
AppelsOubliesInfo result = new AppelsOubliesInfo()
* Retourne le nombre d'appels manquants
* @return un Long
*/
- Long findCount(List<Enseignement> enseignements, AppelsOubliesCommand command) {
+ private Long findCount(List<Enseignement> enseignements, AppelsOubliesCommand command) {
Calendar cal = Calendar.getInstance()
cal.setTime(command.parsedDate)
return result[0]
}
- SessionFactory sessionFactory
-
- public SQLQuery prepareRequete(String sql) {
- Session session = sessionFactory.getCurrentSession()
- SQLQuery sqlQuery = session.createSQLQuery(sql)
- return sqlQuery
- }
-
/**
* Recherche les événements
*/
- List findDatas(List<Enseignement> enseignements, AppelsOubliesCommand command) {
+ private List findDatas(List<Enseignement> enseignements, AppelsOubliesCommand command) {
Calendar cal = Calendar.getInstance()
cal.setTime(command.parsedDate)
return sqlQuery.list()
}
- private Date ajouteHeureADate(Date parsedDate, String parsedHeure){
- Calendar cal = Calendar.getInstance()
- cal.setTime(parsedDate)
-
- Date dateHeure
- if (parsedHeure && parsedHeure != ""){
- dateHeure =
- DateUtil.ajouteHeureEtMinuteToDate(parsedDate, parsedHeure)
- } else {
- cal.add(Calendar.DATE, 1)
- dateHeure = cal.getTime()
- }
- return dateHeure
- }
-
/**
* Recherche la liste des enseignements correspondant aux critères
* @return une List<Enseignement>
*/
- List<Enseignement> findEnseignements(AppelsOubliesCommand command) {
+ private List<Enseignement> findEnseignements(AppelsOubliesCommand command) {
if (command.enseignantId) {
return enseignementService.findAllEnseignementForEnseignantAndStructures(
Autorite.get(command.enseignantId),
return result
}
+
+ /**
+ * Retourne la liste des structures autorisées en fonction de la requête
+ */
+ private List<StructureEnseignement> findStructuresAutorisees(AppelsOubliesCommand command, Etablissement etablissement) {
+ List<StructureEnseignement> structuresAutorisees = []
+ if (command.enseignantId) {
+ Autorite enseignant = Autorite.get(command.enseignantId)
+ structuresAutorisees.addAll(
+ localStructureEnseignementService.
+ findAllStructureEnseignementByEnseignantAndEtablissement(
+ enseignant,
+ etablissement
+ )
+ )
+ }
+ else {
+ structuresAutorisees.addAll(
+ localStructureEnseignementService.
+ findAllClasseByEtablissement(etablissement)
+ )
+ }
+ return structuresAutorisees
+ }
+
+
}
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBord
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordLigne
import org.lilie.services.eliot.absences.Punition
-
import org.lilie.services.eliot.absences.saisie.discipline.incident.IncidentConsultationInfo
import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordTotaux
import java.text.DecimalFormat
import org.lilie.services.eliot.absences.consultation.LigneConsultation
import org.lilie.services.eliot.absences.securite.DroitsService
import org.lilie.services.eliot.absences.AbsencesFormater
+import org.lilie.services.eliot.export.TypeDonneesExport
/**
* Preparation des donnees pour l'export CSV
/**
* L'export de resultat de la recherche avec une liste multicritere
*/
- DonneesPourExportCSV prepareExportAbsencesMulticritere(ResultatConsultation listeBilan, List colonneAInclure, Map mapColonnes) {
+ public DonneesPourExportCSV prepareExportAbsencesMulticritere(ResultatConsultation listeBilan,
+ List<Integer> colonneAInclure,
+ Map mapColonnes) {
+
DonneesPourExportCSV donnees = new DonneesPourExportCSV()
List<String> colonnes = colonneAInclure.collectAll {int index ->
return donnees
}
+
+ /**
+ * Retrouve l'organisation des colonnes du tableau en fonction du type de donnée
+ * @param params
+ * @return
+ */
+ public Map findOrganisationTableau(String typeDonnees){
+
+ Map resultat=[:]
+
+ switch (typeDonnees) {
+
+ case TypeDonneesExport.MULTICRITERE:
+ resultat = AbsencesPreparationExportCSVService.MULTICRITERS_COLONNES
+ break
+
+ case TypeDonneesExport.ABS_JOURS:
+ resultat = AbsencesPreparationExportCSVService.ABS_JOUR_COLONNES
+ break
+
+ case TypeDonneesExport.RETARDS_JOURS:
+ resultat = AbsencesPreparationExportCSVService.RETARD_DEPART_JOUR_COLONNES
+ break
+
+ case TypeDonneesExport.DEPARTS_JOURS:
+ resultat = AbsencesPreparationExportCSVService.RETARD_DEPART_JOUR_COLONNES
+ break
+
+ case TypeDonneesExport.DEMI_PENSION:
+ resultat = AbsencesPreparationExportCSVService.DEMI_PENSION_INETRNAT
+ break
+
+ case TypeDonneesExport.INTERNAT:
+ resultat = AbsencesPreparationExportCSVService.DEMI_PENSION_INETRNAT
+ break
+
+ }
+
+ return resultat
+
+ }
+
}
--- /dev/null
+/*
+* Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+* This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+*
+* Lilie is free software. You can redistribute it and/or modify since
+* you respect the terms of either (at least one of the both license) :
+* - under the terms of the GNU Affero General Public License as
+* published by the Free Software Foundation, either version 3 of the
+* License, or (at your option) any later version.
+* - the CeCILL-C as published by CeCILL-C; either version 1 of the
+* License, or any later version
+*
+* There are special exceptions to the terms and conditions of the
+* licenses as they are applied to this software. View the full text of
+* the exception in file LICENSE.txt in the directory of this software
+* distribution.
+*
+* Lilie is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* Licenses for more details.
+*
+* You should have received a copy of the GNU General Public License
+* and the CeCILL-C along with Lilie. If not, see :
+* <http://www.gnu.org/licenses/> and
+* <http://www.cecill.info/licences.fr.html>.
+*
+*/
+
+package org.lilie.services.eliot.absences.export
+
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.scolarite.Personne
+import org.lilie.services.eliot.absences.statistiques.Type
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesParams
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.absences.statistiques.mensuelle.ModeCalcul
+import org.lilie.services.eliot.temps.DateUtil
+import org.lilie.services.eliot.absences.statistiques.StatistiqueParserService
+
+class ExportParserService {
+
+ private static final def LISTE_TOUS = [(Long) (-1)]
+
+ LocalStructureEnseignementService localStructureEnseignementService
+ LocalPersonneService localPersonneService
+ StatistiqueParserService statistiqueParserService
+
+ public List<Long> parseEleve(String eleves, List<StructureEnseignement> structures) {
+ List<Personne> elevePersonnes
+ List<Long> eleveIds
+ if (eleves) {
+ eleveIds = eleves.split(',').collect {Long.parseLong(it)}
+ } else {
+ eleveIds = [(Long) -1]
+ }
+ if (eleveIds.contains((Long) (-1))) {
+ elevePersonnes = localStructureEnseignementService.
+ findAllPersonnesElevesForAllStructures((Set<StructureEnseignement>) structures)
+ } else {
+ elevePersonnes = localPersonneService.findAllPersonne(eleveIds)
+ }
+ return elevePersonnes*.autorite*.id
+ }
+
+ /**
+ * Parse les types de discipline
+ * (type punitions, sanctions, incidents)
+ */
+ public List parseParamTypesDiscipline(Type type, String typesDisciplineIds) {
+ List resultats = []
+ if (typesDisciplineIds) {
+ List<Long> ids = typesDisciplineIds.split(',').collect {Long.parseLong(it)}
+
+ if (ids == LISTE_TOUS) {
+ resultats = (type.type).getAll()
+ } else {
+ resultats = ids.collect {(type.type).get(it)}
+ }
+ }
+
+ return resultats
+ }
+
+ /**
+ * Parse les paramètres de la requête et retourne un StatsMensuellesParams
+ * @return un StatsMensuellesParams
+ */
+ public StatsMensuellesParams parseParamsTempsReel(Map mapParams, Etablissement etablissement
+ ) {
+ List<StructureEnseignement> structures =
+ statistiqueParserService.parseParamStructures(
+ mapParams.structuresEnseignement,
+ etablissement
+ )
+
+ List<Long> eleveIds = parseEleve(mapParams.eleves, structures)
+
+ StatsMensuellesParams result = new StatsMensuellesParams(
+ type: Type.parseByCode(mapParams.type),
+ modeCalcul: ModeCalcul.parseByCode(mapParams.modeCalcul),
+ motifIds: statistiqueParserService.parseParamMotifs(mapParams.motifs),
+ structIds: structures*.id,
+ typesDiscipline: parseParamTypesDiscipline(
+ Type.parseByCode(mapParams.type),
+ mapParams.typesDiscipline
+ ),
+ absencesValables: true,
+ absencesNonValables: true,
+ eleveIds: eleveIds,
+ isResultatsParNiveau: mapParams.isResultatsParNiveau,
+ etablissementId: etablissement.id
+ )
+ if (result.type in [Type.PUNITIONS, Type.INCIDENTS, Type.SANCTIONS]) {
+ result.isResultatsParNiveau = false
+ }
+ result.dateDebut.setTime(DateUtil.parseDateJavascript(mapParams.dateDebut))
+ result.dateFin.setTime(DateUtil.parseDateJavascript(mapParams.dateFin))
+
+ if ((eleveIds.size() > 0) && (eleveIds[0] != -1)) {
+ result.elevesActifsSeulement = false
+ }
+
+ return result
+ }
+
+}
--- /dev/null
+package org.lilie.services.eliot.absences.impression
+
+import org.lilie.services.eliot.impression.csv.ImpressionCsvService
+import org.lilie.services.eliot.scolarite.Etablissement
+import org.lilie.services.eliot.export.DonneesPourExportCSV
+import org.lilie.services.eliot.impression.csv.ImpressionPresentationCsv
+import org.lilie.services.eliot.impression.csv.ImpressionLargeursColonnesConstantes
+import org.lilie.services.eliot.absences.export.AbsencesPreparationExportCSVService
+import org.lilie.services.eliot.absences.consultation.ResultatConsultation
+import org.codehaus.groovy.grails.commons.ApplicationHolder
+import org.springframework.context.MessageSource
+import org.springframework.beans.factory.BeanCreationException
+import org.lilie.services.eliot.export.TypeDonneesExport
+import org.lilie.services.eliot.absences.consultation.appelsoublies.AppelsOubliesInfo
+import org.lilie.services.eliot.absences.consultation.appelsoublies.AppelsOubliesCommand
+import org.lilie.services.eliot.absences.consultation.appelsoublies.AppelsOubliesService
+import org.lilie.services.eliot.absences.export.AppelsOubliesPreparationExportCSVService
+import java.text.SimpleDateFormat
+import org.lilie.services.eliot.constantes.ConstDate
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordParams
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBord
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TableauDeBordService
+import org.lilie.services.eliot.temps.DateUtil
+import org.lilie.services.eliot.absences.statistiques.tableaudebord.TypeSeuilEnum
+import org.lilie.services.eliot.scolarite.StructureEnseignement
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuellesParams
+import org.lilie.services.eliot.absences.statistiques.mensuelle.StatsMensuelles
+
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.absences.statistiques.mensuelle.AbsencesStatsMensuellesService
+import org.lilie.services.eliot.absences.statistiques.StatsMarshallerService
+
+import org.lilie.services.eliot.absences.statistiques.StatistiqueParserService
+
+import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
+import org.lilie.services.eliot.scolarite.personne.LocalPersonneService
+import org.lilie.services.eliot.absences.PreferencesEtablissementAbsences
+import org.lilie.services.eliot.absences.export.ExportParserService
+
+/**
+ * Impression des résultats
+ * @author othe
+ */
+class ImpressionCsvAbsencesService {
+
+ ImpressionCsvService impressionCsvService
+ AbsencesPreparationExportCSVService absencesPreparationExportCSVService
+ AppelsOubliesService appelsOubliesService
+ AppelsOubliesPreparationExportCSVService appelsOubliesPreparationExportCSVService
+ TableauDeBordService tableauDeBordService
+ AbsencesStatsMensuellesService absencesStatsMensuellesService
+ StatsMarshallerService statsMarshallerService
+ LocalStructureEnseignementService localStructureEnseignementService
+ LocalPersonneService localPersonneService
+ StatistiqueParserService statistiqueParserService
+ ExportParserService exportParserService
+
+ private static final Integer ID_TOUS = -1
+
+ public ByteArrayOutputStream imprimeTempsReel(SecuriteSession securiteSession,
+ Map params,
+ Etablissement etablissement,
+ PreferencesEtablissementAbsences pref) {
+
+ StatsMensuellesParams statsMensuellesParams = exportParserService.parseParamsTempsReel(params, etablissement)
+
+ Map datasTempsReel = construitDatasTempsReel(securiteSession,
+ pref,
+ statsMensuellesParams)
+
+ DonneesPourExportCSV donnees = absencesPreparationExportCSVService.
+ prepareExportTempsReel(datasTempsReel)
+
+// donnees.colonnes =
+// donnees.colonnes.collect {message(it)}
+
+ List listeLargeursColonnes = ImpressionLargeursColonnesConstantes.findAllLargeurColonnes(TypeDonneesExport.STAT_MENSUELLE)
+
+ ImpressionPresentationCsv impressionPresentationCsv = new ImpressionPresentationCsv(
+ titre: params.titre,
+ etablissement: etablissement.nomAffichage,
+ largeurs: listeLargeursColonnes,
+ colonnes: donnees.colonnes
+ )
+
+ for (int i = 0; i < donnees.colonnes.size(); i++) {
+ impressionPresentationCsv.colonnesvisibles << i
+ }
+
+ impressionPresentationCsv.parseDates(params)
+
+ return impressionCsvService.printPdf(impressionPresentationCsv, donnees)
+
+ }
+
+ public ByteArrayOutputStream imprimeTableauDeBord(Map params,
+ PreferencesEtablissementAbsences pref,
+ Etablissement etablissement) {
+
+ TableauDeBordParams criteres = parseParams(params, etablissement)
+
+ // Supprime la pagination
+ criteres.start = 0
+ criteres.limit = -1
+
+ TableauDeBord tableauDeBord = tableauDeBordService.calculeTableauDeBord(criteres,
+ pref)
+
+ String totauxStr = message('eliot.absences.export.statistiques.totaux')
+
+ DonneesPourExportCSV donnees = absencesPreparationExportCSVService.
+ prepareExportTableauDeBord(
+ tableauDeBord, criteres.afficherLesAbsencesEnHeures, totauxStr, params.colonnes)
+
+ donnees.colonnes =
+ donnees.colonnes.collect {message(it)}
+
+ List listeLargeursColonnes = ImpressionLargeursColonnesConstantes.findAllLargeurColonnes(TypeDonneesExport.TABLEAU_DE_BORD)
+
+ ImpressionPresentationCsv impressionPresentationCsv = new ImpressionPresentationCsv(
+ titre: params.titre,
+ etablissement: etablissement.nomAffichage,
+ largeurs: listeLargeursColonnes,
+ colonnes: donnees.colonnes,
+ colonnesvisibles: params.colonnes
+ )
+
+ impressionPresentationCsv.parseDates(params)
+
+ return impressionCsvService.printPdf(impressionPresentationCsv, donnees)
+ }
+
+ public ByteArrayOutputStream imprimeDonneesAbsences(Map params,
+ ResultatConsultation listeBilan,
+ String titre,
+ Etablissement etablissement) {
+
+ Map organisationTableau = absencesPreparationExportCSVService.findOrganisationTableau(params.type)
+
+ DonneesPourExportCSV donnees = absencesPreparationExportCSVService.
+ prepareExportAbsencesMulticritere(listeBilan,
+ params.colonnes,
+ organisationTableau)
+
+ donnees.colonnes =
+ donnees.colonnes.collect {message(it)}
+
+ List listeLargeursColonnes = ImpressionLargeursColonnesConstantes.findAllLargeurColonnes(params.type)
+
+ ImpressionPresentationCsv impressionPresentationCsv = new ImpressionPresentationCsv(
+ titre: titre,
+ etablissement: etablissement.nomAffichage,
+ largeurs: listeLargeursColonnes,
+ colonnes: donnees.colonnes,
+ colonnesvisibles: params.colonnes
+ )
+
+ impressionPresentationCsv.parseDates(params)
+
+ return impressionCsvService.printPdf(impressionPresentationCsv, donnees)
+ }
+
+
+ public ByteArrayOutputStream imprimeAppelsOublies(Map params,
+ Etablissement etablissement) {
+
+ AppelsOubliesCommand command = new AppelsOubliesCommand(params)
+
+ command.validate()
+
+ appelsOubliesService.consolideListeStructures(command, etablissement)
+
+ AppelsOubliesInfo info = appelsOubliesService.listeAppelsOublies(command)
+
+ DonneesPourExportCSV donnees =
+ appelsOubliesPreparationExportCSVService.prepareExportAppelsOublies(
+ info, closureFormatHeure)
+
+ donnees.colonnes =
+ donnees.colonnes.collect {message(it)}
+
+ List listeLargeursColonnes = ImpressionLargeursColonnesConstantes.findAllLargeurColonnes(TypeDonneesExport.APPELS_OUBLIES)
+
+ ImpressionPresentationCsv impressionPresentationCsv = new ImpressionPresentationCsv(
+ titre: command.titre,
+ etablissement: etablissement.nomAffichage,
+ largeurs: listeLargeursColonnes,
+ colonnes: donnees.colonnes,
+ colonnesvisibles: [1, 2, 3, 4, 5]
+ )
+
+ impressionPresentationCsv.parseDate(params)
+
+ return impressionCsvService.printPdf(impressionPresentationCsv, donnees)
+ }
+
+ private Closure closureFormatHeure = {
+ Date heureDebut, Date heureFin ->
+ SimpleDateFormat sdf = new SimpleDateFormat(ConstDate.HEURE_HHMM, Locale.FRANCE)
+ return message('absences.appels.oublies.heure', [
+ sdf.format(heureDebut),
+ sdf.format(heureFin)
+ ])
+ }
+
+ /**
+ * Parse les paramètres de la requête pour constituer un TableauDeBordParams
+ * @param params : les paramètres de la requête
+ * @return un TableauDeBordParams
+ */
+ private TableauDeBordParams parseParams(Map paramDatas, Etablissement etablissement) {
+ Calendar cal = Calendar.getInstance()
+ cal.setTime(DateUtil.parseDateJavascript(paramDatas.dateFin))
+ DateUtil.setFinJour(cal)
+
+ TableauDeBordParams result = new TableauDeBordParams(
+ dateDebut: DateUtil.parseDateJavascript(paramDatas.dateDebut),
+ dateFin: cal.getTime(),
+ sortField: paramDatas.sortInfo.field,
+ sortAsc: (paramDatas.sortInfo.direction == 'ASC'),
+ start: paramDatas.start,
+ limit: paramDatas.limit,
+ totalInfo: paramDatas.totalInfo,
+ valeurSeuil: paramDatas.valeurSeuil,
+ typeSeuil: TypeSeuilEnum.parseByCode(paramDatas.typeSeuil),
+ afficherLesAbsencesEnHeures: paramDatas?.afficherLesAbsencesEnHeures
+ )
+ result.classes = []
+ if (paramDatas.classesId == ID_TOUS) {
+ result.classes = localStructureEnseignementService.
+ findAllClasseByEtablissement(etablissement)
+ } else {
+ paramDatas.classesId.split(',').each {
+ if (it != ID_TOUS) {
+ result.classes << StructureEnseignement.get(it)
+ }
+ }
+ }
+ return result
+ }
+
+ private Map construitDatasTempsReel(SecuriteSession securiteSession,
+ PreferencesEtablissementAbsences perf,
+ StatsMensuellesParams statsMensuellesParams) {
+
+ StatsMensuelles statsMensuelles = absencesStatsMensuellesService.
+ calculeStatsMensuelles(
+ securiteSession,
+ statsMensuellesParams,
+ perf
+ )
+
+ Map dataIndexInfo = statsMarshallerService.
+ marshallDataIndexInfo(
+ statsMensuelles,
+ statsMensuellesParams
+ )
+
+ Map datasTempsReel = [
+ dataIndex: dataIndexInfo,
+ datasTempsreel: statsMarshallerService.
+ marshallStatsInfo(statsMensuelles),
+ totaux: statsMarshallerService.marshallTotaux(
+ statsMensuelles,
+ statsMensuellesParams
+ )
+ ]
+ return datasTempsReel
+ }
+
+ private String message(String code, Object[] args = [], Locale locale = null) {
+ def ctx = ApplicationHolder.getApplication().getMainContext()
+ MessageSource messageSource = (MessageSource) ctx.getBean("messageSource")
+ if (messageSource == null) {
+ throw new BeanCreationException("Pas de bean de gestion i18n")
+ }
+ return messageSource.getMessage(code, args, locale)
+ }
+
+}
-package org.lilie.services.eliot.absences.statistique
+/*
+ * 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.statistiques
-import org.lilie.services.eliot.absences.Motif
import org.lilie.services.eliot.scolarite.StructureEnseignement
import org.lilie.services.eliot.scolarite.structureenseignement.LocalStructureEnseignementService
import org.lilie.services.eliot.scolarite.Etablissement
* Crée les données permettant d'initialiser le store de la grille
* @return une Map
*/
- Map marshallDataIndexInfo(StatsMensuelles statsMensuelles,
- StatsMensuellesParams statsMensuellesParams,
- Locale locale
+ public Map marshallDataIndexInfo(StatsMensuelles statsMensuelles,
+ StatsMensuellesParams statsMensuellesParams,
+ Locale locale = null
) {
Map result = (Map) [:]
MessageSource messageSource = applicationContext.getBean("messageSource")
<g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/impressionresultats/impressionResultats" plugin="eliot-app-plugin"/>
+
<!-- Template pour les définitions des constantes de modèle-->
<g:render template="/consultation/modele"/>
<g:render template="/consultation/absences/modele"/>
src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
+
<g:render template="/consultation/commun"/>
<g:render template="/consultation/appelsoublies/modele"/>
<g:javascript library="src/views/consultation/appelsoublies/CritereView"/>
- <g:javascript library="src/views/consultation/appelsoublies/CritereController"/>
- <g:javascript library="src/views/consultation/appelsoublies/AppelsOubliesController"/>
- <g:javascript library="src/views/consultation/appelsoublies/AppelsOubliesView"/>
+ <g:javascript
+ library="src/views/consultation/appelsoublies/CritereController"/>
+ <g:javascript
+ library="src/views/consultation/appelsoublies/AppelsOubliesController"/>
+ <g:javascript
+ library="src/views/consultation/appelsoublies/AppelsOubliesView"/>
<g:javascript library="src/views/consultation/appelsoublies/Application"/>
</head>
+
<body>
%{-- message --}%
<div id="messages" class="portal-messages"/>
<g:render template="/loadingMask"></g:render>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
%{--Constantes javaScript--}%
<g:render template="/consultation/demipensioninternat/modele"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
%{--Les sources de la page --}%
<g:render template="/consultation/commun"/>
- <g:javascript library="src/views/consultation/demipensioninternat/Application"/>
+ <g:javascript
+ library="src/views/consultation/demipensioninternat/Application"/>
</head>
+
<body>
%{-- message --}%
<div id="messages" class="portal-messages"/>
<g:render template="/loadingMask"></g:render>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
%{--Constantes javaScript--}%
<g:javascript library="src/views/consultation/Constantes"/>
<g:javascript library="src/views/consultation/Modele"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
<!-- Template pour les définitions des constantes de modèle-->
<g:render template="/consultation/modele"/>
<g:javascript library="src/views/consultation/departs/Application"/>
</head>
+
<body>
%{-- message --}%
<div id="messages" class="portal-messages"/>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
%{--Constantes javaScript--}%
<g:javascript library="src/views/consultation/Constantes"/>
<g:javascript library="src/views/consultation/Modele"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
<!-- Template pour les définitions des constantes de modèle-->
<g:render template="/consultation/multicriteres/modele"/>
<g:javascript library="src/views/consultation/multicriteres/Application"/>
</head>
+
<body>
%{-- message --}%
<div id="messages" class="portal-messages"/>
<g:render template="/loadingMask"></g:render>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
<g:javascript library="src/views/consultation/Constantes"/>
<g:javascript library="src/views/consultation/Modele"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
<!-- Template pour les définitions des constantes de modèle-->
<g:render template="/consultation/modele"/>
<g:javascript library="src/views/consultation/retards/Application"/>
</head>
+
<body>
%{-- message --}%
<div id="messages" class="portal-messages"/>
<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'
- )}"/>
+ type="text/css"
+ href="${resource(
+ dir: 'js/lib/extensionsextjs/lovcombo',
+ file: 'Ext.ux.form.LovCombo.css'
+ )}"/>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
%{--Constantes javaScript--}%
<g:javascript library="src/views/commons/BoutonChercherController"/>
<g:javascript library="src/views/commons/CheckBoxView"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
<!-- Template pour les définitions des constantes de modèle-->
<g:render template="/statistique/tableaudebord/modele"/>
<g:javascript library="lib/extensionsextjs/lovcombo/Ext.ux.form.LovCombo"/>
<g:javascript library="src/views/statistique/tableaudebord/GridTotauxView"/>
<g:javascript library="src/views/statistique/tableaudebord/TotauxController"/>
- <g:javascript library="src/views/statistique/tableaudebord/TableauDeBordController"/>
- <g:javascript library="src/views/statistique/tableaudebord/SelectionSeuilView"/>
- <g:javascript library="src/views/statistique/tableaudebord/SelectionSeuilController"/>
+ <g:javascript
+ library="src/views/statistique/tableaudebord/TableauDeBordController"/>
+ <g:javascript
+ library="src/views/statistique/tableaudebord/SelectionSeuilView"/>
+ <g:javascript
+ library="src/views/statistique/tableaudebord/SelectionSeuilController"/>
<g:javascript library="src/views/statistique/tableaudebord/ToolbarView"/>
- <g:javascript library="src/views/statistique/tableaudebord/ToolbarController"/>
+ <g:javascript
+ library="src/views/statistique/tableaudebord/ToolbarController"/>
<g:javascript library="src/views/statistique/tableaudebord/Application"/>
</head>
+
<body>
%{-- Message --}%
<div id="messages" class="portal-messages"/>
%{--Extensions extjs--}%
<g:javascript library="lib/extensionsextjs/lovcombo/Ext.ux.form.LovCombo"/>
<link rel="stylesheet"
- type="text/css"
- href="${resource(
- dir: 'js/lib/extensionsextjs/lovcombo',
- file: 'Ext.ux.form.LovCombo.css'
- )}"/>
+ type="text/css"
+ href="${resource(
+ dir: 'js/lib/extensionsextjs/lovcombo',
+ file: 'Ext.ux.form.LovCombo.css'
+ )}"/>
<g:javascript library="lib/extensionsextjs/lockinggridview/LockingGridView"/>
<link rel="stylesheet"
- type="text/css"
- href="${resource(
- dir: 'js/lib/extensionsextjs/lockinggridview',
- file: 'LockingGridView.css'
- )}"/>
+ type="text/css"
+ href="${resource(
+ dir: 'js/lib/extensionsextjs/lockinggridview',
+ file: 'LockingGridView.css'
+ )}"/>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportView.js')}">
</script>
<script type="text/javascript"
- src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
+ src="${url(uri: 'js/commons/src/exportdonnees/BoutonExportController.js')}">
</script>
<g:javascript library="src/views/commons/LovComboView"/>
<g:javascript library="src/views/commons/ComboBoxView"/>
- <g:render template="/commons/ficheeleve/ficheEleve" plugin="eliot-app-plugin"/>
- %{--<g:javascript library="commons/ficheeleve/Modele" plugin="eliot-app-plugin"/>--}%
- %{--<g:render template="/commons/ficheeleve/modeleFicheEleve" plugin="eliot-app-plugin"/>--}%
- %{--<g:render template="/commons/ficheeleve/importsJs" plugin="eliot-app-plugin"/>--}%
+ <g:render template="/commons/ficheeleve/ficheEleve"
+ plugin="eliot-app-plugin"/>
+
+ <g:render template="/commons/impressionresultats/impressionResultats"
+ plugin="eliot-app-plugin"/>
<!-- Template pour les définitions des constantes de modèle-->
<g:render template="/statistique/tempsreel/modele"/>
<g:javascript library="src/views/commons/Message"/>
<g:javascript library="src/views/commons/Utils"/>
<g:javascript library="src/views/commons/Constantes"/>
- <g:javascript library="src/views/statistique/tempsreel/CriteresTempsReelView"/>
- <g:javascript library="src/views/statistique/tempsreel/CriteresTempsReelController"/>
- <g:javascript library="src/views/statistique/tempsreel/PresentationTempsReelView"/>
- <g:javascript library="src/views/statistique/tempsreel/PresentationTempsReelController"/>
+ <g:javascript
+ library="src/views/statistique/tempsreel/CriteresTempsReelView"/>
+ <g:javascript
+ library="src/views/statistique/tempsreel/CriteresTempsReelController"/>
+ <g:javascript
+ library="src/views/statistique/tempsreel/PresentationTempsReelView"/>
+ <g:javascript
+ library="src/views/statistique/tempsreel/PresentationTempsReelController"/>
<g:javascript library="src/views/statistique/tempsreel/Application"/>
</head>
+
<body>
%{-- Message --}%
<div id="messages" class="portal-messages"/>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="résultats" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="BlankPage" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="1e4e4532-f993-4b19-8ef1-8cd6ce160e83">
+ <property name="ireport.zoom" value="1.5"/>
+ <property name="ireport.x" value="0"/>
+ <property name="ireport.y" value="0"/>
+ <property name="ireport.callouts" value="##Tue Mar 11 15:41:52 CET 2014"/>
+ <style name="label" hAlign="Left" fontName="Arial" fontSize="10"/>
+ <style name="valeur_champ" fontName="Arial" fontSize="10"/>
+ <parameter name="tableau" class="java.lang.Object" isForPrompting="false"/>
+ <parameter name="titre" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="classe" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="dateDebut" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="dateFin" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="etablissement" class="java.lang.String" isForPrompting="false"/>
+ <parameter name="total" class="java.lang.Object" isForPrompting="false"/>
+ <parameter name="titres" class="java.lang.Object" isForPrompting="false"/>
+ <parameter name="csv" class="java.lang.Object" isForPrompting="false"/>
+ <field name="classe" class="java.lang.String"/>
+ <field name="periode" class="java.lang.String"/>
+ <field name="etablissement" class="java.lang.Integer"/>
+ <variable name="currentPage" class="java.lang.Integer" resetType="None">
+ <variableExpression><![CDATA[$V{currentPage}==null?0:$V{currentPage}+1]]></variableExpression>
+ <initialValueExpression><![CDATA[0]]></initialValueExpression>
+ </variable>
+ <pageHeader>
+ <band height="36">
+ <textField isStretchWithOverflow="true">
+ <reportElement uuid="1ec0bec7-d26c-4e34-8942-db8fbfdc2e92" style="valeur_champ" stretchType="RelativeToBandHeight" x="134" y="10" width="97" height="20">
+ <printWhenExpression><![CDATA[$F{classe}.trim().length()>0]]></printWhenExpression>
+ </reportElement>
+ <textElement>
+ <font fontName="Arial" isPdfEmbedded="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA["Classe : "+$P{classe}]]></textFieldExpression>
+ </textField>
+ <textField>
+ <reportElement uuid="5d8f8808-d0a9-4f4e-a262-a23d1e2da2c1" x="0" y="10" width="118" height="20"/>
+ <textElement>
+ <font fontName="Arial" isPdfEmbedded="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA[$P{etablissement}]]></textFieldExpression>
+ </textField>
+ <textField isStretchWithOverflow="true">
+ <reportElement uuid="66cab38d-b735-43f5-a858-8ab3f627a94e" style="valeur_champ" stretchType="RelativeToBandHeight" x="0" y="10" width="802" height="20"/>
+ <textElement textAlignment="Center">
+ <font fontName="Arial" isPdfEmbedded="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA["Période du "+$P{dateDebut}+" au "+$P{dateFin}]]></textFieldExpression>
+ </textField>
+ <textField isStretchWithOverflow="true">
+ <reportElement uuid="d3e60eb4-11c4-4f79-ae76-6c18bb19bcdf" style="valeur_champ" stretchType="RelativeToBandHeight" x="578" y="0" width="223" height="20"/>
+ <textElement textAlignment="Right">
+ <font fontName="Arial" isBold="true" isPdfEmbedded="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA[$P{titre}]]></textFieldExpression>
+ </textField>
+ </band>
+ </pageHeader>
+ <detail>
+ <band height="50">
+ <subreport>
+ <reportElement uuid="2ec616e7-6854-4bcb-881d-2ce1b4b1eebd" x="0" y="0" width="802" height="50"/>
+ <subreportParameter name="titres">
+ <subreportParameterExpression><![CDATA[$P{titres}]]></subreportParameterExpression>
+ </subreportParameter>
+ <dataSourceExpression><![CDATA[$P{csv}]]></dataSourceExpression>
+ <subreportExpression><![CDATA[$P{tableau}]]></subreportExpression>
+ </subreport>
+ </band>
+ </detail>
+ <pageFooter>
+ <band height="31">
+ <textField pattern="">
+ <reportElement uuid="61095707-e0a6-4cae-a63d-b07400527221" x="644" y="5" width="157" height="20"/>
+ <textElement textAlignment="Right">
+ <font fontName="Arial" size="6" isPdfEmbedded="true"/>
+ </textElement>
+ <textFieldExpression><![CDATA[(
+ new SimpleDateFormat(
+ "EEEEE dd MMMMM yyyy",
+ Locale.FRANCE
+ )
+).format(new java.util.Date())]]></textFieldExpression>
+ </textField>
+ <textField evaluationTime="Auto">
+ <reportElement uuid="32539178-ddea-41bd-b5a5-e6faaf140c07" x="0" y="11" width="290" height="14"/>
+ <textElement>
+ <font fontName="Arial" size="6" isBold="false"/>
+ </textElement>
+ <textFieldExpression><![CDATA[msg("Page {0} / {1}", $V{currentPage}, $V{PAGE_NUMBER})]]></textFieldExpression>
+ </textField>
+ </band>
+ </pageFooter>
+</jasperReport>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="CSV" pageWidth="842" pageHeight="500" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="a894078a-929b-4aae-a1d0-46485f0f8835">
+ <property name="ireport.zoom" value="3.0"/>
+ <property name="ireport.x" value="690"/>
+ <property name="ireport.y" value="0"/>
+ <style name="cellule" mode="Transparent" fontName="Arial" fontSize="8">
+ <box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
+ <topPen lineWidth="0.25"/>
+ <leftPen lineWidth="0.25"/>
+ <bottomPen lineWidth="0.25"/>
+ <rightPen lineWidth="0.25"/>
+ </box>
+ </style>
+ <columnHeader>
+ <band height="12"/>
+ </columnHeader>
+</jasperReport>
return this.getColonnesVisibles(this.gridConsultation.getColumnModel());
},
+ getParamsViewColonnesVisbles:function () {
+ return {
+ colonnes:this.getViewColonnesVisbles()
+ };
+ },
+
getColonnesVisibles:function (columnModel) {
var colonnes = [];
this.addEvents(
this.BoutonExportEventsId.donneesPretesAExporter,
this.BoutonExportEventsId.aucuneDonneesAExporter,
- NameSpace.Constantes.eventId.actionSelectionMotifsChange
+ NameSpace.Constantes.eventId.actionSelectionMotifsChange,
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer
);
if (config.criteresType) {
this.BoutonExportEventsId.donneesPretesAExporter,
this.params
);
+ this.fireEvent(
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer,
+ false
+ );
+
} else {
this.fireEvent(
this.BoutonExportEventsId.aucuneDonneesAExporter
- )
+ );
+
+ this.fireEvent(
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer,
+ true
+ );
}
},
scope:this
});
this.store.reload(lastOptions)
+ },
+
+ getParametresRecherche:function () {
+ return this.params;
}
});
\ No newline at end of file
return this.getColonnesVisibles(this.grilleConsultation.getColumnModel());
},
+
+ getParamsViewColonnesVisbles:function () {
+ return {
+ colonnes:this.getColonnesVisibles(this.grilleConsultation.getColumnModel())
+ };
+ },
+
rendererNom:function (val, objet, record) {
var eleveId = record.get('idEleve');
return '<a href="#" onclick="eliot.ficheeleve.Application.' +
getListClasse : undefined,
getEleve : undefined,
exporteDonnees : undefined,
- getRegimes: undefined
+ getRegimes: undefined,
+ imprimeDonnees: undefined
},
header : {
{
region:'east',
layout:'fit',
- width:210,
+ width:260,
items:this.getConfigBoutons(config)
}
]
if (config.boutonExportCsv) {
config.boutonExportCsv.setWidth(76);
boutonExportCsv = {
- bodyStyle:'paddingLeft:30px;',
+ bodyStyle:'paddingLeft:10px;',
items:config.boutonExportCsv
};
}
+ var boutonImprimer = {};
+ if (config.boutonImprimer) {
+ boutonImprimer = {
+ bodyStyle:'paddingLeft:10px;',
+ items:config.boutonImprimer
+ };
+ }
+
return [
{
- width:210,
+ width:260,
layout:'column',
items:[
{
scope:this
},
+ boutonImprimer,
+
boutonExportCsv
]
}
Ext.ns('eliot.absences.consultation.absences');
-eliot.absences.consultation.absences.Application = function() {
+eliot.absences.consultation.absences.Application = function () {
var Clazz = Ext.extend(Ext.util.Observable, {
- constructor: function() {
+ constructor:function () {
// supprime le loadMask après un temps maximal
eliot.absences.commons.Utils.supprimeLoadMask(
eliot.absences.commons.Constantes.maskTimeOut
- );
+ );
var Constantes = eliot.absences.consultation.Constantes;
var Modele = eliot.absences.consultation.Modele;
var boutonExporterView = new eliot.exportdonnees.BoutonExportView({});
var boutonExportController = new eliot.exportdonnees.
BoutonExportController({
- url : eliot.absences.consultation.Modele.url.exporteDonnees
- });
+ url:eliot.absences.consultation.Modele.url.exporteDonnees
+ });
boutonExportController.observeBoutonExportView(boutonExporterView);
boutonExporterView.observeBoutonExportController(boutonExportController);
var toolBarController = new eliot.absences.consultation.
ToolBarController({
- ajouterTypesRetardDepart : false,
- construitStoreTypes : true
- });
+ ajouterTypesRetardDepart:false,
+ construitStoreTypes:true
+ });
var debutPeriodeView = new eliot.absences.consultation.DateView({
- label : Modele.libelle.date
+ label:Modele.libelle.date
});
var typeView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkComboType,
- store : toolBarController.storeType,
- label : Modele.libelle.types
+ id:Constantes.composantId.idChkComboType,
+ store:toolBarController.storeType,
+ label:Modele.libelle.types
});
var divisionView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboDivision,
- store : toolBarController.storeDivision,
- label : Modele.libelle.divisions
+ id:Constantes.composantId.idChkcomboDivision,
+ store:toolBarController.storeDivision,
+ label:Modele.libelle.divisions
});
var groupeMotifsView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboGrpMotif,
- store : toolBarController.storeGrpMotif,
- label : Modele.libelle.groupeMotifs
+ id:Constantes.composantId.idChkcomboGrpMotif,
+ store:toolBarController.storeGrpMotif,
+ label:Modele.libelle.groupeMotifs
});
var motifView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboMotif,
- store : toolBarController.storeMotif,
- label : Modele.libelle.motifs
+ id:Constantes.composantId.idChkcomboMotif,
+ store:toolBarController.storeMotif,
+ label:Modele.libelle.motifs
});
var regimeView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboRegime,
- store : toolBarController.storeRegime,
- label : Modele.libelle.regimes
+ id:Constantes.composantId.idChkcomboRegime,
+ store:toolBarController.storeRegime,
+ label:Modele.libelle.regimes
});
var chkBoxSelectionDefaut = new Ext.form.Checkbox({
checked:true
});
- var toolBarView = new eliot.absences.consultation.ToolBarView({
- boutonExportCsv : boutonExporterView.bouton,
- ajouteDateDeFin : false,
- ajouteTypes : true,
- typeView : typeView.lovCombo,
- divisionView : divisionView.lovCombo,
- groupeMotifView : groupeMotifsView.lovCombo,
- motifView : motifView.lovCombo,
- regimeView: regimeView.lovCombo,
- debutPeriode : debutPeriodeView.date,
- chkBoxSelectionDefaut: chkBoxSelectionDefaut
- });
-
-
- toolBarController.observeGroupeMotifView(groupeMotifsView);
// On paramétres les critères par défaut de type
// On effectue la recherche à l'entrée de la page
var consultationController = new eliot.absences.consultation.
ConsultationController({
- criteresType :[
- Constantes.type.ABSENCES_VALABLES,
- Constantes.type.ABSENCES_NON_VALABLES,
- Constantes.type.ABSENCES_PREVISIONNELLES
- ],
- autoLoad : true
+ criteresType:[
+ Constantes.type.ABSENCES_VALABLES,
+ Constantes.type.ABSENCES_NON_VALABLES,
+ Constantes.type.ABSENCES_PREVISIONNELLES
+ ],
+ autoLoad:true
+ });
+ var consultationView = new eliot.absences.consultation.ConsultationView({
+ store:consultationController.store,
+ ajouterColDate:false,
+ ajouterColTypes:true,
+ ajouterColRegime:true,
+ afficheNombreElevesAuTotal:true,
+ largeurColonneHeure:100
+ });
+
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:consultationController,
+ callbackGetParametres1:consultationController.getParametresRecherche.createDelegate(consultationController),
+ callbackGetParametres2:consultationView.getParamsViewColonnesVisbles.createDelegate(consultationView)
});
+
+ var toolBarView = new eliot.absences.consultation.ToolBarView({
+ boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer,
+ ajouteDateDeFin:false,
+ ajouteTypes:true,
+ typeView:typeView.lovCombo,
+ divisionView:divisionView.lovCombo,
+ groupeMotifView:groupeMotifsView.lovCombo,
+ motifView:motifView.lovCombo,
+ regimeView:regimeView.lovCombo,
+ debutPeriode:debutPeriodeView.date,
+ chkBoxSelectionDefaut:chkBoxSelectionDefaut
+ });
+
+
+ toolBarController.observeGroupeMotifView(groupeMotifsView);
toolBarView.observeConsultationController(consultationController);
toolBarView.observeToolBarController(toolBarController);
+ consultationController.observerToolBarView(toolBarView);
- var consultationView = new eliot.absences.consultation.ConsultationView({
- store : consultationController.store,
- ajouterColDate : false,
- ajouterColTypes : true,
- ajouterColRegime: true,
- afficheNombreElevesAuTotal: true,
- largeurColonneHeure: 100
- });
+ // export
boutonExportController.setColonnesVisiblesFonction(
consultationView.getViewColonnesVisbles.createDelegate(consultationView)
);
- consultationController.observerToolBarView(toolBarView);
// Changement des valeurs des composants
consultationController.observeTypeView(typeView);
consultationController.observeRegimeView(regimeView);
var centerRegionItems = [
{
- id: Constantes.regionId.center,
+ id:Constantes.regionId.center,
xtype:'panel',
layout:'border',
- border: false,
- autoScroll: true,
- autoShow : true,
+ border:false,
+ autoScroll:true,
+ autoShow:true,
items:[
{
- region : 'north',
- autoHeight : true,
- border: false,
- frame : false,
- items :[
+ region:'north',
+ autoHeight:true,
+ border:false,
+ frame:false,
+ items:[
toolBarView.toolBar
]
},
{
- region : 'center',
- xtype : 'panel',
- border: false,
- frame : false,
- layout: 'fit',
- items : consultationView.grilleConsultation
+ region:'center',
+ xtype:'panel',
+ border:false,
+ frame:false,
+ layout:'fit',
+ items:consultationView.grilleConsultation
}
]
];
// Rendu du viewport
- Ext.onReady(function() {
+ Ext.onReady(function () {
eliot.layout.doLayout(
Constantes.regionId.viewPort,
Constantes.regionId.northPanel,
Constantes.regionId.centerPanel,
centerRegionItems
- )
+ )
});
// Supprime la progresse bar
* Le constructeur construit un store du grille d'appels oubliés,
* initialise des paramètres de recherche
*/
- constructor: function() {
+ constructor:function () {
this.NameSpace = eliot.absences.consultation;
this.BoutonExportEventsId = eliot.exportdonnees.BoutonExportControllerConstantes.eventId;
this.addEvents(
this.BoutonExportEventsId.donneesPretesAExporter,
- this.BoutonExportEventsId.aucuneDonneesAExporter
+ this.BoutonExportEventsId.aucuneDonneesAExporter,
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer
);
// Objet qui contient les paramètres de recherche
this.params = {
- start: 0,
- limit: this.NameSpace.Modele.data.nombreLignesParPage
+ start:0,
+ limit:this.NameSpace.Modele.data.nombreLignesParPage
};
// Création du proxy utilisé par le store pour communiquer avec le backoffice
var proxy = new Ext.data.HttpProxy({
- api: {
- read : this.NameSpace.Modele.url.appelsOubliesRecherche
+ api:{
+ read:this.NameSpace.Modele.url.appelsOubliesRecherche
}
});
// Description du store des appels oubliés
this.store = new Ext.data.Store({
- proxy : proxy,
- autoLoad : false,
- autoDestroy: true,
- baseParams : this.params,
- reader: new Ext.data.JsonReader({
- fields: [
+ proxy:proxy,
+ autoLoad:false,
+ autoDestroy:true,
+ baseParams:this.params,
+ reader:new Ext.data.JsonReader({
+ fields:[
{
- name: this.NameSpace.Modele.dataIndex.heure
+ name:this.NameSpace.Modele.dataIndex.heure
},
{
- name: this.NameSpace.Modele.dataIndex.structureEnseignement
+ name:this.NameSpace.Modele.dataIndex.structureEnseignement
},
{
- name: this.NameSpace.Modele.dataIndex.enseignant
+ name:this.NameSpace.Modele.dataIndex.enseignant
},
{
- name: this.NameSpace.Modele.dataIndex.matiere
+ name:this.NameSpace.Modele.dataIndex.matiere
},
{
- name: this.NameSpace.Modele.dataIndex.salle
+ name:this.NameSpace.Modele.dataIndex.salle
}
],
root:'lignes',
totalProperty:'nbLignes',
- successProperty: 'success',
- messageProperty :'message'
+ successProperty:'success',
+ messageProperty:'message'
}),
- writer: new Ext.data.JsonWriter({
- encode: true
+ writer:new Ext.data.JsonWriter({
+ encode:true
})
});
* Observe le proxy du store des appels oubliés
* @param proxy
*/
- observeProxy: function(proxy) {
+ observeProxy:function (proxy) {
proxy.addListener(
'exception',
- function(proxy, type, action, options, res) {
+ function (proxy, type, action, options, res) {
var message = res.message;
if (!message) {
message = this.NameSpace.Modele.message.erreurInconnue;
* Observe la vue d'appels oublies
* @param appelsOubliesView
*/
- observeAppelsOubliesView : function(appelsOubliesView) {
+ observeAppelsOubliesView:function (appelsOubliesView) {
appelsOubliesView.addListener(
this.NameSpace.Constantes.eventId.actionPagineConsultation,
- function(pageData) {
+ function (pageData) {
this.params.start = pageData.start;
this.store.baseParams = this.params;
},
* Observe le composant graphique du menu de la consultation
* @param critereController
*/
- observeCritereController : function (critereController) {
+ observeCritereController:function (critereController) {
critereController.addListener(
this.NameSpace.Constantes.eventId.rechercher,
- function(date, enseignantId, structureIds) {
+ function (date, enseignantId, structureIds) {
this.executeRecherche(date, enseignantId, structureIds);
},
this
/**
* Permet d'exécuter la recherche des appels oubliés
*/
- executeRecherche : function (date, enseignantId, structureIds) {
- this.params.date = date
- this.params.enseignantId = enseignantId;;
+ executeRecherche:function (date, enseignantId, structureIds) {
+ this.params.date = date;
+ this.params.enseignantId = enseignantId;
this.params.structureIds = structureIds;
this.store.baseParams = this.params;
this.store.reload();
},
observeStore:function () {
- this.store.addListener({
- load:{
- fn:function () {
- if (this.store.getTotalCount() > 0) {
- this.fireEvent(
- this.BoutonExportEventsId.donneesPretesAExporter,
- this.params
- );
- } else {
- this.fireEvent(
- this.BoutonExportEventsId.aucuneDonneesAExporter
- )
- }
- },
- scope:this
+ this.store.addListener({
+ load:{
+ fn:function () {
+ if (this.store.getTotalCount() > 0) {
+ this.fireEvent(
+ this.BoutonExportEventsId.donneesPretesAExporter,
+ this.params
+ );
+
+ this.fireEvent(
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer,
+ false
+ );
+ } else {
+ this.fireEvent(
+ this.BoutonExportEventsId.aucuneDonneesAExporter
+ );
+
+ this.fireEvent(
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer,
+ true
+ );
}
- })
+ },
+ scope:this
+ }
+ })
+ },
+
+ getParametresRecherche:function () {
+ return this.params;
}
});
\ No newline at end of file
Ext.ns('eliot.absences.consultation.appelsoublies');
-eliot.absences.consultation.appelsoublies.Application = function() {
+eliot.absences.consultation.appelsoublies.Application = function () {
var Clazz = Ext.extend(Ext.util.Observable, {
/**
* un controlleur de grille et la vue de la grille, toutes les vues sont
* initialisées dans une structure de 'Recherche' dans la page appels oubliés
*/
- constructor: function() {
+ constructor:function () {
// supprime le loadMask après un temps maximal
eliot.absences.commons.Utils.supprimeLoadMask(
eliot.absences.commons.Constantes.maskTimeOut
/****************************** Bouton exporter **********************************/
var boutonExporterView = new eliot.exportdonnees.BoutonExportView({});
var boutonExportController = new eliot.exportdonnees.BoutonExportController({
- url : Modele.url.exporteAppelsOublies
+ url:Modele.url.exporteAppelsOublies
});
boutonExportController.observeBoutonExportView(boutonExporterView);
/*************************** Critères *****************************/
var critereController = new NameSpace.CritereController({
- date : this.getDate(Modele)
+ date:this.getDate(Modele)
+ });
+
+ var appelsOubliesController = new NameSpace.AppelsOubliesController();
+
+ var appelsOubliesView = new NameSpace.AppelsOubliesView({
+ store:appelsOubliesController.store,
+ pageSize:Modele.data.nombreLignesParPage
+ });
+
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:appelsOubliesController,
+ callbackGetParametres1:appelsOubliesController.getParametresRecherche.createDelegate(appelsOubliesController)
});
var critereView = new NameSpace.CritereView({
- boutonExportCsv : boutonExporterView.bouton,
- date : this.getDate(Modele),
- enseignantController : critereController.enseignantController,
- classeController : critereController.classeController
+ boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer,
+ date:this.getDate(Modele),
+ enseignantController:critereController.enseignantController,
+ classeController:critereController.classeController
});
critereView.dateView.observeDateController(
critereController.observeCritereView(critereView);
- /********************* Appels oublies grille ***********************/
- var appelsOubliesController = new NameSpace.AppelsOubliesController();
appelsOubliesController.observeCritereController(critereController);
-
- var appelsOubliesView = new NameSpace.AppelsOubliesView({
- store: appelsOubliesController.store,
- pageSize : Modele.data.nombreLignesParPage
- });
-
appelsOubliesController.observeAppelsOubliesView(appelsOubliesView);
var centerRegionItems = [
{
- id: Constantes.regionId.center,
+ id:Constantes.regionId.center,
xtype:'panel',
layout:'border',
- border: false,
- autoScroll: true,
- autoShow : true,
+ border:false,
+ autoScroll:true,
+ autoShow:true,
items:[
{
- region : 'north',
- height : 45,
- autoHeight : true,
- border: false,
- frame : false,
- items : [
+ region:'north',
+ height:45,
+ autoHeight:true,
+ border:false,
+ frame:false,
+ items:[
critereView.criterePanel
]
},
{
- region : 'center',
- xtype : 'panel',
- border: false,
- frame : false,
- layout: 'fit',
- items : appelsOubliesView.grilleAppelsOublies
+ region:'center',
+ xtype:'panel',
+ border:false,
+ frame:false,
+ layout:'fit',
+ items:appelsOubliesView.grilleAppelsOublies
}
]
}
}
// Rendu du viewport
- Ext.onReady(function() {
+ Ext.onReady(function () {
eliot.layout.doLayout(
Constantes.regionId.viewPort,
Constantes.regionId.northPanel,
* la date égale à la date actuelle
* @param modele
*/
- getDate : function(modele) {
+ getDate:function (modele) {
var date = new Date();
var dateDebutAnneeScolaire = Date.parseDate(
modele.data.anneeScolaire.debutAnneeScolaire,
* de recherche, qui contient la vue des composants : datePicker,
* combo d'enseignant et combo de classe
*/
- constructor: function(config) {
+ constructor:function (config) {
this.NsCommon = eliot.absences.commons;
this.Modele = eliot.absences.consultation.Modele;
this.Constantes = eliot.absences.consultation.Constantes;
var defaultConfig = {
- date : undefined,
- enseignantController : undefined,
- classeController : undefined
+ date:undefined,
+ enseignantController:undefined,
+ classeController:undefined
};
Ext.applyIf(config, defaultConfig);
/********************* Date view *********************/
this.dateView = new this.NsCommon.DateView({
- date : config.date,
- fieldLabel : this.Modele.libelle.date,
- champObligatoir : false,
- anneeScolaire : this.Modele.data.anneeScolaire
+ date:config.date,
+ fieldLabel:this.Modele.libelle.date,
+ champObligatoir:false,
+ anneeScolaire:this.Modele.data.anneeScolaire
});
/*************************** Enseignant view ********************/
this.enseignantView = new this.NsCommon.ComboEnseignantView({
- storeEnseignant: config.enseignantController.storeEnseignant
+ storeEnseignant:config.enseignantController.storeEnseignant
});
/*************************** Classe view ************************/
this.classeView = new eliot.absences.consultation.LovComboView({
- id : this.Constantes.composantId.idLovComboClasse,
- store : config.classeController.store,
- label: this.Modele.libelle.classe,
- width : 158
+ id:this.Constantes.composantId.idLovComboClasse,
+ store:config.classeController.store,
+ label:this.Modele.libelle.classe,
+ width:158
});
if (config.boutonExportCsv) {
config.boutonExportCsv.setWidth(76);
boutonExportCsv = {
- bodyStyle:'paddingLeft:30px;',
+ bodyStyle:'paddingLeft:20px;',
items:config.boutonExportCsv
};
}
+ var boutonImprimer = {};
+ if (config.boutonImprimer) {
+ boutonImprimer = {
+ bodyStyle:'paddingLeft:15px;',
+ items:config.boutonImprimer
+ };
+ }
/*************************** Critères panel ************************/
this.criterePanel = new Ext.Panel({
- border : false,
+ border:false,
bodyStyle:'padding:5px 0 5px 0',
- cls : 'x-panel-mc',
- items :[
+ cls:'x-panel-mc',
+ items:[
{
layout:'column',
- border: false,
- frame: false,
- defaults: {
- layout: 'form',
- border: false,
- frame: false,
- labelAlign : 'right'
+ border:false,
+ frame:false,
+ defaults:{
+ layout:'form',
+ border:false,
+ frame:false,
+ labelAlign:'right'
},
- items : [
+ items:[
{
- labelWidth : 60,
- width: 170,
+ labelWidth:50,
+ width:165,
items:[
this.dateView.dateField
]
},
{
- labelWidth : 110,
- width: 290,
+ labelWidth:80,
+ width:250,
items:[
this.enseignantView.comboEnseignant
]
},
{
- labelWidth : 99,
- width: 300,
+ labelWidth:50,
+ width:220,
items:[
this.classeView.lovCombo
]
},
{
- width: 100,
- items : {
+ width:100,
+ items:{
xtype:'button',
- style : "paddingLeft : 20px",
- width : 100,
- text: this.Modele.libelle.chercher,
- icon: this.Modele.url.urlImageRechercher,
- handler : function () {
+ style:"paddingLeft : 20px",
+ width:60,
+ text:this.Modele.libelle.chercher,
+ icon:this.Modele.url.urlImageRechercher,
+ handler:function () {
eliot.absences.Message.resetMessages();
this.fireEvent(
this.Constantes.eventId.actionRechercher
);
},
- scope : this
+ scope:this
}
},
+
+ boutonImprimer,
+
boutonExportCsv
]
}
checked:true
});
+ var grilleController = new NameSpaceCommon.ConsultationController({
+ sortInfoField:Constantes.sortInfoField,
+ dateDebutIsNotToday:true,
+ dateFin:dateFinPeriode.format('d/m/Y')
+ });
+
+ var grilleView = new NameSpaceCommon.ConsultationView({
+ store:grilleController.store,
+ ajouterColDate:true,
+ ajouterColTypes:false,
+ ajouterColHeure:false
+ });
+
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:grilleController,
+ callbackGetParametres1:grilleController.getParametresRecherche.createDelegate(grilleController),
+ callbackGetParametres2:grilleView.getParamsViewColonnesVisbles.createDelegate(grilleView)
+ });
+
// Toolbar
var toolbarView = new NameSpaceCommon.ToolBarView({
pasPlusDeCriteres:false,
groupeMotifView:groupeMotifsView.lovCombo,
motifView:motifView.lovCombo,
boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer,
chkBoxSelectionDefaut:chkBoxSelectionDefaut
});
toolBarController.observeGroupeMotifView(groupeMotifsView);
-
- /*************************** Grille *******************************/
-
- var grilleController = new NameSpaceCommon.ConsultationController({
- sortInfoField:Constantes.sortInfoField,
- dateDebutIsNotToday:true,
- dateFin:dateFinPeriode.format('d/m/Y')
- });
-
toolbarView.observeConsultationController(grilleController);
toolbarView.observeToolBarController(toolBarController);
+ grilleController.observerToolBarView(toolbarView);
- var grilleView = new NameSpaceCommon.ConsultationView({
- store:grilleController.store,
- ajouterColDate:true,
- ajouterColTypes:false,
- ajouterColHeure:false
- });
+ // export
boutonExportController.setColonnesVisiblesFonction(
grilleView.getViewColonnesVisbles.createDelegate(grilleView)
);
- grilleController.observerToolBarView(toolbarView);
-
grilleController.observeDivisionView(divisionView);
grilleController.observeGroupeMotifsView(groupeMotifsView);
Ext.ns('eliot.absences.consultation.departs');
-eliot.absences.consultation.departs.Application = function() {
+eliot.absences.consultation.departs.Application = function () {
var Clazz = Ext.extend(Ext.util.Observable, {
- constructor: function() {
+ constructor:function () {
// supprime le loadMask après un temps maximal
eliot.absences.commons.Utils.supprimeLoadMask(
eliot.absences.commons.Constantes.maskTimeOut
- );
+ );
var Constantes = eliot.absences.consultation.Constantes;
var Modele = eliot.absences.consultation.Modele;
var boutonExporterView = new eliot.exportdonnees.BoutonExportView({});
var boutonExportController = new eliot.exportdonnees.
BoutonExportController({
- url : eliot.absences.consultation.Modele.url.exporteDonnees
- });
+ url:eliot.absences.consultation.Modele.url.exporteDonnees
+ });
boutonExportController.observeBoutonExportView(boutonExporterView);
boutonExporterView.observeBoutonExportController(boutonExportController);
// On ne construit pas le store de types
var toolBarController = new eliot.absences.consultation.
ToolBarController({
- ajouterTypesRetardDepart : false,
- construitStoreTypes : false
- });
+ ajouterTypesRetardDepart:false,
+ construitStoreTypes:false
+ });
var debutPeriodeView = new eliot.absences.consultation.DateView({
- label : Modele.libelle.date
+ label:Modele.libelle.date
});
var divisionView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboDivision,
- store : toolBarController.storeDivision,
- label : Modele.libelle.divisions
+ id:Constantes.composantId.idChkcomboDivision,
+ store:toolBarController.storeDivision,
+ label:Modele.libelle.divisions
});
var groupeMotifsView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboGrpMotif,
- store : toolBarController.storeGrpMotif,
- label : Modele.libelle.groupeMotifs
+ id:Constantes.composantId.idChkcomboGrpMotif,
+ store:toolBarController.storeGrpMotif,
+ label:Modele.libelle.groupeMotifs
});
var motifView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboMotif,
- store : toolBarController.storeMotif,
- label : Modele.libelle.motifs
+ id:Constantes.composantId.idChkcomboMotif,
+ store:toolBarController.storeMotif,
+ label:Modele.libelle.motifs
});
var chkBoxSelectionDefaut = new Ext.form.Checkbox({
checked:true
});
+ // Le type d'absence vaut toujours type retard
+ // On effectue la recherche à l'entrée de la page
+ var consultationController = new eliot.absences.consultation.
+ ConsultationController({
+ criteresType:[ Constantes.type.DEPART_ANTICIPE ],
+ autoLoad:true
+ });
+
+ // On ajoute pas la colonne de Date ni la colonne de type d'absence
+ var consultationView = new eliot.absences.consultation.
+ ConsultationView({
+ store:consultationController.store,
+ ajouterColDate:false,
+ ajouterColTypes:false
+ });
+
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:consultationController,
+ callbackGetParametres1:consultationController.getParametresRecherche.createDelegate(consultationController),
+ callbackGetParametres2:consultationView.getParamsViewColonnesVisbles.createDelegate(consultationView)
+ });
+
// On ajoute pas le champs date de fin,on consulte les départs d'un jour
// On ajoute pas la liste des types, le type égale toujours à Départ anticipé
var toolBarView = new eliot.absences.consultation.ToolBarView({
- boutonExportCsv :boutonExporterView.bouton,
- ajouteDateDeFin : false,
- ajouteTypes : false,
- divisionView : divisionView.lovCombo,
- groupeMotifView : groupeMotifsView.lovCombo,
- motifView : motifView.lovCombo,
- debutPeriode : debutPeriodeView.date,
- chkBoxSelectionDefaut: chkBoxSelectionDefaut
+ boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer,
+ ajouteDateDeFin:false,
+ ajouteTypes:false,
+ divisionView:divisionView.lovCombo,
+ groupeMotifView:groupeMotifsView.lovCombo,
+ motifView:motifView.lovCombo,
+ debutPeriode:debutPeriodeView.date,
+ chkBoxSelectionDefaut:chkBoxSelectionDefaut
});
toolBarController.observeGroupeMotifView(groupeMotifsView);
-
- // Le type d'absence vaut toujours type retard
- // On effectue la recherche à l'entrée de la page
- var consultationController = new eliot.absences.consultation.
- ConsultationController({
- criteresType :[ Constantes.type.DEPART_ANTICIPE ],
- autoLoad : true
- });
-
toolBarView.observeConsultationController(consultationController);
toolBarView.observeToolBarController(toolBarController);
+ consultationController.observerToolBarView(toolBarView);
- // On ajoute pas la colonne de Date ni la colonne de type d'absence
- var consultationView = new eliot.absences.consultation.
- ConsultationView({
- store : consultationController.store,
- ajouterColDate : false,
- ajouterColTypes : false
- });
+ // export
boutonExportController.setColonnesVisiblesFonction(
consultationView.getViewColonnesVisbles.createDelegate(consultationView)
);
- consultationController.observerToolBarView(toolBarView);
-
// Changement des valeurs des composants
consultationController.observeDivisionView(divisionView);
consultationController.observeGroupeMotifsView(groupeMotifsView);
var centerRegionItems = [
{
- id: Constantes.regionId.center,
+ id:Constantes.regionId.center,
xtype:'panel',
layout:'border',
- border: false,
- autoScroll: true,
- autoShow : true,
+ border:false,
+ autoScroll:true,
+ autoShow:true,
items:[
{
- region : 'north',
- autoHeight : true,
- border: false,
- frame : false,
- items :[
+ region:'north',
+ autoHeight:true,
+ border:false,
+ frame:false,
+ items:[
toolBarView.toolBar
]
},
{
- region : 'center',
- xtype : 'panel',
- border: false,
- frame : false,
- layout: 'fit',
- items : consultationView.grilleConsultation
+ region:'center',
+ xtype:'panel',
+ border:false,
+ frame:false,
+ layout:'fit',
+ items:consultationView.grilleConsultation
}
]
}
];
// Rendu du viewport
- Ext.onReady(function() {
+ Ext.onReady(function () {
eliot.layout.doLayout(
Constantes.regionId.viewPort,
Constantes.regionId.northPanel,
Constantes.regionId.centerPanel,
centerRegionItems
- )
+ )
});
// Supprime la progresse barre
Ext.ns('eliot.absences.consultation.multicriteres');
-eliot.absences.consultation.multicriteres.Application = function() {
+eliot.absences.consultation.multicriteres.Application = function () {
var Clazz = Ext.extend(Ext.util.Observable, {
- constructor: function() {
+ constructor:function () {
// supprime le loadMask après un temps maximal
eliot.absences.commons.Utils.supprimeLoadMask(
eliot.absences.commons.Constantes.maskTimeOut
- );
+ );
var Constantes = eliot.absences.consultation.Constantes;
var Modele = eliot.absences.consultation.Modele;
var toolBarController = new eliot.absences.consultation.
ToolBarController({
- ajouterTypesRetardDepart : true,
- construitStoreTypes : true,
- avecElevesInactif: true
- });
+ ajouterTypesRetardDepart:true,
+ construitStoreTypes:true,
+ avecElevesInactif:true
+ });
/****************************** Bouton exporter **********************************/
var boutonExporterView = new eliot.exportdonnees.BoutonExportView({});
var boutonExportController = new eliot.exportdonnees.BoutonExportController({
- url : eliot.absences.consultation.Modele.url.exporteDonnees
+ url:eliot.absences.consultation.Modele.url.exporteDonnees
});
boutonExportController.observeBoutonExportView(boutonExporterView);
boutonExporterView.observeBoutonExportController(boutonExportController);
var debutPeriodeView = new eliot.absences.consultation.DateView({
- id :Constantes.composantId.idPeriodeDebut,
- label : Modele.libelle.periodeDebut,
- date : Modele.data.anneeScolaire.debutAnneeScolaire,
- anneeScolaire : Modele.data.anneeScolaire
+ id:Constantes.composantId.idPeriodeDebut,
+ label:Modele.libelle.periodeDebut,
+ date:Modele.data.anneeScolaire.debutAnneeScolaire,
+ anneeScolaire:Modele.data.anneeScolaire
});
var dateFinPeriode = new Date();
var dateDebutAnneeScolaire = Date.parseDate(
Modele.data.anneeScolaire.debutAnneeScolaire,
'd/m/Y'
- );
+ );
var dateFinAnneeScolaire = Date.parseDate(
Modele.data.anneeScolaire.finAnneeScolaire,
'd/m/Y'
- );
+ );
if (dateFinPeriode < dateDebutAnneeScolaire ||
dateFinPeriode > dateFinAnneeScolaire
}
var finPeriodeView = new eliot.absences.consultation.DateView({
- id :Constantes.composantId.idPeriodeFin,
- date : dateFinPeriode.format('d/m/Y'),
- label : Modele.libelle.periodeFin,
- anneeScolaire : Modele.data.anneeScolaire
+ id:Constantes.composantId.idPeriodeFin,
+ date:dateFinPeriode.format('d/m/Y'),
+ label:Modele.libelle.periodeFin,
+ anneeScolaire:Modele.data.anneeScolaire
});
var typeView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkComboType,
- store : toolBarController.storeType,
- label : Modele.libelle.types
+ id:Constantes.composantId.idChkComboType,
+ store:toolBarController.storeType,
+ label:Modele.libelle.types
});
var divisionView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboDivision,
- store : toolBarController.storeDivision,
- label : Modele.libelle.divisions
+ id:Constantes.composantId.idChkcomboDivision,
+ store:toolBarController.storeDivision,
+ label:Modele.libelle.divisions
});
var groupeMotifsView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboGrpMotif,
- store : toolBarController.storeGrpMotif,
- label : Modele.libelle.groupeMotifs
+ id:Constantes.composantId.idChkcomboGrpMotif,
+ store:toolBarController.storeGrpMotif,
+ label:Modele.libelle.groupeMotifs
});
var eleveView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboEleve,
- store : toolBarController.storeEleve,
- label : Modele.libelle.eleves,
- actifField: 'actif',
- disabled : true
+ id:Constantes.composantId.idChkcomboEleve,
+ store:toolBarController.storeEleve,
+ label:Modele.libelle.eleves,
+ actifField:'actif',
+ disabled:true
});
var motifView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboMotif,
- store : toolBarController.storeMotif,
- label : Modele.libelle.motifs
+ id:Constantes.composantId.idChkcomboMotif,
+ store:toolBarController.storeMotif,
+ label:Modele.libelle.motifs
});
- var chkBoxSelectionDefaut = new Ext.form.Checkbox({
+ var chkBoxSelectionDefaut = new Ext.form.Checkbox({
boxLabel:Modele.libelle.selectionDefaut,
checked:true
});
- var toolBarView = new eliot.absences.consultation.ToolBarView({
- boutonExportCsv : boutonExporterView.bouton,
- ajouteDateDeFin : true,
- ajouteTypes : true,
- ajouteEleve : true,
- typeView : typeView.lovCombo,
- divisionView : divisionView.lovCombo,
- groupeMotifView : groupeMotifsView.lovCombo,
- eleveView : eleveView.lovCombo,
- motifView : motifView.lovCombo,
- debutPeriode : debutPeriodeView.date,
- finPeriode : finPeriodeView.date,
- chkBoxSelectionDefaut: chkBoxSelectionDefaut
- });
-
- toolBarController.observeGroupeMotifView(groupeMotifsView);
- toolBarController.observeDivisionView(divisionView);
-
// On paramétre le critère par défaut de types
// On effectue pas la recherche à l'entrée de la page
var consultationController = new eliot.absences.consultation.
ConsultationController({
- criteresType :[Constantes.type.TOUS],
- autoLoad : false,
- dateDebutIsNotToday : true,
- dateFin :dateFinPeriode.format('d/m/Y')
+ criteresType:[Constantes.type.TOUS],
+ autoLoad:false,
+ dateDebutIsNotToday:true,
+ dateFin:dateFinPeriode.format('d/m/Y')
+ });
+
+ var consultationView = new eliot.absences.consultation.ConsultationView({
+ store:consultationController.store,
+ ajouterColDate:true,
+ ajouterColTypes:true
+ });
+
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:consultationController,
+ callbackGetParametres1:consultationController.getParametresRecherche.createDelegate(consultationController),
+ callbackGetParametres2:consultationView.getParamsViewColonnesVisbles.createDelegate(consultationView)
+ });
+
+ var toolBarView = new eliot.absences.consultation.ToolBarView({
+ boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer,
+ ajouteDateDeFin:true,
+ ajouteTypes:true,
+ ajouteEleve:true,
+ typeView:typeView.lovCombo,
+ divisionView:divisionView.lovCombo,
+ groupeMotifView:groupeMotifsView.lovCombo,
+ eleveView:eleveView.lovCombo,
+ motifView:motifView.lovCombo,
+ debutPeriode:debutPeriodeView.date,
+ finPeriode:finPeriodeView.date,
+ chkBoxSelectionDefaut:chkBoxSelectionDefaut
});
+
+ toolBarController.observeGroupeMotifView(groupeMotifsView);
+ toolBarController.observeDivisionView(divisionView);
toolBarView.observeConsultationController(consultationController);
toolBarView.observeToolBarController(toolBarController);
- var consultationView = new eliot.absences.consultation.ConsultationView({
- store : consultationController.store,
- ajouterColDate : true,
- ajouterColTypes : true
- });
+ // export
boutonExportController.setColonnesVisiblesFonction(
consultationView.getViewColonnesVisbles.createDelegate(consultationView)
);
var centerRegionItems = [
{
- id: Constantes.regionId.center,
+ id:Constantes.regionId.center,
xtype:'panel',
layout:'border',
- border: false,
- autoScroll: true,
- autoShow : true,
+ border:false,
+ autoScroll:true,
+ autoShow:true,
items:[
{
- region : 'north',
- autoHeight : true,
- border: false,
- frame : false,
- items :[
+ region:'north',
+ autoHeight:true,
+ border:false,
+ frame:false,
+ items:[
toolBarView.toolBar
]
},
{
- region : 'center',
- xtype : 'panel',
- border: false,
- frame : false,
- layout: 'fit',
- items : [
+ region:'center',
+ xtype:'panel',
+ border:false,
+ frame:false,
+ layout:'fit',
+ items:[
consultationView.grilleConsultation
]
}
];
// Rendu du viewport
- Ext.onReady(function() {
+ Ext.onReady(function () {
eliot.layout.doLayout(
Constantes.regionId.viewPort,
Constantes.regionId.northPanel,
Constantes.regionId.centerPanel,
centerRegionItems
- )
+ )
});
// Supprime la progresse bar
eliot.absences.Message.afficherDialogAlert(
Modele.message.titre,
Modele.message.parametragesManquants
- );
+ );
}
}
Ext.ns('eliot.absences.consultation.retards');
-eliot.absences.consultation.retards.Application = function() {
+eliot.absences.consultation.retards.Application = function () {
var Clazz = Ext.extend(Ext.util.Observable, {
- constructor: function() {
+ constructor:function () {
// supprime le loadMask après un temps maximal
eliot.absences.commons.Utils.supprimeLoadMask(
eliot.absences.commons.Constantes.maskTimeOut
- );
+ );
var Constantes = eliot.absences.consultation.Constantes;
var Modele = eliot.absences.consultation.Modele;
var boutonExporterView = new eliot.exportdonnees.BoutonExportView({});
var boutonExportController = new eliot.exportdonnees.
BoutonExportController({
- url : eliot.absences.consultation.Modele.url.exporteDonnees
- });
+ url:eliot.absences.consultation.Modele.url.exporteDonnees
+ });
boutonExportController.observeBoutonExportView(boutonExporterView);
boutonExporterView.observeBoutonExportController(boutonExportController);
// On ne construit pas le store de types
var toolBarController = new eliot.absences.consultation.
ToolBarController({
- ajouterTypesRetardDepart : false,
- construitStoreTypes : false
- });
+ ajouterTypesRetardDepart:false,
+ construitStoreTypes:false
+ });
var debutPeriodeView = new eliot.absences.consultation.DateView({
- label : Modele.libelle.date
+ label:Modele.libelle.date
});
var divisionView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboDivision,
- store : toolBarController.storeDivision,
- label : Modele.libelle.divisions
+ id:Constantes.composantId.idChkcomboDivision,
+ store:toolBarController.storeDivision,
+ label:Modele.libelle.divisions
});
var groupeMotifsView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboGrpMotif,
- store : toolBarController.storeGrpMotif,
- label : Modele.libelle.groupeMotifs
+ id:Constantes.composantId.idChkcomboGrpMotif,
+ store:toolBarController.storeGrpMotif,
+ label:Modele.libelle.groupeMotifs
});
var motifView = new eliot.absences.consultation.LovComboView({
- id : Constantes.composantId.idChkcomboMotif,
- store : toolBarController.storeMotif,
- label : Modele.libelle.motifs
+ id:Constantes.composantId.idChkcomboMotif,
+ store:toolBarController.storeMotif,
+ label:Modele.libelle.motifs
});
var chkBoxSelectionDefaut = new Ext.form.Checkbox({
checked:true
});
- // On ajoute pas le champs date de fin,on consulte les retards d'un jour
- // On ajoute pas la liste des types, le type égale toujours à Retard
- var toolBarView = new eliot.absences.consultation.ToolBarView({
- ajouteDateDeFin : false,
- ajouteTypes : false,
- divisionView : divisionView.lovCombo,
- groupeMotifView : groupeMotifsView.lovCombo,
- motifView : motifView.lovCombo,
- debutPeriode : debutPeriodeView.date,
- boutonExportCsv : boutonExporterView.bouton,
- chkBoxSelectionDefaut: chkBoxSelectionDefaut
- });
-
- toolBarController.observeGroupeMotifView(groupeMotifsView);
-
// Le type d'absence vaut toujours type retard
// On effectue la recherche à l'entrée de la page
var consultationController = new eliot.absences.consultation.
ConsultationController({
- criteresType :[ Constantes.type.RETARDS ],
- autoLoad : true
- });
-
- toolBarView.observeConsultationController(consultationController);
- toolBarView.observeToolBarController(toolBarController);
+ criteresType:[ Constantes.type.RETARDS ],
+ autoLoad:true
+ });
// On ajoute pas la colonne de Date ni la colonne de type d'absence
var consultationView = new eliot.absences.consultation.
ConsultationView({
- store : consultationController.store,
- ajouterColDate : false,
- ajouterColTypes : false
+ store:consultationController.store,
+ ajouterColDate:false,
+ ajouterColTypes:false
+ });
+
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:consultationController,
+ callbackGetParametres1:consultationController.getParametresRecherche.createDelegate(consultationController),
+ callbackGetParametres2:consultationView.getParamsViewColonnesVisbles.createDelegate(consultationView)
});
+
+
+ // On ajoute pas le champs date de fin,on consulte les retards d'un jour
+ // On ajoute pas la liste des types, le type égale toujours à Retard
+ var toolBarView = new eliot.absences.consultation.ToolBarView({
+ ajouteDateDeFin:false,
+ ajouteTypes:false,
+ divisionView:divisionView.lovCombo,
+ groupeMotifView:groupeMotifsView.lovCombo,
+ motifView:motifView.lovCombo,
+ debutPeriode:debutPeriodeView.date,
+ boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer,
+ chkBoxSelectionDefaut:chkBoxSelectionDefaut
+ });
+
+ toolBarController.observeGroupeMotifView(groupeMotifsView);
+ toolBarView.observeConsultationController(consultationController);
+ toolBarView.observeToolBarController(toolBarController);
+ consultationController.observerToolBarView(toolBarView);
+
+
+ // export
boutonExportController.setColonnesVisiblesFonction(
consultationView.getViewColonnesVisbles.createDelegate(consultationView)
);
- consultationController.observerToolBarView(toolBarView);
// Changement des valeurs des composants
consultationController.observeDivisionView(divisionView);
var centerRegionItems = [
{
- id: Constantes.regionId.center,
+ id:Constantes.regionId.center,
xtype:'panel',
layout:'border',
- border: false,
- autoScroll: true,
- autoShow : true,
+ border:false,
+ autoScroll:true,
+ autoShow:true,
items:[
{
- region : 'north',
- autoHeight : true,
- border: false,
- frame : false,
- items :[
+ region:'north',
+ autoHeight:true,
+ border:false,
+ frame:false,
+ items:[
toolBarView.toolBar
]
},
{
- region : 'center',
- xtype : 'panel',
- border: false,
- frame : false,
- layout: 'fit',
- items : consultationView.grilleConsultation
+ region:'center',
+ xtype:'panel',
+ border:false,
+ frame:false,
+ layout:'fit',
+ items:consultationView.grilleConsultation
}
]
}
];
// Rendu du viewport
- Ext.onReady(function() {
+ Ext.onReady(function () {
eliot.layout.doLayout(
Constantes.regionId.viewPort,
Constantes.regionId.northPanel,
Constantes.regionId.centerPanel,
centerRegionItems
- )
+ )
});
// Supprime la progresse barre
// Consultation controller
var consultationController = new NameSpace.TableauDeBordController();
+ // Consultation grille
+ var consultationView = new eliot.absences.commons.GridConsultationView({
+ store:consultationController.store,
+ columns:consultationController.getColonnesTableauDeBord(),
+ nombreLignesParPage:Modele.data.limit,
+ isInterrompuPaginer:true,
+ isSortableAllColonnes:false,
+ isNotResizableAllColonnes:true
+ });
+
/************ Toolbar(Zone des critères pour la recherche) *************/
boutonExportController.observeComposantActiveExport(consultationController);
boutonExportController.observeComposantDesactiveExport(consultationController);
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ composantModifieEtatBouton:consultationController,
+ callbackGetParametres1:consultationController.getParametresRecherche.createDelegate(consultationController),
+ callbackGetParametres2:consultationView.getParamsViewColonnesVisbles.createDelegate(consultationView)
+ });
+
var toolbarController = new NameSpace.ToolBarController({
sortInfo:consultationController.sortInfo,
dateDebut:dateDebut,
dateFin:dateFin,
optionAfficherLesAbsencesEnHeures:optionAfficherLesAbsencesEnHeures,
- boutonExportCsv:boutonExporterView.bouton
+ boutonExportCsv:boutonExporterView.bouton,
+ boutonImprimer:boutonImprimer
});
toolbarController.dateDebutController.observeDateView(
toolbarView.absencesEnHeuresView
);
- /************************ Consultation grille ***************************/
- var consultationView = new eliot.absences.commons.GridConsultationView({
- store:consultationController.store,
- columns:consultationController.getColonnesTableauDeBord(),
- nombreLignesParPage:Modele.data.limit,
- isInterrompuPaginer:true,
- isSortableAllColonnes:false,
- isNotResizableAllColonnes:true
- });
+ // export
boutonExportController.setColonnesVisiblesFonction(
consultationView.getViewColonnesVisbles.createDelegate(consultationView)
);
* La constructeur permet de construire un store de grille de tableau
* de bord.
*/
- constructor: function() {
+ constructor:function () {
this.NameSpace = eliot.absences.statistique.tableaudebord;
this.NsCommons = eliot.absences.commons;
this.Constantes = this.NameSpace.Constantes;
BoutonExportControllerConstantes.eventId;
this.addEvents(
- /**
- * @event
- * redimensionnement d'une colonne
- * @param indice de la colonne
- * @param nouvelle largeur de la colonne
- * @param la grille
- */
+ /**
+ * @event
+ * redimensionnement d'une colonne
+ * @param indice de la colonne
+ * @param nouvelle largeur de la colonne
+ * @param la grille
+ */
this.Constantes.eventId.actionResizeColumn,
this.Constantes.eventId.changeEtatColonnesEnHeure,
- /**
- * @event donneesPretesAExporter déclanché si la recherche remonte des données
- * @params : params les paramètres de la recherche
- */
+ /**
+ * @event donneesPretesAExporter déclanché si la recherche remonte des données
+ * @params : params les paramètres de la recherche
+ */
this.BoutonExporterEventsId.donneesPretesAExporter,
- /**
- * @event aucuneDonneesAExporter déclanché si la recherche n'a rien remonté
- */
- this.BoutonExporterEventsId.aucuneDonneesAExporter
- );
+ /**
+ * @event aucuneDonneesAExporter déclanché si la recherche n'a rien remonté
+ */
+ this.BoutonExporterEventsId.aucuneDonneesAExporter,
+
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer
+ );
// Paramètre de classement des résultats de la recherche
this.sortInfo = {
- field: this.Constantes.dataIndex.divisionCode,
- direction: this.Constantes.ordreClassement.ASC
+ field:this.Constantes.dataIndex.divisionCode,
+ direction:this.Constantes.ordreClassement.ASC
};
// Description du store des absences/retard/départ
this.store = new Ext.data.Store({
- autoLoad : false,
- autoDestroy: true,
- url : this.Modele.url.urlChercherInfoTDB,
- reader: new Ext.data.JsonReader({
- fields: [
+ autoLoad:false,
+ autoDestroy:true,
+ url:this.Modele.url.urlChercherInfoTDB,
+ reader:new Ext.data.JsonReader({
+ fields:[
{
- name: this.NameSpace.Constantes.dataIndex.divisionCode
+ name:this.NameSpace.Constantes.dataIndex.divisionCode
},
{
- name: this.NameSpace.Constantes.dataIndex.eleveId
+ name:this.NameSpace.Constantes.dataIndex.eleveId
},
{
- name: this.NameSpace.Constantes.dataIndex.nomPrenom
+ name:this.NameSpace.Constantes.dataIndex.nomPrenom
},
{
- name: this.NameSpace.Constantes.dataIndex.absencesNb
+ name:this.NameSpace.Constantes.dataIndex.absencesNb
},
{
- name: this.NameSpace.Constantes.dataIndex.nonExcuseesNb
+ name:this.NameSpace.Constantes.dataIndex.nonExcuseesNb
},
{
- name: this.NameSpace.Constantes.dataIndex.excuseesNb
+ name:this.NameSpace.Constantes.dataIndex.excuseesNb
},
{
- name: this.NameSpace.Constantes.dataIndex.nonValablesNb
+ name:this.NameSpace.Constantes.dataIndex.nonValablesNb
},
{
- name: this.NameSpace.Constantes.dataIndex.retardsNb
+ name:this.NameSpace.Constantes.dataIndex.retardsNb
},
{
- name: this.NameSpace.Constantes.dataIndex.departsAnticipesNb
+ name:this.NameSpace.Constantes.dataIndex.departsAnticipesNb
},
{
- name: this.NameSpace.Constantes.dataIndex.sanctionsNb
+ name:this.NameSpace.Constantes.dataIndex.sanctionsNb
},
{
- name: this.NameSpace.Constantes.dataIndex.punitionsNb
+ name:this.NameSpace.Constantes.dataIndex.punitionsNb
},
{
- name: this.NameSpace.Constantes.dataIndex.internatsNb
+ name:this.NameSpace.Constantes.dataIndex.internatsNb
},
{
- name: this.NameSpace.Constantes.dataIndex.demiPensionsNb
+ name:this.NameSpace.Constantes.dataIndex.demiPensionsNb
},
{
- name: this.NameSpace.Constantes.dataIndex.absencesEnHeures
+ name:this.NameSpace.Constantes.dataIndex.absencesEnHeures
},
{
- name: this.NameSpace.Constantes.dataIndex.excuseesEnHeures
+ name:this.NameSpace.Constantes.dataIndex.excuseesEnHeures
},
{
- name: this.NameSpace.Constantes.dataIndex.nonValablesEnHeures
+ name:this.NameSpace.Constantes.dataIndex.nonValablesEnHeures
},
{
- name: this.NameSpace.Constantes.dataIndex.nonExcuseesEnHeures
+ name:this.NameSpace.Constantes.dataIndex.nonExcuseesEnHeures
}
],
root:'dataGrille.lignes',
totalProperty:'dataGrille.nbLignes',
- successProperty: 'success',
- messageProperty :'message'
+ successProperty:'success',
+ messageProperty:'message'
})
});
this.observeStore();
},
- observeStore : function() {
+ observeStore:function () {
this.store.addListener({
- load : {
- fn : function() {
+ load:{
+ fn:function () {
if (this.store.getTotalCount() > 0) {
this.fireEvent(
this.BoutonExporterEventsId.donneesPretesAExporter,
this.params
- );
+ );
+
+ this.fireEvent(
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer,
+ false
+ );
} else {
this.fireEvent(
this.BoutonExporterEventsId.aucuneDonneesAExporter
- )
+ );
+
+ this.fireEvent(
+ eliot.impression.resultats.Constantes.eventId.changeEtatBoutonImprimer,
+ true
+ );
}
},
- scope : this
+ scope:this
}
})
},
- rendererNom : function(val, objet, record) {
+
+ getParametresRecherche:function () {
+ return this.params;
+ },
+
+ rendererNom:function (val, objet, record) {
var eleveId = record.get('autoriteEleveId');
return '<a href="#" onclick="eliot.ficheeleve.Application.' +
'afficheFicheEleve(' + eleveId + ',' + false + ');">' + val + '</a>';
* La méthode permet de construir des colonnes
* @return colonnes construits
*/
- getColonnesTableauDeBord: function(addAffichageEnHeure) {
+ getColonnesTableauDeBord:function (addAffichageEnHeure) {
var columns = [
{
- header: this.NameSpace.Modele.header.divisionCode,
- dataIndex: this.NameSpace.Constantes.dataIndex.divisionCode,
- width: 50,
- sortable: true,
- hideable: false
+ header:this.NameSpace.Modele.header.divisionCode,
+ dataIndex:this.NameSpace.Constantes.dataIndex.divisionCode,
+ width:50,
+ sortable:true,
+ hideable:false
},
{
header:this.NameSpace.Modele.header.nomPrenom,
- dataIndex: this.NameSpace.Constantes.dataIndex.nomPrenom,
+ dataIndex:this.NameSpace.Constantes.dataIndex.nomPrenom,
width:150,
- sortable: true,
- renderer : this.rendererNom.createDelegate(this),
- hideable: false
+ sortable:true,
+ renderer:this.rendererNom.createDelegate(this),
+ hideable:false
},
{
- header: this.NameSpace.Modele.header.absencesNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.absencesNb,
+ header:this.NameSpace.Modele.header.absencesNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.absencesNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.absencesEnHeures,
- dataIndex: this.NameSpace.Constantes.dataIndex.absencesEnHeures,
+ header:this.NameSpace.Modele.header.absencesEnHeures,
+ dataIndex:this.NameSpace.Constantes.dataIndex.absencesEnHeures,
width:85,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this),
- hidden : true,
- hideable: false
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this),
+ hidden:true,
+ hideable:false
},
{
- header: this.NameSpace.Modele.header.nonExcuseesNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.nonExcuseesNb,
+ header:this.NameSpace.Modele.header.nonExcuseesNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.nonExcuseesNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.nonExcuseesEnHeures,
- dataIndex: this.NameSpace.Constantes.dataIndex.nonExcuseesEnHeures,
+ header:this.NameSpace.Modele.header.nonExcuseesEnHeures,
+ dataIndex:this.NameSpace.Constantes.dataIndex.nonExcuseesEnHeures,
width:85,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this),
- hidden : true,
- hideable: false
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this),
+ hidden:true,
+ hideable:false
},
{
- header: this.NameSpace.Modele.header.excuseesNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.excuseesNb,
+ header:this.NameSpace.Modele.header.excuseesNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.excuseesNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.excuseesEnHeures,
- dataIndex: this.NameSpace.Constantes.dataIndex.excuseesEnHeures,
+ header:this.NameSpace.Modele.header.excuseesEnHeures,
+ dataIndex:this.NameSpace.Constantes.dataIndex.excuseesEnHeures,
width:85,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this),
- hidden : true,
- hideable: false
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this),
+ hidden:true,
+ hideable:false
},
{
- header: this.NameSpace.Modele.header.nonValablesNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.nonValablesNb,
+ header:this.NameSpace.Modele.header.nonValablesNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.nonValablesNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.nonValablesEnHeures,
- dataIndex: this.NameSpace.Constantes.dataIndex.nonValablesEnHeures,
+ header:this.NameSpace.Modele.header.nonValablesEnHeures,
+ dataIndex:this.NameSpace.Constantes.dataIndex.nonValablesEnHeures,
width:85,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this),
- hidden : true,
- hideable: false
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this),
+ hidden:true,
+ hideable:false
},
{
- header: this.NameSpace.Modele.header.retardsNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.retardsNb,
+ header:this.NameSpace.Modele.header.retardsNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.retardsNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.departsAnticipesNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.departsAnticipesNb,
+ header:this.NameSpace.Modele.header.departsAnticipesNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.departsAnticipesNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.sanctionsNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.sanctionsNb,
+ header:this.NameSpace.Modele.header.sanctionsNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.sanctionsNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.punitionsNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.punitionsNb,
+ header:this.NameSpace.Modele.header.punitionsNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.punitionsNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.internatsNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.internatsNb,
+ header:this.NameSpace.Modele.header.internatsNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.internatsNb,
width:70,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
},
{
- header: this.NameSpace.Modele.header.demiPensionsNb,
- dataIndex: this.NameSpace.Constantes.dataIndex.demiPensionsNb,
+ header:this.NameSpace.Modele.header.demiPensionsNb,
+ dataIndex:this.NameSpace.Constantes.dataIndex.demiPensionsNb,
width:80,
- align: 'right',
- menuDisabled: true,
- renderer: this.rendererZero.createDelegate(this)
+ align:'right',
+ menuDisabled:true,
+ renderer:this.rendererZero.createDelegate(this)
}
];
return columns;
* Rendre les cellules qui ont une valeur '0' en '-'
* @param value
*/
- rendererZero : function(value) {
+ rendererZero:function (value) {
if (value === 0) {
value = this.Constantes.remplacementZero;
}
* grille de consultation
* @param boutonChercherController
*/
- observeBoutonChercherController : function(boutonChercherController) {
+ observeBoutonChercherController:function (boutonChercherController) {
boutonChercherController.addListener(
eliot.absences.commons.BoutonChercherControllerConstantes.eventId.
actionChargeDonnees,
- function(data, params) {
+ function (data, params) {
this.params = params;
this.fireEvent(
this.Constantes.eventId.changeEtatColonnesEnHeure,
params.afficherLesAbsencesEnHeures,
- [3,5,7,9]
- );
+ [3, 5, 7, 9]
+ );
this.store.loadData(data);
},
this
- );
+ );
},
/**
* Observe le composant graphique qui présente le résultat de la recherche
* @param consultationView
*/
- observeConsultationView : function (consultationView) {
+ observeConsultationView:function (consultationView) {
var grilleConsultationEventId = eliot.absences.commons.
GrilleConsultationViewConstantes.eventId;
// écouter l'événement d'interrompu la pagination automatique du
consultationView.addListener(
eliot.absences.commons.GrilleConsultationViewConstantes.
eventId.actionPagineConsultation,
- function(pageData) {
+ function (pageData) {
this.params.start = pageData.start;
this.store.setBaseParam('params', Ext.encode(this.params));
},
this
- );
+ );
consultationView.addListener(
grilleConsultationEventId.actionClassementChange,
this.executeClassementChange,
this
- );
+ );
consultationView.addListener(
eliot.absences.commons.GrilleConsultationViewConstantes.eventId.actionResizeColumn,
this.executeColumnResize,
this
- );
+ );
consultationView.addListener(
eliot.absences.commons.GrilleConsultationViewConstantes.eventId.actionHiddenChange,
this.executeHiddenChange,
this
- )
+ )
},
/**
* classement
* @param newSortInfo
*/
- executeClassementChange : function(newSortInfo) {
+ executeClassementChange:function (newSortInfo) {
this.sortInfo = newSortInfo;
this.params.sortInfo = this.sortInfo;
//Important : la modification de la valeur de 'sortInfo' est faite 2 fois
var lastOptions = this.store.lastOptions;
if (lastOptions) {
Ext.apply(lastOptions.params, {
- tableauDeBordParams: Ext.encode(this.params)
+ tableauDeBordParams:Ext.encode(this.params)
});
this.store.reload(lastOptions);
} else {
}
},
- executeColumnResize : function(columnIndex, newSize, grid) {
+ executeColumnResize:function (columnIndex, newSize, grid) {
this.fireEvent(
eliot.absences.commons.GrilleConsultationViewConstantes.eventId.actionResizeColumn,
columnIndex,
newSize,
grid
- );
+ );
},
- executeHiddenChange : function(columnIndex, hidden) {
+ executeHiddenChange:function (columnIndex, hidden) {
this.fireEvent(
eliot.absences.commons.GrilleConsultationViewConstantes.eventId.actionHiddenChange,
columnIndex,
hidden
- )
+ )
}
* un lovCombo classes et un boutons de recherche
* @param config.lovComboStore le store de lovComboBox
*/
- constructor: function(config) {
+ constructor:function (config) {
// Variables
this.NameSpace = eliot.absences.statistique.tableaudebord;
this.Modele = this.NameSpace.Modele;
this.addEvents(
- /**
- * @event actionRechercher est déclenché quand on clique sur bouton chercher
- */
+ /**
+ * @event actionRechercher est déclenché quand on clique sur bouton chercher
+ */
this.NameSpace.Constantes.eventId.actionRechercher
- );
+ );
/*************************** Dates *******************************/
- // Date début view
+ // Date début view
this.dateDebutView = new eliot.absences.commons.DateView({
- date : config.dateDebut,
- anneeScolaire : this.Modele.data.anneeScolaire,
- fieldLabel : this.Modele.libelle.dateDebut,
- champObligatoir : false
+ date:config.dateDebut,
+ anneeScolaire:this.Modele.data.anneeScolaire,
+ fieldLabel:this.Modele.libelle.dateDebut,
+ champObligatoir:false
});
// Date fin view
this.dateFinView = new eliot.absences.commons.DateView({
- date : config.dateFin.format('d/m/Y'),
- anneeScolaire : this.Modele.data.anneeScolaire,
- fieldLabel : this.Modele.libelle.dateFin,
- champObligatoir : false
+ date:config.dateFin.format('d/m/Y'),
+ anneeScolaire:this.Modele.data.anneeScolaire,
+ fieldLabel:this.Modele.libelle.dateFin,
+ champObligatoir:false
});
/*************************** Classes *****************************/
- // LovCombo view
+ // LovCombo view
this.classeView = new eliot.absences.commons.LovComboView({
- ajoutItemTous : true,
- store : config.lovComboStore,
- fieldLabel : this.Modele.libelle.classes,
- width : 200,
- valeurInitiale : '-1'
+ ajoutItemTous:true,
+ store:config.lovComboStore,
+ fieldLabel:this.Modele.libelle.classes,
+ width:200,
+ valeurInitiale:'-1'
});
/*************************** Sélecteur de seuil ****************/
this.selectionView = new this.NameSpace.SelectionSeuilView({
- typeAbsenceStore: config.typeAbsenceStore
+ typeAbsenceStore:config.typeAbsenceStore
});
/***************************Affichage en heures*******************/
}
this.absencesEnHeuresView = new eliot.absences.commons.CheckBoxView({
- isEntiteEffectuee : undefined,
- libelle : this.Modele.libelle.enHeure,
- invisible : this.invisible
+ isEntiteEffectuee:undefined,
+ libelle:this.Modele.libelle.enHeure,
+ invisible:this.invisible
});
/**
* Construction du toolbar
*/
- getConfigToolBar : function(config) {
+ getConfigToolBar:function (config) {
return {
frame:true,
- labelAlign : 'right',
+ labelAlign:'right',
bodyStyle:'padding:5px 5px 5px',
- items : [
+ items:[
{
- layout : 'column',
- items : [
+ layout:'column',
+ items:[
{
- width : 310,
- layout: 'form',
- labelWidth: 100,
- items : [
+ width:310,
+ layout:'form',
+ labelWidth:100,
+ items:[
this.dateDebutView.dateField,
this.classeView.lovCombo
]
},
{
- width : 380,
- layout: 'form',
- labelWidth: 80,
- items : [
+ width:350,
+ layout:'form',
+ labelWidth:80,
+ items:[
this.dateFinView.dateField,
this.selectionView.selector
]
},
{
- width:200,
- items : [
+ width:240,
+ items:[
{
- layout : 'column',
- items : [
+ layout:'column',
+ items:[
{
xtype:'button',
- width : 100,
- text: this.Modele.libelle.chercher,
- icon: this.Modele.icon.urlImageRechercher,
- handler : function () {
+ width:80,
+ text:this.Modele.libelle.chercher,
+ icon:this.Modele.icon.urlImageRechercher,
+ handler:function () {
this.fireEvent(
this.NameSpace.Constantes.eventId.actionRechercher
- );
+ );
},
- scope : this
+ scope:this
},
{
- bodyStyle : 'paddingLeft:30px;',
- items : config.boutonExportCsv
+ bodyStyle:'paddingLeft:20px;',
+ items:config.boutonImprimer
+ },
+ {
+ bodyStyle:'paddingLeft:20px;',
+ items:config.boutonExportCsv
}
]
},
{
- style: {
- marginTop: '5px'
+ style:{
+ marginTop:'5px'
},
- items: this.absencesEnHeuresView.checkBox
+ items:this.absencesEnHeuresView.checkBox
}
]
}
);
+ /************************ Bouton Impression **************************/
+ var boutonImprimer = eliot.impression.resultats.Application.getBoutonImpression({
+ callbackGetParametres1:tempsReelController.getParametresRecherche.createDelegate(tempsReelController)
+ });
+
+
/********************* Critères de temps réel view ***********************/
var configCriteresTempsReelView = {};
configCriteresTempsReelView.boutonExportCsv = boutonExporterView.bouton;
+ configCriteresTempsReelView.boutonImprimer = boutonImprimer;
+
configCriteresTempsReelView.dateDebut = configDateDebut;
configCriteresTempsReelView.dateFin = configDateFin;
fieldLabel:Modele.libelle.eleves,
width:190,
valeurInitiale:defaultEleves,
- asyncValeurInitiale: configCriteresTempsReelController.structureId != null,
- actifField: 'actif'
+ asyncValeurInitiale:configCriteresTempsReelController.structureId != null,
+ actifField:'actif'
};
// Config de la lovcombo de choix des groupes de motif
dataIndex:datasTempsReel.dataIndex,
dataTempsReel:datasTempsReel.datasTempsreel,
totauxData:datasTempsReel.totaux,
- niveauDetail : datasTempsReel.niveauDetail
+ niveauDetail:datasTempsReel.niveauDetail
};
var presentationTempsReelController =
if (Modele.data.paramsTempsReel) {
if (Modele.data.datasTempsReel.datasTempsreel.length > 0) {
boutonExportController.params = Modele.data.paramsTempsReel;
- boutonExportController.setBoutonExportDesactive(false)
+ boutonExportController.setBoutonExportDesactive(false);
+
+ // activation du bouton d'impression
+ boutonImprimer.setDisabled(false);
+
} else {
boutonExportController.setBoutonExportDesactive(true);
boutonExportController.boutonExportController = undefined;
this.motifStore.addListener(
'load',
- function(){
+ function () {
this.Modele.data.motifIdsDefaut = this.motifStore.reader.jsonData.selectionParDefautIds;
this.fireEvent(this.Constantes.eventId.actionReloadMotifs);
},
// Définition du store des élèves
this.storeEleve = new Ext.data.JsonStore({
- autoLoad: this.structureId != null,
+ autoLoad:this.structureId != null,
url:this.Modele.url.getEleves,
- baseParams: {
- idStructureEnseignement: this.structureId,
- avecInactif: true
+ baseParams:{
+ idStructureEnseignement:this.structureId,
+ avecInactif:true
},
fields:[
{
- name: 'actif'
+ name:'actif'
},
{
name:'libelle'
]});
// Ajout de l'item 'Tous'
/*
- if (config.dataEleves) {
- config.dataEleves.unshift({id:-1, libelle:this.Modele.libelle.tous});
- this.storeEleve.loadData(config.dataEleves);
- }
- */
+ if (config.dataEleves) {
+ config.dataEleves.unshift({id:-1, libelle:this.Modele.libelle.tous});
+ this.storeEleve.loadData(config.dataEleves);
+ }
+ */
// Défintion du store de mode de calcul
this.modeCalculStore = new Ext.data.JsonStore({
this.modeCalculStore.loadData(config.dataModesCalcul);
},
- initMotifs: function() {
+ initMotifs:function () {
if (this.isSelectionParDefautChecked) {
this.motifs = this.Modele.data.motifIdsDefaut
} else {
},
- setSelectionParDefautChecked:function(checked){
+ setSelectionParDefautChecked:function (checked) {
this.isSelectionParDefautChecked = checked;
},
- setPlusDeCriteresCollapsed:function(collapsed){
+ setPlusDeCriteresCollapsed:function (collapsed) {
this.isPlusDeCriteresCollapsed = collapsed;
},
motifs:this.motifs,
typesDiscipline:this.typesDiscipline,
structuresEnseignement:this.structuresEnseignement,
- eleves: this.filtre(this.eleves),
+ eleves:this.filtre(this.eleves),
modeCalcul:this.modeCalcul,
isResultatsParNiveau:this.isResultatsParNiveau,
isPlusDeCriteresCollapsed:this.isPlusDeCriteresCollapsed,
document.location.href = href;
},
- filtre: function(valuesAsString) {
+ getParametresRecherche:function () {
+ return this.Modele.data.paramsTempsReel;
+ },
+
+ filtre:function (valuesAsString) {
if (valuesAsString == null) {
return undefined;
}
layout:'column',
items:[
{
- width:300,
+ width:220,
labelWidth:100,
items:this.dateDebutView.dateField
},
{
- width:350,
- labelWidth:125,
+ width:220,
+ labelWidth:90,
items:this.dateFinView.dateField
},
{
- width:265,
+ width:470,
labelWidth:50,
items:{
- bodyStyle:'paddingBottom:5px;paddingLeft:50px;',
+ bodyStyle:'paddingBottom:5px;paddingLeft:180px;',
layout:'column',
items:[
boutonChercher,
+ {
+ bodyStyle:'paddingLeft:10px;',
+ items:config.boutonImprimer
+ },
{
bodyStyle:'paddingLeft:10px;',
items:config.boutonExportCsv
},
actionSelectionMotifsChange:function (defaut) {
- if(!defaut){
+ if (!defaut) {
this.chkBoxSelectionDefaut.setValue(false);
}
},