*/
eliot.absences.commons.BoutonChercherControllerConstantes = {
- classesId : {
- tous : '-1'
- },
- typeAbsenceId : {
- tous : '-1'
- },
- groupDeMotifId : {
- tous : '-1'
- },
- motifId : {
- tous : '-1'
- },
- modeleId : {
- tous : '-1'
- },
- statutImpressionId : {
- tous : '-1'
- },
- eventId : {
- actionChargeDonnees : 'actionChargeDonnees'
- },
- dataIndex : {
- divisionCode : 'divisionCode'
- },
- typeCherche : {
- tableauDeBord : 'tableauDeBord',
- consultationARD : 'consultationARD',
- absence : 'absence',
- retard : 'retard',
- suiviImpression : 'suiviImpression'
- },
- seuil : {
- valeurDefaut : 0,
- type : {
- absencesTotales: 1,
- absencesNonExcusees: 2,
- absencesExcusees: 3,
- absencesNonValables: 4,
- retards: 5,
- departsAnticipes: 6,
- sanctions: 7,
- punitions: 8,
- internat: 9,
- demiPension: 10
+ classesId:{
+ tous:'-1'
+ },
+ typeAbsenceId:{
+ tous:'-1'
+ },
+ groupDeMotifId:{
+ tous:'-1'
+ },
+ motifId:{
+ tous:'-1'
+ },
+ modeleId:{
+ tous:'-1'
+ },
+ statutImpressionId:{
+ tous:'-1'
+ },
+ eventId:{
+ actionChargeDonnees:'actionChargeDonnees'
+ },
+ dataIndex:{
+ divisionCode:'divisionCode'
+ },
+ typeCherche:{
+ tableauDeBord:'tableauDeBord',
+ consultationARD:'consultationARD',
+ absence:'absence',
+ retard:'retard',
+ suiviImpression:'suiviImpression'
+ },
+ seuil:{
+ valeurDefaut:0,
+ type:{
+ absencesTotales:1,
+ absencesNonExcusees:2,
+ absencesExcusees:3,
+ absencesNonValables:4,
+ retards:5,
+ departsAnticipes:6,
+ sanctions:7,
+ punitions:8,
+ internat:9,
+ demiPension:10
}
},
- filtrerDejaEnvoye: false
+ filtrerDejaEnvoye:false
};
eliot.absences.commons.BoutonChercherControllerModele = {
- data : {
- anneeScolaire : undefined,
- limit : undefined
- },
- message : {
- datesPasLogique : undefined,
- chargementMaskText : undefined,
- elevePasChoisi : undefined
- },
- url : {
- urlChercher : undefined,
- urlChercherAbsence : undefined,
- urlChercherRetard : undefined,
- urlChercherSuiviImpression : undefined
+ data:{
+ anneeScolaire:undefined,
+ limit:undefined
+ },
+ message:{
+ datesPasLogique:undefined,
+ chargementMaskText:undefined,
+ elevePasChoisi:undefined
+ },
+ url:{
+ urlChercher:undefined,
+ urlChercherAbsence:undefined,
+ urlChercherRetard:undefined,
+ urlChercherSuiviImpression:undefined
}
};
* en meme temps il observe la vue de bouton, une fois il est cliqué,
* il doit envoyer une requete ajax avec les paramètres accompagnés.
*/
- constructor: function(config) {
+ constructor:function (config) {
// Variables
this.NsCommons = eliot.absences.commons;
this.Modele = this.NsCommons.BoutonChercherControllerModele;
var defaultConfig = {
- dateDebut : Date.parseDate(
+ dateDebut:Date.parseDate(
this.Modele.data.anneeScolaire.debutAnneeScolaire,
"d/m/Y"
),
- dateFin : new Date()
+ dateFin:new Date()
};
Ext.applyIf(config, defaultConfig);
* bouton 'Chercher' dans toolbar
* @param toolbarView
*/
- observeToolbarView : function(toolbarView) {
+ observeToolbarView:function (toolbarView) {
if (this.typeCherche === this.Constantes.typeCherche.tableauDeBord) {
toolbarView.addListener(
eliot.absences.statistique.tableaudebord.Constantes.eventId.
actionRechercher,
- function() {
+ function () {
// Vérification la logique des dates, si c'est true,
// Lancer l'action de recherche
if (this.actionVerifierDates()) {
if (this.typeCherche === this.Constantes.typeCherche.consultationARD) {
toolbarView.addListener(
eliot.absences.consultation.Constantes.eventId.actionRechercher,
- function() {
+ function () {
if (this.actionVerifierDates()) {
this.actionRecherche();
} else {
this.typeCherche === this.Constantes.typeCherche.retard) {
toolbarView.addListener(
eliot.absences.publipostage.selection.Constantes.eventId.actionContenuChange,
- function(value) {
+ function (value) {
this.contenuTextField = value;
},
this
);
toolbarView.addListener(
eliot.absences.publipostage.selection.Constantes.eventId.actionRechercher,
- function(libelleDeTextField) {
+ function (libelleDeTextField) {
var message = undefined;
if (this.actionVerifierDates()) {
if (this.contenuTextField !== '') {
toolbarView.addListener(
eliot.absences.publipostage.suiviimpression.Constantes.eventId.
actionRechercher,
- function() {
+ function () {
var message = undefined;
if (this.actionVerifierDates()) {
this.actionRecherche();
* controlleur de dateDebut
* @param dateDebutController
*/
- observeDateDebutController : function(dateDebutController) {
+ observeDateDebutController:function (dateDebutController) {
dateDebutController.addListener(
this.NsCommons.DateControllerConstantes.eventId.dateChangee,
- function(dateSelectionnee) {
+ function (dateSelectionnee) {
this.dateDebut = dateSelectionnee;
},
this
* controlleur de dateFin
* @param dateFinController
*/
- observeDateFinController : function(dateFinController) {
+ observeDateFinController:function (dateFinController) {
dateFinController.addListener(
this.NsCommons.DateControllerConstantes.eventId.dateChangee,
- function(dateSelectionnee) {
+ function (dateSelectionnee) {
this.dateFin = dateSelectionnee;
},
this
* vue de dateDebut
* @param dateDebutView
*/
- observeDateDebutView : function(dateDebutView) {
+ observeDateDebutView:function (dateDebutView) {
dateDebutView.addListener(
eliot.absences.consultation.Constantes.eventId.actionDateChange,
- function(dateSelectionnee) {
+ function (dateSelectionnee) {
this.dateDebut = dateSelectionnee;
},
this
* vue de dateDebut
* @param dateFinView
*/
- observeDateFinView : function(dateFinView) {
+ observeDateFinView:function (dateFinView) {
dateFinView.addListener(
eliot.absences.consultation.Constantes.eventId.actionDateChange,
- function(dateSelectionnee) {
+ function (dateSelectionnee) {
this.dateFin = dateSelectionnee;
},
this
* vue de afficherLesAbsencesEnHeures
* @param absencesEnHeuresView
*/
- observeAbsencesEnHeuresView : function(absencesEnHeuresView) {
+ observeAbsencesEnHeuresView:function (absencesEnHeuresView) {
absencesEnHeuresView.addListener(
eliot.absences.commons.CheckBoxViewConstantes.eventId.actionChangeEntiteEffectuee,
- function(afficherLesAbsencesEnHeures) {
+ function (afficherLesAbsencesEnHeures) {
this.afficherLesAbsencesEnHeures = afficherLesAbsencesEnHeures;
},
this
* controlleur de lovCombo(Classes)
* @param classesController
*/
- observeClasseController : function(classesController) {
+ observeClasseController:function (classesController) {
classesController.addListener(
this.NsCommons.LovComboControllerConstantes.eventId.valeurChangee,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.classesId = valeurSelectionnee;
},
this
);
},
- observeTypeAbsenceController : function(typeAbsenceController) {
+ observeTypeAbsenceController:function (typeAbsenceController) {
typeAbsenceController.addListener(
this.NsCommons.LovComboControllerConstantes.eventId.valeurChangee,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.typeAbsenceId = valeurSelectionnee;
},
this
);
},
- observeGroupeMotifController : function(groupMotifController) {
+ observeGroupeMotifController:function (groupMotifController) {
groupMotifController.addListener(
this.NsCommons.LovComboControllerConstantes.eventId.valeurChangee,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.groupeDeMotifId = valeurSelectionnee;
},
this
);
},
- observeMotifController : function(motifController) {
+ observeMotifController:function (motifController) {
motifController.addListener(
this.NsCommons.LovComboControllerConstantes.eventId.valeurChangee,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.motifId = valeurSelectionnee;
},
this
* controlleur de Combo(Eleve)
* @param eleveController
*/
- observeEleveController : function(eleveController) {
+ observeEleveController:function (eleveController) {
eleveController.addListener(
this.NsCommons.ComboBoxControllerConstantes.eventId.entiteChange,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.eleveId = valeurSelectionnee;
},
this
* controlleur de Combo(Eleve)
* @param adresseController
*/
- observeAdresseController : function(adresseController) {
+ observeAdresseController:function (adresseController) {
adresseController.addListener(
this.NsCommons.ComboBoxControllerConstantes.eventId.entiteChange,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.adresseId = valeurSelectionnee;
},
this
);
},
- observeSupportMediaController : function(adresseController) {
+ observeSupportMediaController:function (adresseController) {
adresseController.addListener(
this.NsCommons.ComboBoxControllerConstantes.eventId.entiteChange,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.mediaId = valeurSelectionnee;
},
this
);
},
- observeFiltrerDejaEnvoyeCheckBox : function(checkBox) {
+ observeFiltrerDejaEnvoyeCheckBox:function (checkBox) {
checkBox.addListener(
'check',
- function(checkBox, newValue) {
+ function (checkBox, newValue) {
this.filtrerDejaEnvoye = newValue;
},
this
);
},
- observeModeleDocumentController : function(modeleDocumentController) {
+ observeModeleDocumentController:function (modeleDocumentController) {
modeleDocumentController.addListener(
this.NsCommons.LovComboControllerConstantes.eventId.valeurChangee,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.modeleId = valeurSelectionnee;
},
this
);
},
- observeStatutImpressionController : function(statutImpressionController) {
+ observeStatutImpressionController:function (statutImpressionController) {
statutImpressionController.addListener(
this.NsCommons.LovComboControllerConstantes.eventId.valeurChangee,
- function(valeurSelectionnee) {
+ function (valeurSelectionnee) {
this.statutImpressionId = valeurSelectionnee;
},
this
);
},
- observeSelectionSeuilController : function(selectionSeuilController) {
+ observeSelectionSeuilController:function (selectionSeuilController) {
selectionSeuilController.addListener(
eliot.absences.statistique.tableaudebord.Constantes.eventId.actionNiveauSeuilChange,
- function(newValue) {
+ function (newValue) {
this.valeurSeuil = newValue
},
this
selectionSeuilController.addListener(
eliot.absences.statistique.tableaudebord.Constantes.eventId.actionTypeSeuilChange,
- function(newValue) {
+ function (newValue) {
this.typeSeuil = newValue
},
this
/**
* Vérification la logiques des dateDebut et dateFin
*/
- actionVerifierDates : function() {
+ actionVerifierDates:function () {
+ // mets l'heure à 00 afin d'éviter des erreurs dans la comparaison des dates.
+ this.dateFin.clearTime();
+ this.dateDebut.clearTime();
+
if (this.dateFin >= this.dateDebut) {
return true;
} else {
/**
* La méthode permet d'executer la recherche
*/
- actionRecherche : function() {
+ actionRecherche:function () {
eliot.absences.Message.resetMessages();
this.executeRecherche();
},
/**
* Préparation de la liste de paramètres à envoyer dans requete ajax
*/
- getListeParams: function() {
+ getListeParams:function () {
var paramListe = {};
paramListe.dateDebut = this.dateDebut;
paramListe.dateFin = this.dateFin;
paramListe.statutImpressionId = this.statutImpressionId;
}
return paramListe;
- }
- ,
+ },
/**
* La méthode permet d'exécuter une recherche des infos dans un tableau
* les paramètres accompagnés : dateDebut, dateFin, classesId,
* sortAsc, sortField, start, limit, totalInfo
*/
- executeRecherche : function() {
+ executeRecherche:function () {
var paramListe = this.getListeParams();
var params = undefined;
var url = this.Modele.url.urlChercher;
if (this.typeCherche === this.Constantes.typeCherche.tableauDeBord) {
params = {
- params : Ext.encode(paramListe)
+ params:Ext.encode(paramListe)
};
} else {
params = {
- params : Ext.encode(paramListe)
+ params:Ext.encode(paramListe)
};
if (this.typeCherche === this.Constantes.typeCherche.absence) {
url = this.Modele.url.urlChercherAbsence;
}
Ext.Ajax.request({
- url: url,
- params: params,
- success:function(response, request) {
+ url:url,
+ params:params,
+ success:function (response, request) {
var reponse = Ext.decode(response.responseText);
if (reponse.success != true) {
if (reponse.message) {
}
}
},
- failure:function() {
+ failure:function () {
eliot.absences.Message.showErreur(
this.Modele.message.erreurInconnue
);
},
- scope : this
+ scope:this
});
}
});