* cfg storeavisType2
* cfg banqueAppreciation
*/
- constructor:function (config) {
+ constructor: function (config) {
Ext.QuickTips.init();
this.tooltipSequence = 0;
// Définition de la configuration par défaut
var cfg = {
- storeSaisie:undefined,
- storeAppreciation:undefined,
- storeAvisType1:undefined,
- storeAvisType2:undefined,
- banqueAppreciation:undefined,
- periodeModel:undefined
+ storeSaisie: undefined,
+ storeAppreciation: undefined,
+ storeAvisType1: undefined,
+ storeAvisType2: undefined,
+ banqueAppreciation: undefined,
+ periodeModel: undefined,
+ eleveModel: undefined
};
- Ext.apply(cfg, config);
+ this.config = Ext.apply(cfg, config);
this.storeSaisie = cfg.storeSaisie;
this.storeAppreciation = cfg.storeAppreciation;
this.storeAvisType2 = cfg.storeAvisType2;
this.banqueAppreciation = cfg.banqueAppreciation;
this.periodeModel = cfg.periodeModel;
+ this.eleveModel = cfg.eleveModel;
+ this.graphTdn = cfg.graphTdn;
this.initSaisie();
this.initAffichage();
this.initGraphCompnents();
+ this.initGraphTdnWindow();
this.items = [this.getMainItem()];
},
+ initGraphTdnWindow: function() {
+
+ var view = this;
+
+ var graphTdnWindow = new Ext.Window({
+ layout:'fit',
+ width:800,
+ height:500,
+ closeAction:'hide',
+ plain: true,
+ modal: true,
+ items: [
+ {
+ border: false,
+ frame: false,
+ layout: 'border',
+ items: [
+ {
+ border: false,
+ frame: false,
+ region: 'center',
+ layout: 'fit',
+
+ items: this.graphTdn.getItems()
+ },
+ {
+ region: 'east',
+ xtype: 'panel',
+
+ border: false,
+ frame : false,
+ layout : 'border',
+ split: true,
+ width: 200,
+ minSize: 20,
+ collapseMode: 'mini',
+
+ items: [
+ {
+ cls: 'legendcb',
+ region: 'north',
+ border: false,
+ frame : false,
+ height: 100,
+ items: []
+ },
+ {
+ region: 'center',
+ border: false,
+ frame : false,
+ layout : 'fit',
+ items: [
+ this.graphTdn.getLegendItem()
+ ]
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ buttonAlign: 'left',
+ buttons: [
+ {
+ icon: this.ConfigServeur.icon.graphEtoile,
+ tooltip: this.ConfigServeur.libelle.graphEtoile,
+ toggleGroup: 'graphTdn',
+ allowDepress: false,
+ pressed: true,
+ handler: function() {
+ view.graphTdn.toggleGraphEtoile();
+ }
+ },
+ {
+ icon: this.ConfigServeur.icon.graphEleveClasseCompare,
+ tooltip: this.ConfigServeur.libelle.graphEleveClasseCompare,
+ toggleGroup: 'graphTdn',
+ allowDepress: false,
+ handler: function() {
+ view.graphTdn.toggleGraphEleveClasseCompare();
+ }
+ },
+ '->',
+ {
+ text: this.ConfigServeur.libelle.fermer,
+ handler: function() {
+ graphTdnWindow.hide();
+ }
+ },
+ {
+ text: this.ConfigServeur.libelle.imprimer,
+ handler: function() {
+ view.graphTdn.imprime();
+ }
+ }
+ ]
+ });
+ this.graphTdnWindow = graphTdnWindow;
+ },
+
/**
* Initialise la saisie
*/
- initSaisie:function () {
+ initSaisie: function() {
var listeners = {
- change:function (textArea, newValue) {
+ change: function(textArea, newValue) {
var record = this.storeSaisie.getAt(0);
if (record) {
record.set('appreciation', newValue);
}
},
- keydown:function (textArea) {
+ keydown: function(textArea) {
var record = this.storeSaisie.getAt(0);
if (record) {
this.fireEvent(
this.isSaisieValid());
}
},
- scope:this
+ scope: this
};
// Ajoute les listeners qui gèrent la touche "Entrée"
// Saisie de l'appréciation
this.appreciationTextArea = new Ext.form.TextArea({
- name:'appreciation',
- maxLength:400,
- height:50,
- enableKeyEvents:true,
- autoCreate:{tag:'textarea', maxlength:'400'},
- listeners:listeners,
- disabled:true
+ name: 'appreciation',
+ maxLength: 400,
+ height: 50,
+ enableKeyEvents: true,
+ autoCreate: {tag: 'textarea', maxlength: '400'},
+ listeners: listeners,
+ disabled: true
});
// Bouton d'ajout d'une appréciation à la banque
this.banqueAppreciationBoutonEnregistrer = new Ext.Button({
- xtype:'tbbutton',
- icon:this.ConfigServeur.icon.banqueAppreciationEnregistrer,
- tooltip:this.ConfigServeur.messages.ajoutAppreciationDansListe,
- listeners:{
- click:function () {
+ xtype: 'tbbutton',
+ icon: this.ConfigServeur.icon.banqueAppreciationEnregistrer,
+ tooltip : this.ConfigServeur.messages.ajoutAppreciationDansListe,
+ listeners: {
+ click: function() {
this.fireEvent(
this.Constantes.eventId.actionInsereAppreciation,
{
- texte:this.appreciationTextArea.getValue()
+ texte: this.appreciationTextArea.getValue()
});
},
- scope:this
+ scope: this
},
- disabled:true
+ disabled: true
});
// Avis du conseil de classe
this.avisType1ComboBox = new Ext.form.ComboBox({
- id:'avisType1Id',
- name:'avisType1Id',
- store:this.storeAvisType1,
- fieldLabel:this.ConfigServeur.data.libelleTypeAvis1,
- width:191,
- labelStyle:'width: 190px',
- labelSeparator:' : ',
- triggerAction:'all',
- selectOnFocus:true,
- mode:'local',
- valueField:'id',
- displayField:'libelle',
- editable:false,
- disabled:true,
- listeners:{
- 'select':function (combo, newValue) {
+ id: 'avisType1Id',
+ name: 'avisType1Id',
+ store: this.storeAvisType1,
+ fieldLabel: this.ConfigServeur.data.libelleTypeAvis1,
+ width: 191,
+ labelStyle: 'width: 190px',
+ labelSeparator: ' : ',
+ triggerAction: 'all',
+ selectOnFocus: true,
+ mode: 'local',
+ valueField: 'id',
+ displayField: 'libelle',
+ editable: false,
+ disabled: true,
+ listeners: {
+ 'select': function(combo, newValue) {
var record = this.storeSaisie.getAt(0);
if ((record !== undefined) && (record !== null)) {
this.isSaisieValid());
}
},
- scope:this
+ scope: this
},
- tpl:'<tpl for="."><div class="x-combo-list-item">{libelle} </div></tpl>'
+ tpl: '<tpl for="."><div class="x-combo-list-item">{libelle} </div></tpl>'
});
this.avisType2ComboBox = new Ext.form.ComboBox({
- id:'avisType2Id',
- name:'avisType2Id',
- store:this.storeAvisType2,
- fieldLabel:this.ConfigServeur.data.libelleTypeAvis2,
- width:191,
- labelStyle:'width: 190px',
- labelSeparator:' : ',
- triggerAction:'all',
- selectOnFocus:true,
- mode:'local',
- valueField:'id',
- displayField:'libelle',
- editable:false,
- disabled:true,
- listeners:{
- 'select':function (combo, newValue) {
+ id: 'avisType2Id',
+ name: 'avisType2Id',
+ store: this.storeAvisType2,
+ fieldLabel: this.ConfigServeur.data.libelleTypeAvis2,
+ width: 191,
+ labelStyle: 'width: 190px',
+ labelSeparator: ' : ',
+ triggerAction: 'all',
+ selectOnFocus: true,
+ mode: 'local',
+ valueField: 'id',
+ displayField: 'libelle',
+ editable: false,
+ disabled: true,
+ listeners: {
+ 'select': function(combo, newValue) {
var record = this.storeSaisie.getAt(0);
if ((record !== undefined) && (record !== null)) {
this.isSaisieValid());
}
},
- scope:this
+ scope: this
},
- tpl:'<tpl for="."><div class="x-combo-list-item">{libelle} </div></tpl>'
+ tpl: '<tpl for="."><div class="x-combo-list-item">{libelle} </div></tpl>'
});
this.formSaisie = new Ext.form.FormPanel({
- region:'north',
- boxMinHeight:109,
- autoHeight:true,
- border:false,
- frame:false,
- layout:'anchor',
- layoutConfig:{
- align:'stretch',
- pack:'start'
+ region: 'north',
+ boxMinHeight: 109,
+ autoHeight: true,
+ border: false,
+ frame : false,
+ layout: 'anchor',
+ layoutConfig: {
+ align: 'stretch',
+ pack: 'start'
},
- items:[
+ items: [
{
- bodyStyle:'padding:7px 10px 5px',
- border:false,
- items:this.getSaisieAppreciationItem()
+ bodyStyle: 'padding:7px 10px 5px',
+ border: false,
+ items: this.getSaisieAppreciationItem()
},
{
bodyStyle:'padding:8px 0px',
- border:false,
- items:this.getSaisieAvisItem()
+ border: false,
+ items: this.getSaisieAvisItem()
}
]
});
this.formSaisie.getForm().loadRecord(record);
if (record.get('actif') !== false) {
if (this.ConfigServeur.data.isDirection == true ||
- (this.ConfigServeur.data.isProfPrincipal == true && this.ConfigServeur.data.isDatePublicationBulletinDepassee == false)) {
+ (this.ConfigServeur.data.isProfPrincipal == true &&
+ this.ConfigServeur.data.isDatePublicationBulletinDepassee == false)) {
this.appreciationTextArea.enable();
this.banqueAppreciationBoutonEnregistrer.enable();
this.avisType1ComboBox.enable();
/**
* Initialise l'affichage
*/
- initAffichage:function () {
+ initAffichage: function() {
var view = this;
// Appréciations
var cm = new Ext.grid.ColumnModel({
- defaults:{
- menuDisabled:true,
- resizable:false,
- align:'left'
+ defaults:
+ {
+ menuDisabled: true,
+ resizable: false,
+ align: 'left'
},
- columns:[
+ columns: [
// Période
{
- header:this.ConfigServeur.libelle.periode,
- dataIndex:'periode',
- width:110,
- renderer:eliot.notes.commun.Utils.textRenderer
+ header: this.ConfigServeur.libelle.periode,
+ dataIndex: 'periode',
+ width: 110,
+ renderer: eliot.notes.commun.Utils.textRenderer
},
// Moy. Elève
{
- header:'<span style="white-space:normal">' + this.ConfigServeur.libelle.recapitulatifMoyenneEleve + '</span>',
- dataIndex:'moyenneEleve',
- width:57,
- align:'center',
- renderer:eliot.notes.commun.Utils.getNoteRenderer({
- bold:true,
- annotationRenderer:function (value) {
+ header: '<span style="white-space:normal">' + this.ConfigServeur.libelle.recapitulatifMoyenneEleve + '</span>',
+ dataIndex: 'moyenneEleve',
+ width: 57,
+ align: 'center',
+ renderer: eliot.notes.commun.Utils.getNoteRenderer({
+ bold: true,
+ annotationRenderer: function(value) {
var sequence = view.tooltipSequence;
- view.tooltipSequence++;
+ view.tooltipSequence ++;
return '<span id="annotation' + sequence
+ '"class="annotation" annotation="' + value + '">'
+ value + '</span>';
// Moy. Classe
{
- header:'<span style="white-space:normal">' + this.ConfigServeur.libelle.recapitulatifMoyenneClasse + '</span>',
- dataIndex:'moyenneClasse',
- width:57,
- align:'center',
- renderer:eliot.notes.commun.Utils.noteRendererBold
+ header: '<span style="white-space:normal">' + this.ConfigServeur.libelle.recapitulatifMoyenneClasse + '</span>',
+ dataIndex: 'moyenneClasse',
+ width: 57,
+ align: 'center',
+ renderer: eliot.notes.commun.Utils.noteRendererBold
},
{
- header:this.ConfigServeur.data.libelleTypeAvis1,
- dataIndex:'avisType1Id',
- width:180,
- renderer:{
- fn:function (value) {
+ header: this.ConfigServeur.data.libelleTypeAvis1,
+ dataIndex: 'avisType1Id',
+ width: 180,
+ renderer: {
+ fn: function(value) {
var item = this.storeAvisType1.getById(value);
if (item === undefined) {
return '';
return eliot.notes.commun.Utils.textRenderer(item.get('libelle'));
}
},
- scope:this
+ scope: this
}
},
{
- header:this.ConfigServeur.data.libelleTypeAvis2,
- dataIndex:'avisType2Id',
- width:180,
- renderer:{
- fn:function (value) {
+ header: this.ConfigServeur.data.libelleTypeAvis2,
+ dataIndex: 'avisType2Id',
+ width: 180,
+ renderer: {
+ fn: function(value) {
var item = this.storeAvisType2.getById(value);
if (item === undefined) {
return '';
return eliot.notes.commun.Utils.textRenderer(item.get('libelle'));
}
},
- scope:this
+ scope: this
}
},
// Appréciations
{
- header:this.ConfigServeur.libelle.appreciation,
- dataIndex:'appreciation',
- width:180,
- renderer:eliot.notes.commun.Utils.textRenderer
+ header: this.ConfigServeur.libelle.appreciation,
+ dataIndex: 'appreciation',
+ width: 180,
+ renderer: eliot.notes.commun.Utils.textRenderer
}
]
});
this.appreciationGrid = new Ext.grid.GridPanel({
- store:this.storeAppreciation,
- autoHeight:false,
- colModel:cm,
- baseCls:'eliot-patch-ie-wrap x-panel',
- cls:'portal-default_table',
- margins:'0 5 5 5',
- border:true,
- columnLines:true,
- stripeRows:true,
- autoExpandMax:5000,
- autoExpandMin:400,
- autoExpandColumn:cm.columns.length - 1
+ store: this.storeAppreciation,
+ autoHeight: false,
+ colModel: cm,
+ baseCls: 'eliot-patch-ie-wrap x-panel',
+ cls: 'portal-default_table',
+ margins: '0 5 5 5',
+ border: true,
+ columnLines: true,
+ stripeRows: true,
+ autoExpandMax: 5000,
+ autoExpandMin: 400,
+ autoExpandColumn: cm.columns.length - 1
});
this.appreciationGrid.getView().addListener(
'refresh',
- function () {
+ function() {
this.refreshHtmlElements();
},
this);
this.appreciationGrid.addListener(
'viewready',
- function () {
+ function() {
this.refreshHtmlElements();
},
this);
/**
* Créer les composants utilisés pour le graph
*/
- initGraphCompnents:function () {
+ initGraphCompnents: function() {
this.periodesPrecedentesCheckbox = new Ext.form.Checkbox({
- boxLabel:this.ConfigServeur.libelle.afficherLesPeriodesPrecedents,
- listeners:{
- check:function () {
+ boxLabel: this.ConfigServeur.libelle.afficherLesPeriodesPrecedents,
+ listeners: {
+ check: function() {
+ this.fireEvent(this.Constantes.eventId.actionActualiserGraph);
+ },
+ scope: this
+ }
+ });
+
+ this.sousServicesCheckbox = new Ext.form.Checkbox({
+ boxLabel: this.ConfigServeur.libelle.afficherLesSousServices,
+ listeners: {
+ check: function() {
this.fireEvent(this.Constantes.eventId.actionActualiserGraph);
},
- scope:this
+ scope: this
}
});
this.graphPanel = new Ext.Panel({
region:'center',
- border:false,
- frame:false,
- layout:'fit',
- items:[]
+ border: false,
+ frame: false,
+ layout: 'fit',
+ items: []
+ });
+
+ this.graphLegendPanel = new Ext.Panel({
+ border: false,
+ frame: false,
+ layout: 'fit',
+ items: []
});
if (this.ConfigServeur.data.data.length !== 0) {
this.afficheGraph(
this.ConfigServeur.data.data,
+ this.ConfigServeur.data.impressionGraph,
this.ConfigServeur.data.periodesPrecedentesExistent,
this.ConfigServeur.data.graphPeriodes);
}
/**
* Item principal
*/
- getMainItem:function () {
+ getMainItem: function() {
return {
- xtype:'panel',
+ xtype: 'panel',
layout:'border',
- border:false,
- frame:false,
- items:[
+ border: false,
+ frame: false,
+ items: [
this.getBanqueAppreciationItem(),
{
- region:'center',
- xtype:'panel',
- border:false,
- frame:false,
- layout:'border',
- items:[
+ region: 'center',
+ xtype: 'panel',
+ border: false,
+ frame: false,
+ layout: 'border',
+ items: [
this.formSaisie,
this.getAppreciationsItem()
]
/**
* Banque d'appréciation
*/
- getBanqueAppreciationItem:function () {
+ getBanqueAppreciationItem: function() {
return {
- region:'east',
- xtype:'panel',
-
- border:false,
- frame:false,
- layout:'fit',
- split:true,
- width:200,
- minSize:20,
- collapseMode:'mini',
-
- items:this.banqueAppreciation.items
+ region: 'east',
+ xtype: 'panel',
+
+ border: false,
+ frame : false,
+ layout : 'fit',
+ split: true,
+ width: 200,
+ minSize: 20,
+ collapseMode: 'mini',
+
+ items: this.banqueAppreciation.items
};
- },
+ }
+ ,
/**
* Saisie de l'appréciation
*/
- getSaisieAppreciationItem:function () {
+ getSaisieAppreciationItem: function() {
var periode = this.periodeModel.getPeriode();
var periodeLibelle = '';
}
return {
- xtype:'panel',
+ xtype: 'panel',
layout:'border',
- height:60,
- border:false,
- frame:false,
- items:[
+ height: 60,
+ border: false,
+ frame: false,
+ items: [
{
- region:'north',
- xtype:'panel',
- border:false,
- frame:false,
- items:[
+ region: 'north',
+ xtype: 'panel',
+ border: false,
+ frame: false,
+ items: [
{
- xtype:'label',
- id:this.Constantes.composantId.lblAppreciationDu,
- text:this.ConfigServeur.libelle.appreciationDu + ' ' + periodeLibelle
+ xtype: 'label',
+ id: this.Constantes.composantId.lblAppreciationDu,
+ text: this.ConfigServeur.libelle.appreciationDu + ' ' + periodeLibelle
}
]
},
{
- region:'center',
- xtype:'panel',
- layout:'fit',
- border:false,
- frame:false,
+ region: 'center',
+ xtype: 'panel',
+ layout: 'fit',
+ border: false,
+ frame: false,
- items:[
+ items: [
this.appreciationTextArea
]
},
{
- region:'east',
- xtype:'panel',
- width:30,
+ region: 'east',
+ xtype: 'panel',
+ width: 30,
layout:'vbox',
- layoutConfig:{
- align:'center',
- pack:'start',
- padding:'0 0 0 10'
+ layoutConfig: {
+ align: 'center',
+ pack: 'start',
+ padding: '0 0 0 10'
},
- border:false,
- frame:false,
- items:[this.banqueAppreciationBoutonEnregistrer]
+ border: false,
+ frame: false,
+ items: [this.banqueAppreciationBoutonEnregistrer]
}
]
};
/**
* Saisie des avis
*/
- getSaisieAvisItem:function () {
+ getSaisieAvisItem: function() {
return {
- xtype:'panel',
- border:false,
- frame:false,
- labelAlign:'top',
- items:[
+ xtype: 'panel',
+ border: false,
+ frame: false,
+ labelAlign: 'top',
+ items: [
{
layout:'column',
- border:false,
- frame:false,
- bodyStyle:'padding:1px 10px 5px',
- items:[
+ border: false,
+ frame: false,
+ bodyStyle: 'padding:1px 10px 5px',
+ items: [
{
- width:330,
- layout:'form',
- border:false,
- frame:false,
- items:[
+ width: 330,
+ layout: 'form',
+ border: false,
+ frame: false,
+ items: [
this.avisType1ComboBox
]
},
{
- width:330,
- layout:'form',
- border:false,
- frame:false,
- items:[
+ width: 330,
+ layout: 'form',
+ border: false,
+ frame: false,
+ items: [
this.avisType2ComboBox
]
}
/**
* Panneau de résumé des appréciations
*/
- getAppreciationsItem:function () {
+ getAppreciationsItem: function() {
return {
- region:'center',
- xtype:'panel',
- border:false,
- frame:false,
- layout:'border',
- items:[
+ region: 'center',
+ xtype: 'panel',
+ border: false,
+ frame: false,
+ layout: 'border',
+ items: [
{
- region:'north',
- xtype:'panel',
- border:false,
- frame:false,
- layout:'fit',
- bodyStyle:'padding:1px 6px 5px',
- items:[
+ region: 'north',
+ xtype: 'panel',
+ border: false,
+ frame: false,
+ layout: 'fit',
+ bodyStyle: 'padding:1px 6px 5px',
+ items: [
{
- xtype:'label',
- text:this.ConfigServeur.libelle.recapitulatifAnnuel
+ xtype: 'label',
+ text: this.ConfigServeur.libelle.recapitulatifAnnuel
}
]
},
{
- region:'center',
- xtype:'panel',
- border:false,
- frame:false,
- layout:'fit',
- items:[
+ region: 'center',
+ xtype: 'panel',
+ border: false,
+ frame: false,
+ layout: 'fit',
+ items: [
this.appreciationGrid
]
}
/**
* Observe les modèles
*/
- observeModels:function () {
+ observeModels: function() {
this.periodeModel.addListener(
this.Constantes.eventId.periodeChange,
- function (periode) {
+ function(periode) {
var periode = this.periodeModel.getPeriode();
var periodeLibelle = '';
/**
* Observe le store de saisie
*/
- observeStoreSaisie:function () {
+ observeStoreSaisie: function() {
this.storeSaisie.addListener(
'load',
- function (store, records) {
+ function(store, records) {
if (records.length > 0) {
this.formSaisie.getForm().loadRecord(records[0]);
if (records[0].get('actif') !== false &&
(this.ConfigServeur.data.isDirection == true ||
- (this.ConfigServeur.data.isProfPrincipal == true && records[0].get('isDatePublicationBulletinDepassee') == false))) {
+ (this.ConfigServeur.data.isProfPrincipal == true &&
+ records[0].get('isDatePublicationBulletinDepassee') == false))) {
this.appreciationTextArea.enable();
this.banqueAppreciationBoutonEnregistrer.enable();
this.banqueAppreciation.enable();
* Observe le controller
* @param controller
*/
- observeController:function (controller) {
+ observeController: function(controller) {
controller.addListener(
this.Constantes.eventId.actionActualiserGraph,
- function (data, periodesPrecedentesExistent, periodes) {
- this.afficheGraph(data, periodesPrecedentesExistent, periodes);
+ function(data, dataImpressionGraph, periodesPrecedentesExistent, periodes) {
+ this.afficheGraph(data, dataImpressionGraph, periodesPrecedentesExistent, periodes);
+ },
+ this);
+
+ controller.addListener(
+ this.Constantes.eventId.actionOuvrirGraphTdnWindow,
+ function( service) {
+ var eleve = this.eleveModel.getEleve().data;
+ var periode = this.periodeModel.getPeriode().data;
+
+ if (eleve !== undefined) {
+ this.graphTdnWindow.setTitle(eleve.nom +
+ ' - ' + service.libelle +
+ ' - ' + periode.libelle);
+ this.graphTdnWindow.show();
+ }
},
this);
controller.addListener(
this.Constantes.eventId.openWindowOptionsDePublication,
- function (classe, optionsDePublication) {
+ function(classe, optionsDePublication) {
this.openWindowOptionsDePublication(classe, optionsDePublication);
},
this);
/**
* Observe la banque d'appréciation
*/
- observeBanqueAppreciation:function () {
+ observeBanqueAppreciation: function() {
this.banqueAppreciation.addListener(
this.banqueAppreciation.Constantes.eventId.actionInsereAppreciation,
- function (appreciation) {
+ function(appreciation) {
if (appreciation !== undefined) {
var value = this.appreciationTextArea.getValue();
/**
* Vérifie que la saisie est valide
*/
- isSaisieValid:function () {
+ isSaisieValid: function() {
var valide = true;
if (!this.appreciationTextArea.isValid()) valide = false;
return valide;
* @param data
* @param periodesPrecedentesExistent
*/
- afficheGraph:function (data, periodesPrecedentesExistent, periodes) {
+ afficheGraph: function(data, dataImpressionGraph, periodesPrecedentesExistent, periodes) {
this.graphPanel.removeAll(true);
+ this.graphLegendPanel.removeAll(true);
var yFields = [
{
- name:'noteMax',
- type:'column',
- libelle:this.ConfigServeur.libelle.noteMaxMoyenneClasse,
- style:{
- color:0x96ff96
+ name: 'noteMax',
+ type: 'column',
+ libelle: this.ConfigServeur.libelle.noteMaxMoyenneClasse,
+ style: {
+ color: '#96ff96',
+ colorId: 'max'
},
- round:eliot.notes.commun.Utils.getNoteRound({type:'note'})
+ round: eliot.notes.commun.Utils.getNoteRound({type: 'note'})
},
{
- name:'noteMin',
- type:'column',
- libelle:this.ConfigServeur.libelle.noteMinMoyenneClasse,
- style:{
- color:0xff8585
+ name: 'noteMin',
+ type: 'column',
+ libelle: this.ConfigServeur.libelle.noteMinMoyenneClasse,
+ style: {
+ color: '#ff8585',
+ colorId: 'min'
},
- round:eliot.notes.commun.Utils.getNoteRound({type:'note'})
+ round: eliot.notes.commun.Utils.getNoteRound({type: 'note'})
},
{
- name:'moyenneClasse',
- type:'line',
- libelle:this.ConfigServeur.libelle.moyenneClasse,
- style:{
- color:0x15428B
+ name: 'moyenneClasse',
+ type: 'line',
+ libelle: this.ConfigServeur.libelle.moyenneClasse,
+ style: {
+ color: '#15428B',
+ colorId: 'classe'
},
- round:eliot.notes.commun.Utils.noteRound
+ round: eliot.notes.commun.Utils.noteRound
}
];
- var couleurs = [0xFFE400, 0xFF7800, 0x93000B, 0x980086];
+ var couleurs = ['#FFE400', '#FF7800', '#93000B', '#980086'];
+ var colorIds = ['t1', 't2', 't3', 'annee'];
if (periodes != null) {
- for (var i = 0; i < periodes.length; i++) {
+ for(var i = 0; i < periodes.length; i++) {
var periode = periodes[i];
var yField = {
- name:periode.code,
- type:'line',
- libelle:(periode.libelle != null) ?
+ name: periode.code,
+ type: 'line',
+ libelle: (periode.libelle != null) ?
periode.libelle : this.ConfigServeur.libelle.moyenneEleve,
- style:{
- color:couleurs[i]
+ style: {
+ color: couleurs[i]
},
- round:eliot.notes.commun.Utils.noteRound
+ round: eliot.notes.commun.Utils.noteRound
};
yFields.push(yField);
}
}
+ var controller = this.config.controller;
+
// Graph
var graph = new eliot.notes.consultation.commun.graph.Composant({
- xField:{
- name:'matiere'
+
+ onClick: function(event, element, graphConfig) {
+ controller.onGraphClick(event, element, graphConfig);
},
- yFields:yFields,
- tipRenderer:function (chart, record, index, serie) {
+
+ dataFilter: function(data) {
+ if (periodes != null) {
+ var filter = false;
+
+ for(var i = 0; i < periodes.length; i++) {
+ var periode = periodes[i];
+ if (data[periode.code] != null) {
+ filter = true;
+ break;
+ }
+ }
+
+ return filter;
+ }
+
+ return true;
+ },
+
+ typeGraph: this.graph != null ? this.graph.typeGraph : undefined,
+ xField: {
+ name: 'matiere'
+ },
+ yFields: yFields,
+ tipRenderer: function(chart, record, index, serie) {
var nom = serie.yField;
var renderer = eliot.notes.commun.Utils.noteRenderer;
if ((nom == 'noteMax') || (nom == 'noteMin')) {
- renderer = eliot.notes.commun.Utils.getNoteRenderer({type:'note'});
+ renderer = eliot.notes.commun.Utils.getNoteRenderer({type: 'note'});
}
var noteFormatee = renderer(record.get(nom));
noteFormatee;
}
});
+ this.graph = graph;
- this.graphPanel.add(graph);
-
+ this.graphPanel.add(graph.getItems());
this.graphPanel.doLayout();
+ this.graphLegendPanel.add(graph.getLegendItem());
+ this.graphLegendPanel.doLayout();
+
if (periodesPrecedentesExistent === true) {
this.periodesPrecedentesCheckbox.show();
}
this.periodesPrecedentesCheckbox.hide();
}
- graph.afficheGraph(data);
+ graph.afficheGraph(data, dataImpressionGraph);
},
- refreshHtmlElements:function () {
+ refreshHtmlElements: function() {
this.addTooltips();
var task = new Ext.util.DelayedTask(
- function () {
+ function(){
this.addTooltips();
},
this);
task.delay(1);
},
- addTooltips:function () {
+ addTooltips: function() {
var elements = Ext.DomQuery.select('.annotation');
- for (var i = 0; i < elements.length; i++) {
+ for(var i = 0; i < elements.length; i++) {
var element = elements[i];
if (this.renderedTooltips[element.id] == undefined) {
this.renderedTooltips[element.id] = true;
if (annotation != null) {
new Ext.ToolTip({
- target:element.id,
- html:annotation.code + ' : ' + annotation.libelle
+ target: element.id,
+ html: annotation.code + ' : ' + annotation.libelle
});
}
}
}
},
- getOptionsButton:function () {
+ getOptionsButton: function() {
return new Ext.Button({
- xtype:'tbbutton',
- cls:'avecBordure',
- text:eliot.notes.Modele.libelle.btnOptionsDePublication,
+ xtype: 'tbbutton',
+ cls: 'avecBordure',
+ text: eliot.notes.Modele.libelle.btnOptionsDePublication,
style:'margin-top: 3px;margin-left: 25px;',
- listeners:{
- click:function () {
+ listeners: {
+ click : function() {
this.fireEvent(this.Constantes.eventId.actionAfficherOptionsDePublication);
},
- scope:this
+ scope: this
}
});
},
* @param classe
* @param optionsDePublication
*/
- openWindowOptionsDePublication:function (classe, optionsDePublication) {
+ openWindowOptionsDePublication: function(classe, optionsDePublication) {
if (this.windowOptionsDePublication === undefined) {
this.initWindowOptionsDePublication(classe);
}
this.optionsDePublication = optionsDePublication;
- if (this.optionsDePublication) {
+ if (this.optionsDePublication){
var moyenneGenerale = this.optionsDePublication.moyenneGenerale;
var coefficient = this.optionsDePublication.coefficient;
var moyenneMinMax = this.optionsDePublication.moyenneMinMax;
if (moyenneGenerale != undefined) {
this.checkBoxMoyenneGenerale.setValue(moyenneGenerale);
}
- if (coefficient != undefined) {
+ if (coefficient != undefined){
this.checkBoxCoefficient.setValue(coefficient);
}
- if (moyenneMinMax != undefined) {
+ if (moyenneMinMax != undefined){
this.checkBoxMoyennesMinMax.setValue(moyenneMinMax);
}
- if (moyennePrecedente != undefined) {
+ if (moyennePrecedente != undefined){
this.checkBoxMoyennesPrecedentes.setValue(moyennePrecedente);
}
- if (nombreNotes != undefined) {
+ if (nombreNotes != undefined){
this.checkBoxNbNotes.setValue(nombreNotes);
}
- if (rangs != undefined) {
+ if (rangs != undefined){
this.checkBoxRang.setValue(rangs);
}
}
/**
* Crée la popup Options De Publication
*/
- initWindowOptionsDePublication:function (classe) {
+ initWindowOptionsDePublication: function(classe) {
this.checkBoxMoyenneGenerale = new Ext.form.Checkbox({
- boxLabel:'<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyenneGenerale + '</span>',
- checked:true
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyenneGenerale + '</span>',
+ checked: true
});
this.checkBoxCoefficient = new Ext.form.Checkbox({
- boxLabel:'<span style="font-weight:normal;">' + this.ConfigServeur.libelle.coefficient + '</span>',
- checked:true
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.coefficient + '</span>',
+ checked: true
});
this.checkBoxMoyennesMinMax = new Ext.form.Checkbox({
- boxLabel:'<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyennesMinMax + '</span>',
- checked:true
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyennesMinMax + '</span>',
+ checked: true
});
this.checkBoxMoyennesPrecedentes = new Ext.form.Checkbox({
- boxLabel:'<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyennesPrecedentes + '</span>',
- checked:false
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.moyennesPrecedentes + '</span>',
+ checked: false
});
this.checkBoxNbNotes = new Ext.form.Checkbox({
- boxLabel:'<span style="font-weight:normal;">' + this.ConfigServeur.libelle.nbNotes + '</span>',
- checked:false
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.nbNotes + '</span>',
+ checked: false
});
this.checkBoxRang = new Ext.form.Checkbox({
- boxLabel:'<span style="font-weight:normal;">' + this.ConfigServeur.libelle.rangSurNbEleves + '</span>',
- checked:false
+ boxLabel: '<span style="font-weight:normal;">' + this.ConfigServeur.libelle.rangSurNbEleves + '</span>',
+ checked: false
});
this.buttonOk = new Ext.Button({
- text:this.ConfigServeur.libelle.ok,
- handler:function () {
+ text: this.ConfigServeur.libelle.ok,
+ handler: function() {
this.optionsDePublication.moyenneGenerale = this.checkBoxMoyenneGenerale.getValue();
this.optionsDePublication.coefficient = this.checkBoxCoefficient.getValue();
this.optionsDePublication.moyenneMinMax = this.checkBoxMoyennesMinMax.getValue();
this.windowOptionsDePublication.hide();
},
- scope:this
+ scope: this
});
this.windowOptionsDePublication = new Ext.Window({
- title:this.ConfigServeur.libelle.optionsDePublication,
+ title: this.ConfigServeur.libelle.optionsDePublication,
layout:'fit',
width:350,
height:250,
closeAction:'hide',
- resizable:false,
- plain:true,
+ resizable: false,
+ plain: true,
- items:[
+ items: [
{
- xtype:'fieldset',
- border:false,
- autoHeight:true,
- defaults:{
- width:200
+ xtype: 'fieldset',
+ border: false,
+ autoHeight: true,
+ defaults: {
+ width: 200
},
- items:[
+ items: [
{
- xtype:'label',
- html:this.ConfigServeur.libelle.bulletinOptionsChoixConseil + '<div style="margin: 0 0 5px 0"/>'
+ xtype: 'label',
+ html: this.ConfigServeur.libelle.selOptionsDePublicationConseil+'<div style="margin: 0 0 5px 0"/>'
},
{
- xtype:'checkboxgroup',
- columns:1,
- labelWidth:30,
- hideLabel:true,
- items:[
+ xtype: 'checkboxgroup',
+ columns: 1,
+ labelWidth: 30,
+ hideLabel: true,
+ items: [
this.checkBoxMoyenneGenerale,
this.checkBoxCoefficient,
this.checkBoxMoyennesMinMax,
}
],
- buttons:[this.buttonOk,
+ buttons: [
+ this.buttonOk,
{
- text:this.ConfigServeur.libelle.annuler,
- handler:function () {
+ text: this.ConfigServeur.libelle.annuler,
+ handler: function() {
this.windowOptionsDePublication.hide();
},
- scope:this
- }]
+ scope: this
+ }
+ ]
});
}