Long anneeScolaireId,
TraitementType type,
String traitementArgs,
- String nom)
+ String nom,
+ boolean isDemandeImpressionCdt)
/**
* Méthode permettant d'effectuer une demande de traitement
import java.sql.Timestamp
import org.lilie.services.eliot.demon.ChampHistoriqueDemandeTraitement
import javax.sql.DataSource
+import java.text.SimpleDateFormat
/**
* Implémentation par défaut de DemandeTraitementService
DataSource dataSource
+ SimpleDateFormat sdf = new SimpleDateFormat(
+ "dd/MM/yyyy HH:mm",
+ Locale.FRANCE
+ )
+
/**
* Méthode permettant d'effectuer une demande de traitement
* @param type le type de traitement demandé
Long anneeScolaireId,
TraitementType type,
String traitementArgs,
- String nom) {
+ String nom,
+ boolean isDemandeImpressionCdt = false) {
if (!type instanceof DefaultTraitementType) {
throw new IllegalArgumentException(
}
DefaultTraitementType demandeTraitementType =
- (DefaultTraitementType) type
+ (DefaultTraitementType) type
+
+ String dateDemande = sdf.format(new Date());
+ if (isDemandeImpressionCdt) {
+ nom = dateDemande + "-" + nom
+ }
return executeInsert(
demandeurAutoriteId,
* @return les données d'historique des traitement selon les paramètres
*/
List<DefaultDemandeTraitement> getHistoriqueDemandesTraitements(
- SuiviDemandeTraitementParams params
+ SuiviDemandeTraitementParams params
) {
List<DefaultDemandeTraitement> result = []
List paramList = []
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © FYLAB and the Conseil Régional d'Île-de-France, 2009
+ ~ This file is part of L'Interface Libre et Interactive de l'Enseignement (Lilie).
+ ~
+ ~ Lilie is free software. You can redistribute it and/or modify since
+ ~ you respect the terms of either (at least one of the both license) :
+ ~ - under the terms of the GNU Affero General Public License as
+ ~ published by the Free Software Foundation, either version 3 of the
+ ~ License, or (at your option) any later version.
+ ~ - the CeCILL-C as published by CeCILL-C; either version 1 of the
+ ~ License, or any later version
+ ~
+ ~ There are special exceptions to the terms and conditions of the
+ ~ licenses as they are applied to this software. View the full text of
+ ~ the exception in file LICENSE.txt in the directory of this software
+ ~ distribution.
+ ~
+ ~ Lilie is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ ~ Licenses for more details.
+ ~
+ ~ You should have received a copy of the GNU General Public License
+ ~ and the CeCILL-C along with Lilie. If not, see :
+ ~ <http://www.gnu.org/licenses/> and
+ ~ <http://www.cecill.info/licences.fr.html>.
+ -->
+
+<databaseChangeLog
+ xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
+
+ <changeSet id="1" author="agia">
+
+ <comment>
+ Augmentation de la taille de colonne "demande_traitement.nom"
+ </comment>
+
+ <modifyDataType schemaName="entdemon"
+ tableName="demande_traitement"
+ columnName="nom"
+ newDataType="varchar(300)"/>
+
+ </changeSet>
+
+</databaseChangeLog>
<include file="changelogs/scolarite/2012-10-25-0023290.xml"/>
<include file="changelogs/scolarite/2012-10-26-0023396.xml"/>
<include file="changelogs/scolarite/2012-10-26-0023360.xml"/>
+ <include file="changelogs/scolarite/2012-11-16-0023433.xml"/>
</databaseChangeLog>
import org.lilie.services.eliot.demon.DemandeTraitementStatut
import org.lilie.services.eliot.demon.SuiviDemandeTraitementParams
import org.lilie.services.eliot.demon.impl.DefaultDemandeTraitement
+import org.lilie.services.eliot.demon.impl.DefaultTraitementType
import org.lilie.services.eliot.securite.AccessManager
import org.lilie.services.eliot.securite.AutorisationException
import org.lilie.services.eliot.textes.droits.ActionPossibleService
import java.text.SimpleDateFormat
import org.lilie.services.eliot.textes.arbre.*
+import org.lilie.services.eliot.demon.DemandeTraitementService
+import org.lilie.services.eliot.impression.stockage.PublipostageStockageFichierService
/**
* Controller dirigeant tout ce qui touche aux cahiers de textes.
AccueilEtatSessionService accueilEtatSessionService
ActionPossibleService actionPossibleService
CalendrierService calendrierService
+ TextesImpressionDiffereeService textesImpressionDiffereeService
+ DemandeTraitementService demandeTraitementService
+ PublipostageStockageFichierService publipostageStockageFichierService
SimpleDateFormat sdf = new SimpleDateFormat(
DateConstantes.DD_MM_YYYY,
* Retourne la liste des demande de traitements lancées par l'utilisateur
*/
def getSuiviImpression = {
- //TOIMP
Map mapParams = (Map) JSON.parse(params.params)
SimpleDateFormat sdfAffichage = new SimpleDateFormat(
Date dateFin = impressionSdf.parse(mapParams.dateFin.toString())
ChampHistoriqueDemandeTraitement champParam =
- ChampHistoriqueDemandeTraitement.DATE_HEURE
+ (ChampHistoriqueDemandeTraitement) ChampHistoriqueDemandeTraitement.find {
+ ChampHistoriqueDemandeTraitement chdt ->
+ chdt.nomChamp == mapParams.sortInfo.field.toString()
+ }
boolean trierAsc = mapParams.sortInfo.direction == "ASC"
SuiviDemandeTraitementParams historique = new SuiviDemandeTraitementParams(
- filtreStatut: [
- DemandeTraitementStatut.EN_ATTENTE,
- DemandeTraitementStatut.EN_COURS,
- DemandeTraitementStatut.TERMINEE,
- DemandeTraitementStatut.ERREUR,
- DemandeTraitementStatut.SUPPRIMEE
- ],
- // filtreType: [DefaultTraitementType.SUIVI_IMPRESSION_TEXTE],
+ filtreStatut: textesImpressionDiffereeService.parseCriteriaStatut(
+ mapParams.statuts
+ ),
+ filtreType: [DefaultTraitementType.IMPRESSION_CDT],
dateDebut: dateDebut,
dateFin: dateFin,
start: mapParams.start ?: 0,
sortAsc: trierAsc
)
- List<DefaultDemandeTraitement> liste = [
- new DefaultDemandeTraitement(
- id: 1,
- nom: 'nom',
- dateDemande : new Date(),
- statut : DemandeTraitementStatut.EN_COURS
- )]
+ List<DefaultDemandeTraitement> liste =
+ demandeTraitementService.getHistoriqueDemandesTraitements(
+ historique
+ )
List result = liste.collect {
[
nom: it.nom,
statut: message(code: it.statut.codeMessage),
telecharger_doc: it.statut == DemandeTraitementStatut.TERMINEE,
- // doc_existe: publipostageStockageFichierService.fichierExiste(
- // securiteSession,
- // it
- // ),
- // date_fin_execution_traitement:
- // notesDemandeTraitementService.getDateFinTraitement(
- // it.statut,
- // it.dateFinExecutionTraitement
- // ),
- // periode: notesDemandeTraitementService.getNomPeriode(it.id),
+ doc_existe: publipostageStockageFichierService.fichierExiste(
+ securiteSession,
+ it
+ ),
supprimable: (it.statut == DemandeTraitementStatut.TERMINEE ||
it.statut == DemandeTraitementStatut.ERREUR)
]
package org.lilie.services.eliot.textes.impression
+import org.lilie.services.eliot.textes.CahierDeTextes
+
+import org.lilie.services.eliot.annuaire.SecuriteSession
+import org.lilie.services.eliot.demon.DemandeTraitement
import org.lilie.services.eliot.demon.DemandeTraitementService
+import org.lilie.services.eliot.demon.DemandeTraitementStatut
import org.lilie.services.eliot.demon.impl.DefaultTraitementType
-import org.lilie.services.eliot.demon.DemandeTraitement
-import org.lilie.services.eliot.annuaire.SecuriteSession
-import org.lilie.services.eliot.textes.CahierDeTextes
import org.lilie.services.eliot.textes.droits.ActionPossibleService
import org.lilie.services.eliot.textes.impression.requetage.CahierDeTextesImpressionService
import org.lilie.services.eliot.textes.impression.requetage.donnees.ElementLivre
DemandeTraitement enregistreDemande(SecuriteSession securiteSession,
TextesImpressionParam param) {
- verifieDroitEnregistreDemande(securiteSession, param)
+ List<CahierDeTextes> cdts = CahierDeTextes.getAll(param.ids)
+
+ verifieDroitEnregistreDemande(securiteSession, param, cdts)
+
+ String nomPremierCdt = cdts.get(0).nom
Long demandeId = demandeTraitementService.ajouteDemandeTraitement(
(Long) securiteSession.defaultAutorite.id,
null,
DefaultTraitementType.IMPRESSION_CDT,
param.toJSON(),
- null
+ nomPremierCdt,
+ true
)
return demandeTraitementService.getDemandeTraitement(demandeId)
private void verifieDroitEnregistreDemande(SecuriteSession securiteSession,
- TextesImpressionParam param) {
-
- List<CahierDeTextes> cdts = CahierDeTextes.getAll(param.ids)
+ TextesImpressionParam param,
+ List<CahierDeTextes> cdts) {
cdts.each {CahierDeTextes cdt ->
actionPossibleService.verifierAccesConsultation(securiteSession, cdt)
}
}
+ public List<DemandeTraitementStatut> parseCriteriaStatut(String listeStatut) {
+ List<DemandeTraitementStatut> result = []
+ if (listeStatut.contains("-1")) {
+ DemandeTraitementStatut.each {
+ if (it != DemandeTraitementStatut.ANNULEE) {
+ result << it
+ }
+ }
+ } else {
+ listeStatut.split(',').collect {
+ result << DemandeTraitementStatut.parseByCode(Integer.parseInt(it))
+ }
+ }
+ return result
+ }
}
},
success: function(reponse) {
this.executeActualiser();
- eliot.textes.Messages.showConfirmation(this.Modele.messages.
+ eliot.textes.Messages.showConfirmation(this.Modele.message.
suppressionSucces);
},
failure: function(reponse) {
eliot.textes.Messages.showErreur(reponse.message);
}
else {
- eliot.textes.Messages.showErreur(this.Modele.messages.erreurSuppression);
+ eliot.textes.Messages.showErreur(this.Modele.message.erreurSuppression);
}
},
scope: this
var dateFin = this.dateFinComboBox.getValue();
if (dateFin < dateDebut) {
eliot.textes.Messages.showErreur(
- this.Modele.messages.erreurDates
+ this.Modele.message.erreurDates
);
return
}
} else {
value = '<img src=' + this.Modele.icon.telechargerDoc +
' style="opacity:0.4;filter:alpha(opacity=40);" >';
- obj.attr = 'ext:qtip="' + this.Modele.messages.docNonDisponible + '"';
+ obj.attr = 'ext:qtip="' + this.Modele.message.docNonDisponible + '"';
}
} else {
value = '<img src=' + this.Modele.icon.docNonDispo + '>';