--- /dev/null
+/*
+Copyright (c) Igor Barma, Alexandre Desoubeaux, Christian Martel, Eric Brun, Mathieu Amblard, Gwenael Gevet, Pierre Guillot, 2012
+ * Copyright Alexandre Desoubeaux, Christian Martel, Cedric Lecarpentier, Alexandre Lefevre, Marc Salvat 2014-2016
+ * Copyright Alexandre Desoubeaux, Christian Martel, Cedric Lecarpentier, Marc Salvat, Marc Suarez, Harifetra Ramamonjy 2017
+For licensing, see README.txt or http://www.pentilanero.com (Cecill-C or AGPL or LGPL)
+*/
+Ext.ns("EntSavoie.Actualites");
+EntSavoie.Actualites.ActualitesView = function (config) {
+ Ext.apply(this, config);
+
+ //On hide le context menu du navigateur
+ Ext.getBody().on("contextmenu", Ext.emptyFn, null, {preventDefault: true});
+
+ //la fenetre de delgation des actualités
+ this.configDelegateWindow = this.configDelegateWindow || new EntSavoie.Actualites.configDelegateWindow({
+ actionURLAjax: this.actionURLAjax,
+ renderURLAjax: this.renderURLAjax,
+ mainContainer: this,
+ hasDirectoryRights : this.hasDirectoryRights
+ });
+
+ // Calcul des variables pour l affichage
+ // Seul l'administrateur ou les utilisateurs délégués peuvent ajouter des actus dans le groupe Racine
+ this.isRootOrg = this.isRootOrg || false;
+ //Add group news : the teachers and delegates can add news for every groups without being admin.
+ this.showAddBtn = this.isAdmin || this.isDelegate || (!this.isRootOrg && (this.isTeacher || this.isGrpAdmin || this.isHeadMaster));
+ this.showAddBtnHM = this.isDelegateHM || (!this.isRootOrg && (this.isHeadMaster || this.isGrpAdmin));
+ this.showConfigBtnHM = /*this.isDelegateHM || */(!this.isRootOrg && (this.isGrpAdmin || this.isHeadMaster));
+ this.coordAttachMenu = this.coordAttachMenu || [0, 0];
+ this.attachmentRecord = this.attachmentRecord || null;
+
+ this.readyForUpdate = false;
+
+ // Stores
+ this.groupesActuStore = this.groupesActuStore || new Ext.data.JsonStore({
+ root: 'actualite',
+ idProperty: 'blogEntryInfosId',
+ totalProperty:'total',
+ baseParams: {limit: this.pagingLimitHM, isAdmin: this.isGrpAdmin},
+ fields: ['blogEntryInfosId','content','date','dateSort',{name:'author', sortType:Ext.data.SortTypes.asUCString},{name:'title', sortType:Ext.data.SortTypes.asUCString}, 'grpName',{name:"isPrio", type:"boolean"},{name:"isAuthor", type:"boolean"},{name:"hideControl", type:"boolean"}, 'imageId', 'unActive', 'urlThumb', 'height', 'width','urlLarge', 'largeHeight', 'largeWidth', 'attachements', 'flashFile', 'flashFileExtension', 'intranetNews'],
+ proxy: new Ext.data.HttpProxy({
+ url: this.renderURLAjax+'&jspPage=%2Fajax%2FlistActualites.jsp'
+ })
+ });
+
+ this.headMasterActuStore = this.headMasterActuStore || new Ext.data.JsonStore({
+ root: 'actualiteHM',
+ idProperty: 'blogEntryInfosId',
+ totalProperty:'totalHM',
+ baseParams: {limit: this.pagingLimitHM, isAdmin: this.isGrpAdmin},
+ fields: ['blogEntryInfosId','content','date','dateSort',{name:'author', sortType:Ext.data.SortTypes.asUCString},{name:'title', sortType:Ext.data.SortTypes.asUCString}, 'grpName',{name:"isPrio", type:"boolean"},{name:"isAuthor", type:"boolean"},{name:"hideControl", type:"boolean"},{name:"isHighPrio", type:"boolean"}, 'imageId', 'unActive', 'urlThumb', 'height', 'width','urlLarge', 'largeHeight', 'largeWidth', 'attachements', 'flashFile', 'flashFileExtension', 'intranetNews'],
+ proxy: new Ext.data.HttpProxy({
+ url: this.renderURLAjax+'&jspPage=%2Fajax%2FlistActualitesHeadMaster.jsp'
+ })
+ });
+
+ // stock le record sur lequel on fait un rowAction
+ this.recordRowAction = null;
+ // stock le grid sur lequel on fait un rowAction
+ this.gridRowAction = null;
+
+ this.action_column = this.action_column || new Ext.grid.ActionColumn({
+ width: 75,
+ sortable: false,
+ menuDisabled: true,
+ align: 'right',
+ items: [
+ {
+ iconCls: 'addToFavoriteCls',
+ tooltip: this.i18n.Actualites.ActualitesView.action_column.favorite.tooltip,
+ scope: this,
+ handler: this.onAddShortCutAction
+ },
+ {
+ getClass: function(v, meta, rec, row, col, store) { // Or return a class from a function
+ if (rec.get('hideControl') == false) {
+ return 'edit';
+ }
+ },
+ tooltip: this.i18n.Actualites.ActualitesView.action_column.edit.tooltip,
+ scope: this,
+ handler: this.onEditAction
+ },
+ {
+ getClass: function(v, meta, rec, row, col, store) { // Or return a class from a function
+ if (rec.get('hideControl') == false) {
+ return 'delete';
+ }
+ },
+ tooltip: this.i18n.Actualites.ActualitesView.action_column.del.tooltip,
+ scope: this,
+ handler: this.onDeleteAction
+ }
+ ]
+ });
+
+ // Menu clic droit
+ this.attachClicMenu = this.attachClicMenu || new Ext.menu.Menu({
+ cls: 'actualite-portlet',
+ items: [
+ {
+ text: "Accéder au lien",
+ handler: this.onGoToLink,
+ iconCls: 'goToLink',
+ scope: this
+ },
+ {
+ text: this.i18n.Actualites.ActualitesView.attachClicMenu.view,
+ handler: this.onViewerAction,
+ iconCls: 'viewer',
+ scope: this
+ },
+ {
+ text: this.i18n.Actualites.ActualitesView.attachClicMenu.send,
+ handler: this.onSend,
+ iconCls: 'send',
+ scope: this
+ },
+ {
+ text: this.i18n.Actualites.ActualitesView.attachClicMenu.download,
+ handler: this.onDownloadAction,
+ iconCls: 'download',
+ scope: this
+ }
+ ]
+ });
+
+ this.addActuHMBtn = this.addActuHMBtn || new Ext.Button({
+ tooltip: this.i18n.Actualites.ActualitesView.addActuHMBtn.tooltip,
+ iconCls: 'addBtn',
+ text: this.i18n.Actualites.ActualitesView.addActuHMBtn.text,
+ handler: this.onAddActuHM,
+ scope: this,
+ hidden: !this.showAddBtnHM
+ });
+
+ this.addActuBtn = this.addActuBtn || new Ext.Button({
+ tooltip: this.i18n.Actualites.ActualitesView.addActuBtn.tooltip,
+ iconCls: 'addBtn',
+ text: this.i18n.Actualites.ActualitesView.addActuBtn.text,
+ handler: this.onAddActu,
+ scope: this,
+ hidden: !this.showAddBtn
+ });
+
+ this.configActuHMBtn = this.configActuHMBtn || new Ext.Button({
+ tooltip: this.i18n.Actualites.ActualitesView.configActuHMBtn.tooltip,
+ iconCls: 'delegate-configuration',
+ text: this.i18n.Actualites.ActualitesView.configActuHMBtn.text,
+ handler: this.onConfigActuHM,
+ scope: this,
+ hidden: !this.showConfigBtnHM
+ });
+
+ //Grid
+ this.pagingLimitGrp = 10;
+ this.groupesActuGridBbar = this.groupesActuGridBbar || new Ext.PagingToolbar({
+ pageSize: this.pagingLimitGrp,
+ store: this.groupesActuStore,
+ displayInfo: true,
+ cls : "actuGrpToolBar",
+ displayMsg: this.i18n.Actualites.ActualitesView.groupesActuGridBbar.displayMsg
+ });
+
+ this.valueSortingComboBox = this.valueSortingComboBox || new Ext.form.ComboBox({
+ store: [this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[0], this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[1],
+ this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[2], this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[3]],
+ editable:false,
+ value: this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[0],
+ triggerAction: 'all',
+ width:60,
+ forceSelection:true
+ });
+
+ this.sortingComboBox = this.sortingComboBox || new Ext.form.ComboBox({
+ store: [this.i18n.Actualites.ActualitesView.sortingComboBox.value[0], this.i18n.Actualites.ActualitesView.sortingComboBox.value[1]],
+ editable:false,
+ value: this.i18n.Actualites.ActualitesView.sortingComboBox.value[1],
+ triggerAction: 'all',
+ width:40,
+ forceSelection:true
+ });
+
+ this.titleTxt = this.titleTxt || new Ext.form.DisplayField({
+ cls: 'gridHeader',
+ value :this.isWelcomePage?this.i18n.Actualites.ActualitesView.titleTxt.value[0]:this.i18n.Actualites.ActualitesView.titleTxt.value[1]
+ });
+
+ this.attachementsLinkTplHighPrio = new Ext.XTemplate('<div style="color:#6E7D8F;"><u style="text-transform: none !important;">' + this.i18n.Actualites.ActualitesView.attachementsLinkTplHighPrio.attachment + '</u></div> {attachements}');
+ this.attachementsLinkTplHighPrio.compile();
+
+ this.attachementsLinkTpl = new Ext.XTemplate('<div> {attachements} </div>');
+ this.attachementsLinkTpl.compile();
+
+ this.attachementsTpl = new Ext.XTemplate('{fileHref} ({fileInfo}kb) ');
+ this.attachementsTpl.compile();
+
+ this.groupesActuGrid = this.groupesActuGrid || new Ext.grid.GridPanel({
+ store : this.groupesActuStore,
+ baseCls : "actuGrpGrid",
+ autoExpandColumn: 'title',
+ hideHeaders: true,
+ disableSelection: true,
+ columns: [
+ {header: this.i18n.Actualites.ActualitesView.groupesActuGrid.columns.date.header, width: 120, dataIndex: 'date', renderer: this.formatDate, sortable: false},
+ {header: this.i18n.Actualites.ActualitesView.groupesActuGrid.columns.title.header, width: 100, dataIndex: 'title', id : 'title', renderer: this.formatTitle, sortable: false, scope:this},
+ this.action_column
+ ],
+ tbar: [this.titleTxt,'->', this.addActuBtn],
+ bbar: [this.groupesActuGridBbar,'->', this.valueSortingComboBox, this.sortingComboBox]
+ });
+
+
+ this.pagingLimitHM = 10;
+ this.headMasterActuGridBbar = this.headMasterActuGridBbar || new Ext.PagingToolbar({
+ pageSize: this.pagingLimitHM,
+ store: this.headMasterActuStore,
+ displayInfo: true,
+ cls : "actuGrpToolBar",
+ displayMsg: this.i18n.Actualites.ActualitesView.headMasterActuGridBbar.displayMsg
+ });
+
+ this.valueSortingComboBoxHM = this.valueSortingComboBoxHM || new Ext.form.ComboBox({
+ store: [this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[0], this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[1],
+ this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[2], this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[3]],
+ editable:false,
+ value: this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[0],
+ triggerAction: 'all',
+ width:60,
+ forceSelection:true
+ });
+
+ this.sortingComboBoxHM = this.sortingComboBoxHM || new Ext.form.ComboBox({
+ store: [this.i18n.Actualites.ActualitesView.sortingComboBoxHM.value[0], this.i18n.Actualites.ActualitesView.sortingComboBoxHM.value[1]],
+ editable:false,
+ value: this.i18n.Actualites.ActualitesView.sortingComboBoxHM.value[1],
+ triggerAction: 'all',
+ width:40,
+ forceSelection:true
+ });
+
+ this.titleTxtHM = this.titleTxtHM || new Ext.form.DisplayField({
+ cls: 'gridHeader',
+ value : this.i18n.Actualites.ActualitesView.titleTxtHM.value
+ });
+
+ this.headMasterActuGrid = this.headMasterActuGrid || new Ext.grid.GridPanel({
+ store : this.headMasterActuStore,
+ autoExpandColumn: 'title',
+ baseCls : "actuHMGrid",
+ hideHeaders: true,
+ disableSelection: true,
+ columns: [ {header: this.i18n.Actualites.ActualitesView.headMasterActuGrid.columns.date.header, width: 120, dataIndex: 'date', renderer: this.formatDate, sortable: false},
+ {header: this.i18n.Actualites.ActualitesView.headMasterActuGrid.columns.title.header, width: 100, dataIndex: 'title', id : 'title', renderer: this.formatTitleHM, sortable: false, scope:this},
+ this.action_column
+ ],
+ tbar: [ this.titleTxtHM,'->',this.configActuHMBtn,this.addActuHMBtn],
+ bbar: [this.headMasterActuGridBbar,'->', this.valueSortingComboBoxHM, this.sortingComboBoxHM]
+ });
+
+
+ this.searchFieldValue = "";
+ this.searchField = this.searchField || new Ext.form.TextField({
+ name: "rechercheTxt",
+ emptyText: this.i18n.Actualites.ActualitesView.searchField.emptyText,
+ width: 150,
+ style: "padding:0px 10px 0px 0px;"
+ });
+
+ this.groupStore = this.groupStore || new Ext.data.JsonStore({
+ root: 'grps',
+ idProperty: 'grpId',
+ fields: ['grpId', 'grpName'],
+ url: this.renderURLAjax+'&jspPage=%2Fajax%2FlistMyGroups.jsp'
+ });
+
+ this.groupComboBoxValue = "";
+ this.groupComboBox = this.groupComboBox || new Ext.form.ComboBox({
+ listClass: "actualites-portlet",
+ name: "group",
+ emptyText: this.isWelcomePage? this.i18n.Actualites.ActualitesView.groupComboBox.emptyText[0]: this.i18n.Actualites.ActualitesView.groupComboBox.emptyText[1],
+ valueField: 'grpId',
+ displayField: 'grpName',
+ width: 150,
+ minListWidth: 250,
+ allowBlank: true,
+ editable: false,
+ store: this.groupStore,
+ triggerAction: "all",
+ mode: 'remote',
+ style: "padding:0px 10px 0px 0px;",
+ disabled: !this.isWelcomePage,
+ hidden: !this.showExtendedFilters
+ });
+
+ this.typeComboBoxValue = "";
+ this.typeComboBox = this.typeComboBox || new Ext.form.ComboBox({
+ listClass: "actualites-portlet",
+ typeAhead: true,
+ triggerAction: 'all',
+ emptyText: this.i18n.Actualites.ActualitesView.typeComboBox.emptyText,
+ width: 150,
+ style: "padding:0px 10px 0px 0px;",
+ lazyRender: true,
+ mode: 'local',
+ store: new Ext.data.ArrayStore({
+ id: 0,
+ fields: [
+ 'typeId',
+ 'displayText'
+ ],
+ data: [
+ [0, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[0]],
+ [-1, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[1]],
+ [1, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[2]],
+ [2, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[3]],
+ [3, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[4]],
+ [4, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[5]],
+ [5, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[6]],
+ [6, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[7]],
+ [7, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[8]],
+ [8, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[9]],
+ [9, this.i18n.Actualites.ActualitesView.typeComboBox.store.data[10]]
+ ]
+ }),
+ valueField: 'typeId',
+ displayField: 'displayText',
+ hidden: !this.showExtendedFilters
+ });
+
+
+ this.backButton = this.backButton || new Ext.Button({
+ tooltip: this.i18n.Actualites.ActualitesView.backButton.tooltip,
+ cls: "backButtonCls",
+ text: " ",
+ handler: this.backFromSearch,
+ scope: this
+ });
+
+ this.onlyMyActusCB = this.onlyMyActusCB || new Ext.form.Checkbox({
+ boxLabel: this.i18n.Actualites.ActualitesView.onlyMyActusCB.boxLabel,
+ checked: false,
+ name: "onlyMyActusCB"
+ });
+
+ //research btn
+ this.searchBtn = this.searchBtn || new Ext.Button ({
+ tooltip: this.i18n.Actualites.ActualitesView.searchBtn.tooltip,
+ cls: "searchButtonCls",
+ text: " ",
+ handler: this.onSearch,
+ scope: this
+ });
+
+ this.createActuView = this.createActuView || new EntSavoie.Actualites.CreateActualites({
+ actualites:this,
+ actionURLAjax:this.actionURLAjax,
+ renderURLAjax: this.renderURLAjax,
+ isHeadMaster: this.isHeadMaster,
+ isAdmin: this.isGrpAdmin,
+ isWelcomePage: this.isWelcomePage,
+ isGroupIntra: this.isGroupIntra,
+ groupId: this.groupId,
+ language: this.language
+ });
+
+ this.rechercheTxt = this.rechercheTxt || new Ext.form.DisplayField({
+ cls: 'searchText',
+ //value : "Rechercher une actualité: "
+ value : this.i18n.Actualites.ActualitesView.rechercheTxt.value
+ });
+
+ this.addToFavoritesWindow = this.addToFavoritesWindow || new EntSavoie.AddShortCutWindow({
+ actionURLAjax:this.actionURLAjax,
+ renderURLAjax: this.renderURLAjax
+ });
+
+ //constructor
+ EntSavoie.Actualites.ActualitesView.superclass.constructor.call(this, {
+ border: false,
+ layout: 'border',
+ height: EntSavoie.FullScreen.fired()?EntSavoie.FullScreen.getContainerHeight():Global.Portlet.height,
+ width: "auto",
+ monitorResize: true,
+ items:[
+ {
+ border: false,
+ layout: 'table',
+ layoutConfig: {
+ columns: 2,
+ fitToParent: true
+ },
+ region:'center',
+ items: [
+ {
+ border: false,
+ xtype: "panel",
+ layout: 'fit',
+ style: 'padding-right: 15px;',
+ height: 'auto',
+ items: [this.groupesActuGrid]
+ },
+ {
+ border: false,
+ xtype: "panel",
+ layout: 'fit',
+ style: 'padding-right: 15px;',
+ height: 'auto',
+ items: [this.headMasterActuGrid]
+ }
+ ]
+ }/*,
+ {
+ border: false,
+ xtype: "panel",
+ region: "south",
+ padding: "10px",
+ layout: {
+ type: 'hbox',
+ align: 'top'
+ },
+ height: 50,
+ items: [this.rechercheTxt,
+ this.searchField,
+ {html: " ",
+ border: false},
+ this.groupComboBox,
+ {html: " ",
+ border: false},
+ this.typeComboBox,
+ {html: " ",
+ border: false},
+ //this.typeRadioGrp,
+ this.onlyMyActusCB,
+ {html: " ",
+ border: false},
+ this.searchBtn,
+ {html: " ",
+ border: false},
+ this.backButton
+ ]
+ }*/
+ ]
+ });
+
+ this.groupesActuStore.proxy.on("beforeload", this.onBeforeloadGroupesActuStoreProxy, this);
+ this.headMasterActuStore.proxy.on("beforeload", this.onBeforeloadHeadMasterActuStoreStoreProxy, this);
+ this.groupesActuStore.on("load", this.onLoadGroupesActuStore, this);
+ this.headMasterActuStore.on("load", this.onLoadHeadMasterActuStoreStore, this);
+
+ // definition des listeners
+ this.groupesActuGrid.on("viewready", this.onViewreadyGroupesActuGrid, this);
+ this.headMasterActuGrid.on("viewready", this.onViewreadyHeadMasterActuGrid, this);
+ //this.headMasterActuGridBbar.on("beforechange", this.onBeforechangeHeadMasterActuGrid, this);
+
+ // le form de recherche
+ this.searchField.on("specialkey", this.onSpecialKey, this);
+ this.groupComboBox.on("render", this.onRenderGroupComboBox, this);
+
+ //this.groupesActuGridBbar.on("change", this.onChangeGroupPagingToolBar, this);
+ //this.headMasterActuGridBbar.on("change", this.onChangeHeadPagingToolBar, this);
+
+ this.valueSortingComboBox.on("select", this.onGroupeSortChange, this);
+ this.sortingComboBox.on("select", this.onGroupeSortChange, this);
+ this.valueSortingComboBoxHM.on("select", this.onHMSortChange, this);
+ this.sortingComboBoxHM.on("select", this.onHMSortChange, this);
+
+
+};
+
+Ext.extend(EntSavoie.Actualites.ActualitesView, Ext.Panel, {
+ initComponent: function () {
+ EntSavoie.Actualites.ActualitesView.superclass.initComponent.call(this);
+ },
+
+ onBeforeloadGroupesActuStoreProxy: function(proxy, params){
+ var gridActu = Ext.getCmp(this.groupesActuGrid.id);
+ if (gridActu){
+ gridActu.getEl().mask(this.i18n.Actualites.ActualitesView.mask, 'x-mask-loading');
+ }
+ params.entryId = this.entryId;
+ params.isAdmin = this.isGrpAdmin;
+ this.initializeSearchFields(params);
+ },
+
+ onBeforeloadHeadMasterActuStoreStoreProxy: function(proxy, params){
+ var gridActu = Ext.getCmp(this.headMasterActuGrid.id);
+ if (gridActu){
+ gridActu.getEl().mask(this.i18n.Actualites.ActualitesView.mask, 'x-mask-loading');
+ }
+ params.isAdmin = this.isGrpAdmin;
+ if (this.searchFieldValue!="") {
+ params.search = true;
+ } else {
+ params.search = false;
+ }
+ params.entryId = this.entryId;
+ this.initializeSearchFields(params);
+ },
+
+ initializeSearchFields: function(params){
+ if (this.searchFieldValue != this.searchField.getValue()) {
+ this.searchFieldValue = this.searchField.getValue();
+ }
+ if (this.searchFieldValue != "") {
+ params.recherche = this.searchFieldValue;
+ }
+ if (this.groupComboBoxValue != this.groupComboBox.getValue()) {
+ this.groupComboBoxValue = this.groupComboBox.getValue();
+ }
+ if (this.groupComboBoxValue != "") {
+ params.rechercheGrp = this.groupComboBoxValue;
+ }
+ if (this.typeComboBoxValue != this.typeComboBox.getValue()) {
+ this.typeComboBoxValue = this.typeComboBox.getValue();
+ }
+ if (this.typeComboBoxValue != "") {
+ params.rechercheCateg = this.typeComboBoxValue;
+ }
+ params.onlyMyActus = this.onlyMyActusCB.getValue();
+ params.isWelcomePage = this.isWelcomePage;
+ },
+
+ onLoadGroupesActuStore: function(store, records, e){
+ var gridActu = Ext.getCmp(this.groupesActuGrid.id);
+ if (gridActu){
+ gridActu.getEl().unmask();
+ }
+ },
+
+ onLoadHeadMasterActuStoreStore: function(store, records, e){
+ var gridActu = Ext.getCmp(this.headMasterActuGrid.id);
+ if (gridActu){
+ gridActu.getEl().unmask();
+ }
+ },
+
+ /**
+ * Pieces jointes
+ */
+ formatAttachements: function(attachementFiles) {
+ var result = "";
+ var fileArray = Ext.decode(attachementFiles);
+ /*if (fileArray.length>0) {
+ result += "<br /> <b> Pièces jointes : </b>";
+ }*/
+ for (var i=0; i<fileArray.length; i++) {
+ var file = fileArray[i];
+ result += this.attachementsTpl.apply({
+ fileHref: file.fileHref,
+ fileInfo: file.fileInfo
+ });
+ }
+ return result;
+ },
+
+ onResetSearch: function(){
+ //le champs text
+ this.searchFieldValue = "";
+ this.searchField.suspendEvents(false);
+ this.searchField.reset();
+ this.searchField.resumeEvents();
+
+ //le combo
+ this.groupComboBoxValue = "";
+ this.whichComboBoxValue = "3";
+ this.groupComboBox.suspendEvents(false);
+ this.groupComboBox.reset();
+ this.groupComboBox.resumeEvents();
+ if(!this.isWelcomePage){
+ this.groupComboBox.disable();
+ }
+
+ this.typeComboBoxValue = "";
+ this.typeComboBox.suspendEvents(false);
+ this.typeComboBox.reset();
+ this.typeComboBox.resumeEvents();
+
+ //les radios
+ //this.typeRadioGrp.reset();
+
+ },
+
+ backFromSearch: function(){
+ this.onResetSearch();
+ this.forceRefresh();
+ },
+
+ onRenderGroupComboBox: function(comboBox){
+
+ //this.groupStore.load();
+ },
+
+ onViewreadyGroupesActuGrid: function(grid) {
+ //this.groupesActuStore.load();
+ // on utilise les initialData
+ //this.showActuData(Ext.decode(this.initialData));
+ if (this.readyForUpdate) {
+ this.loadOnCallActus(true);
+ }
+ else {
+ this.readyForUpdate = true;
+ }
+ },
+
+ onViewreadyHeadMasterActuGrid: function(grid) {
+ if (this.readyForUpdate) {
+ this.loadOnCallActus(true);
+ } else {
+ this.readyForUpdate = true;
+ }
+ },
+
+ onBeforechangeHeadMasterActuGrid: function(bbar, params){
+ //this.headMasterActuStore.setBaseParam('HP', this.flagHighPrio);
+ },
+
+
+ displayHighPriority: function(){
+ Ext.Ajax.request({
+ url: this.actionURLAjax,
+ params: {
+ cmd: "getActuHighPrio"
+ },
+ scope: this,
+ success: this.onSuccessDisplayHP,
+ failure: this.onFailureDisplayHP
+ });
+ },
+
+ onSuccessDisplayHP:function(response, options) {
+ var backObj = Ext.decode(response.responseText);
+ if (!backObj.success) {
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onSuccessDisplayHP.alert.title, this.i18n.Actualites.ActualitesView.onSuccessDisplayHP.alert.msg, function(btn){});
+ }else{
+ if(backObj.infos.creaDate==null){
+ //ne rien faire
+ }else{
+ //afficher l'actu importante
+ var actuInfos = backObj.infos;
+ this.showHighPrioWindow(actuInfos);
+ }
+ }
+ },
+
+ showHighPrioWindow: function(actuInfos) {
+ var window = new Ext.Window({
+ cls: 'actualite-portlet',
+ modal: true,
+ height: 600,
+ width: this.getBrowserWindowWidth() - 80,
+ y: 50,
+ x: 50,
+ layout: 'fit',
+ closable: true,
+ autoScroll: false,
+ title: this.i18n.Actualites.ActualitesView.onSuccessDisplayHP.window.title + actuInfos.title,
+ tools: [
+ {
+ id: 'restore',
+ hidden: true,
+ handler: function(event, toolEl, panel, tc){
+ window.setPosition(window.oldPosition[0], window.oldPosition[1]);
+ window.setHeight(window.oldHeight);
+ window.setWidth(window.oldWidth);
+ window.tools['maximize'].show();
+ toolEl.hide();
+ }
+ },
+ {
+ id: 'maximize',
+ handler: function(event, toolEl, panel, tc){
+ window.oldWidth = window.getWidth();
+ window.oldHeight = window.getHeight();
+ window.oldPosition = window.getPosition();
+ window.setPosition(0, 0);
+ var mainActuCmp = Ext.getCmp(this.id);
+ window.setHeight(mainActuCmp.getBrowserWindowHeight());
+ window.setWidth(mainActuCmp.getBrowserWindowWidth());
+ window.tools['restore'].show();
+ toolEl.hide();
+ }
+ }
+ ],
+ items: {
+ autoScroll: true,
+ border: false,
+ html: this.formatActualiteAsHTML(actuInfos)
+ },
+ buttons:[{
+ text: this.i18n.Actualites.ActualitesView.onSuccessDisplayHP.window.buttons.text,
+ handler: function() {window.close();this.displayHighPriority();},
+ scope: this
+ }]
+ });
+ window.show();
+ },
+
+ onFailureDisplayHP:function(response, options) {
+ this.gridRowAction.getStore().add([this.recordRowAction]);
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onFailureDisplayHP.alert.title, this.i18n.Actualites.ActualitesView.onFailureDisplayHP.alert.msg, function(btn){});
+ },
+
+
+ forceRefresh: function(){
+ //this.flagHighPrio = false;
+ this.loadOnCallActus(false);
+ //this.groupesActuStore.load();
+ //this.headMasterActuStore.load();
+ },
+
+ //Renders for rows
+ formatDate: function(value, p, record) {
+ if (record.data.imageId!=0){
+ var imgTag = '<img border="no" src="'+record.data.urlThumb+'" style="margin-top:3px; max-height: '+100+'px; max-width: '+100+'px;" />';
+
+ return String.format(
+ '<span class="dateHeure">{0}</span><br/><span class="author">{1}</span><br/>{3}',
+ value, record.data.author,record.data.grpName,imgTag,record.idProperty);
+ }else{
+ return String.format(
+ '<span class="dateHeure">{0}</span><br/><span class="author">{1}</span><br/>',
+ value, record.data.author,record.data.grpName,record.idProperty);
+ }
+ },
+
+ formatTitleHM: function(value, p, record) {
+ //var xf = Ext.util.Format;
+ //var resume = xf.ellipsis(xf.stripTags(record.data.content), 250);
+ var resume = record.data.content;
+ var actuId = record.data.blogEntryInfosId;
+ var HP = record.data.isHighPrio;
+ var hideControl= record.data.hideControl;
+ var attachementsString = this.formatAttachements(record.data.attachements);
+ var attachLink = this.attachementsLinkTpl.apply({attachements: attachementsString});
+ var unactive = record.data.unActive;
+
+ if(!unactive){
+ return String.format(
+ '<div class="topic-HP'+HP+'"><b class="title-HP'+HP+'">{0}</b>'+
+ '<p>'+ resume + ' <a class="readAll" onClick="new EntSavoie.Actualites.ActualiteViewer({actuId:'+actuId+
+ ', isHeadMaster:'+this.isHeadMaster+',isAdmin:'+this.isGrpAdmin+',hideControl:'+hideControl+',isActuHM:'+true+
+ ', actionURLAjax:\''+this.actionURLAjax+'\', mainActualitesViewId:\''+this.id+'\'});">' + this.i18n.Actualites.ActualitesView.formatTitleHM.displayAll + '</a><br />' + attachLink + '</p></div>',
+ value, record.idProperty);
+ } else {
+ return String.format(
+ '<div class="topic-HP'+HP+'"><b class="title-HP'+HP+'">{0}</b>' +
+ '<p>'+ resume + ' <a class="readAll" onClick="new EntSavoie.Actualites.ActualiteViewer({actuId:'+actuId+
+ ', isHeadMaster:'+this.isHeadMaster+',isAdmin:'+this.isGrpAdmin+',hideControl:'+hideControl+',isActuHM:'+true+
+ ', actionURLAjax:\''+this.actionURLAjax+'\', mainActualitesViewId:\''+this.id+'\'});">' + this.i18n.Actualites.ActualitesView.formatTitleHM.displayAll + '</a><br /><b style="color:red;">' + this.i18n.Actualites.ActualitesView.formatTitleHM.unactive + '</b> <br />' + attachLink + '</p></div>',
+ value, record.idProperty);
+ }
+ },
+
+ formatTitle: function(value, p, record) {
+ //var xf = Ext.util.Format;
+ //var resume = xf.ellipsis(xf.stripTags(record.data.content), 250);
+ var resume = record.data.content;
+ var actuId = record.data.blogEntryInfosId;
+ var hideControl= record.data.hideControl;
+ var attachementsString = this.formatAttachements(record.data.attachements);
+ var attachLink = this.attachementsLinkTpl.apply({attachements: attachementsString});
+ var unactive = record.data.unActive;
+
+ if(!unactive){
+ return String.format(
+ '<div class="topic"><b style="font-size:12px; margin-bottom: 4px;">{0}</b>' +
+ '<p>'+ resume + ' <a class="readAll" onClick="new EntSavoie.Actualites.ActualiteViewer({actuId:'+actuId+
+ ', isHeadMaster:'+this.isHeadMaster+',isAdmin:'+this.isGrpAdmin+',hideControl:'+hideControl+',isActuHM:'+false+
+ ',actionURLAjax:\''+this.actionURLAjax+'\', mainActualitesViewId:\''+this.id+'\'});">' + this.i18n.Actualites.ActualitesView.formatTitle.displayAll + '</a><br />' + attachLink + '</p></div>',
+ value, record.idProperty);
+ } else {
+ return String.format(
+ '<div class="topic"><b style="font-size:12px; margin-bottom: 4px;">{0}</b>' +
+ '<p>'+ resume + ' <a class="readAll" onClick="new EntSavoie.Actualites.ActualiteViewer({actuId:'+actuId+
+ ', isHeadMaster:'+this.isHeadMaster+',isAdmin:'+this.isGrpAdmin+',hideControl:'+hideControl+',isActuHM:'+false+
+ ',actionURLAjax:\''+this.actionURLAjax+'\', mainActualitesViewId:\''+this.id+'\'});">' + this.i18n.Actualites.ActualitesView.formatTitle.displayAll + '</a><br /><b style="color:red;">' + this.i18n.Actualites.ActualitesView.formatTitle.unactive + '</b><br />' + attachLink + '</p></div>',
+ value, record.idProperty);
+ }
+ },
+
+
+ onEditAction: function(grid, rowIndex, colIndex) {
+ var record = grid.getStore().getAt(rowIndex);
+ this.recordRowAction = record;
+ this.gridRowAction = grid;
+ this.createActuView.editActualite(record.get("blogEntryInfosId"), (grid.getId()==this.headMasterActuGrid.id));
+ },
+
+ onDeleteAction: function(grid, rowIndex, colIndex) {
+ this.recordRowAction = grid.getStore().getAt(rowIndex);
+ this.gridRowAction = grid;
+ Ext.MessageBox.show({
+ cls: "actualites-onDeleteAction_deleteMsgBox",
+ icon:Ext.Msg.QUESTION,
+ title: this.i18n.Actualites.ActualitesView.onDeleteAction.messageBox.title,
+ msg: this.recordRowAction.get("isAuthor")?this.i18n.Actualites.ActualitesView.onDeleteAction.messageBox.msgOwner:this.i18n.Actualites.ActualitesView.onDeleteAction.messageBox.msgAdmin,
+ buttons: {yes:this.i18n.Actualites.ActualitesView.onDeleteAction.messageBox.buttons.yes, cancel:this.i18n.Actualites.ActualitesView.onDeleteAction.messageBox.buttons.cancel},
+ fn: this.onApprovedDeleteFn,
+ scope: this
+ });
+ },
+
+ onApprovedDeleteFn: function(btn) {
+ if(btn=="cancel") {
+ return false;
+ }
+ Ext.Ajax.request({
+ url: this.actionURLAjax,
+ params: {
+ cmd: "deleteActualite",
+ blogEntryInfosId: this.recordRowAction.get("blogEntryInfosId"),
+ groupId: this.groupId
+ },
+ scope: this,
+ success: this.onSuccessRowActionDelete,
+ failure: this.onFailureRowActionDelete
+ });
+ },
+
+ onSuccessRowActionDelete:function(response, options) {
+ var backObj = Ext.decode(response.responseText);
+ if (!backObj.success) {
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onSuccessRowActionDelete.alert.title, this.i18n.Actualites.ActualitesView.onSuccessRowActionDelete.alert.msg, function(btn){});
+ }else{
+ this.gridRowAction.getStore().remove(this.recordRowAction);
+ this.gridRowAction=null;
+ this.recordRowAction=null;
+ Ext.slideMsg.msg(this.i18n.Actualites.ActualitesView.onSuccessRowActionDelete.slideMsg.title,this.i18n.Actualites.ActualitesView.onSuccessRowActionDelete.slideMsg.body);
+ xiti(userXitiId,roleXitiId,etabXitiId,serviceXitiId_actualite,libServiceXiti_actualite, true);
+ }
+ },
+
+ onFailureRowActionDelete:function(response, options) {
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onFailureRowActionDelete.alert.title, this.i18n.Actualites.ActualitesView.onFailureRowActionDelete.alert.msg, function(btn){});
+ },
+
+ onAddShortCutAction: function(grid, rowIndex, colIndex){
+ var record = grid.getStore().getAt(rowIndex);
+ this.addToFavoritesWindow.showShortCutWindow(record.get("blogEntryInfosId"), record.get("title"));
+ },
+
+ //forms elements
+ onSpecialKey: function(field, e){
+ // e.HOME, e.END, e.PAGE_UP, e.PAGE_DOWN,
+ // e.TAB, e.ESC, arrow keys: e.LEFT, e.RIGHT, e.UP, e.DOWN
+ if (e.getKey() == e.ENTER) {
+ this.onSearch();
+ }
+ },
+
+
+ //buttons
+ onSearch: function(){
+ //on load le store
+ this.loadOnCallActus(false);
+ //this.groupesActuStore.load();
+ //this.headMasterActuStore.load();
+ },
+
+ onAddActuHM: function(btn) {
+ this.createActuView.show();
+ this.createActuView.refreshCreateInterface(true);
+ },
+
+ onConfigActuHM:function(btn){
+ this.configDelegateWindow.resetAndShowWindow();
+ },
+
+ onAddActu: function(btn) {
+ this.createActuView.show();
+ this.createActuView.refreshCreateInterface(false);
+ },
+
+ showAttachClicMenu: function(attachmentRecord){
+ this.attachmentRecord = attachmentRecord;
+ // Hide de l'item d'acces au lien
+ if(this.attachmentRecord.urlSignet != ""){
+ this.attachClicMenu.items.get(0).show();
+ } else {
+ this.attachClicMenu.items.get(0).hide();
+ }
+ // Hide de l'item de visualisation
+ if(EntSavoie.viewer.hasViewer(this.attachmentRecord.extension)){
+ this.attachClicMenu.items.get(1).show();
+ } else {
+ this.attachClicMenu.items.get(1).hide();
+ }
+ this.attachClicMenu.showAt(this.coordAttachMenu);
+ },
+
+ onDownloadAction: function(){
+ window.open(this.attachmentRecord.href + "&contentDispo=attachment");
+ },
+
+ onViewerAction: function(){
+ if(this.attachmentRecord.fileSize > 10000){
+ Ext.MessageBox.show({
+ title: this.i18n.Actualites.ActualitesView.onView.MessageBox.title,
+ msg: this.i18n.Actualites.ActualitesView.onView.MessageBox.msg,
+ buttons: {yes: this.i18n.Actualites.ActualitesView.onView.MessageBox.buttons.yes, no: this.i18n.Actualites.ActualitesView.onView.MessageBox.buttons.no},
+ fn: this.viewEntityCall,
+ animEl: 'confirmBtn',
+ icon: Ext.MessageBox.QUESTION,
+ minWidth: 350,
+ scope: this
+ });
+ } else {
+ this.viewEntityCall("yes");
+ }
+ },
+
+ viewEntityCall: function(btn){
+ if (btn=="no") {
+ return false;
+ }
+
+ EntSavoie.viewer.view({
+ fileLink: this.attachmentRecord.href,
+ fileName: this.attachmentRecord.name,
+ extension: this.attachmentRecord.extension,
+ isMedia: false
+ });
+ },
+
+ onSend: function(){
+ // on ajoute la piece jointe
+ var pjArray = new Array();
+ pjArray.push(this.attachmentRecord);
+ Ext.Ajax.request({
+ url: this.actionURLAjax,
+ params: {
+ cmd: 'sendToCasier',
+ attachFiles: Ext.util.JSON.encode(pjArray)
+ },
+ scope: this,
+ success: this.onSuccessSendMessage,
+ failure: this.onFailureSendMessage
+ });
+ },
+
+ onSuccessSendMessage: function(response, options) {
+ var backObj = Ext.decode(response.responseText);
+ if (!backObj.success) {
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onSend.alert.title,this.i18n.Actualites.ActualitesView.onSend.alert.body, function(btn){});
+ } else {
+ Ext.slideMsg.msg(this.i18n.Actualites.ActualitesView.onSend.slideMsg.title,this.i18n.Actualites.ActualitesView.onSend.slideMsg.body);
+ }
+ },
+
+ onFailureSendMessage: function(response, options) {
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onSend.alert.title,this.i18n.Actualites.ActualitesView.onSend.alert.body, function(btn){});
+ },
+
+ onChangeGroupPagingToolBar: function(ptbar, data){
+ },
+
+ onChangeHeadPagingToolBar: function(ptbar, data){
+ },
+
+ loadOnCallActus: function(highPrio){
+
+ var gridActu = Ext.getCmp(this.groupesActuGrid.id);
+ if (gridActu){
+ gridActu.getEl().mask(this.i18n.Actualites.ActualitesView.mask, 'x-mask-loading');
+ }
+ var gridActuHM = Ext.getCmp(this.headMasterActuGrid.id);
+ if (gridActuHM){
+ gridActuHM.getEl().mask(this.i18n.Actualites.ActualitesView.mask, 'x-mask-loading');
+ }
+
+ var params = {};
+ params.cmd = "getAllActu";
+ params.entryId = this.entryId;
+ params.isAdmin = this.isGrpAdmin;
+ params.onlyMyActus = this.onlyMyActusCB.getValue();
+
+ //params.HP = this.flagHighPrio;
+
+ if(this.isWelcomePage && highPrio){
+ params.highPrio = true;
+ //this.displayHighPriority();
+ }
+
+ if (this.searchFieldValue != this.searchField.getValue()) {
+ this.searchFieldValue = this.searchField.getValue();
+ }
+ if (this.searchFieldValue != "") {
+ params.recherche = this.searchFieldValue;
+ }
+ if (this.groupComboBoxValue != this.groupComboBox.getValue()) {
+ this.groupComboBoxValue = this.groupComboBox.getValue();
+ }
+ if (this.groupComboBoxValue != "") {
+ params.rechercheGrp = this.groupComboBoxValue;
+ }
+ if (this.typeComboBoxValue != this.typeComboBox.getValue()) {
+ this.typeComboBoxValue = this.typeComboBox.getValue();
+ }
+ if (this.typeComboBoxValue != "") {
+ params.rechercheCateg = this.typeComboBoxValue;
+ }
+
+ params.isWelcomePage = this.isWelcomePage;
+
+
+ Ext.Ajax.request({
+ url: this.actionURLAjax,
+ params: params,
+ scope: this,
+ success: this.onSuccessLoadOnCallActus,
+ failure: this.onFailureLoadOnCallActus
+ });
+ },
+
+ onSuccessLoadOnCallActus:function(response, options) {
+ var backObj = Ext.decode(response.responseText);
+ if (!backObj.success) {
+ Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onSuccessDisplayHP.alert.title, this.i18n.Actualites.ActualitesView.onSuccessDisplayHP.alert.msg, function(btn){});
+ } else {
+ this.showActuData(backObj);
+ }
+ },
+
+ showActuData: function(jsonData) {
+ /* Grille de gauche!!! --> actu classique*/
+ var nbActuSend = jsonData.actualite.length;
+ var actuRecords = [];
+ for (var i=0; i<nbActuSend; i++) {
+ var actuData = jsonData.actualite[i];
+ var newActu = new this.groupesActuStore.recordType(actuData, actuData.blogEntryInfosId);
+ actuRecords.push(newActu);
+ //this.groupesActuStore.insert(0, newActu);
+ }
+ this.groupesActuStore.removeAll();
+ this.groupesActuStore.add(actuRecords);
+ this.groupesActuStore.totalLength = jsonData.total;
+ this.groupesActuGridBbar.unbind(this.groupesActuStore);
+ this.groupesActuGridBbar.bind(this.groupesActuStore);
+
+ var gridActu = Ext.getCmp(this.groupesActuGrid.id);
+ if (gridActu){
+ gridActu.getEl().unmask();
+ }
+
+
+
+ /* Grille de droite!!! --> actu HM*/
+ var nbActuHMSend = jsonData.actualiteHM.length;
+ var actuHMRecords = [];
+ for (var i=0; i<nbActuHMSend; i++) {
+ var actuHMData = jsonData.actualiteHM[i];
+ var newActuHM = new this.headMasterActuStore.recordType(actuHMData, actuHMData.blogEntryInfosId);
+ actuHMRecords.push(newActuHM);
+ //this.groupesActuStore.insert(0, newActu);
+ }
+ this.headMasterActuStore.removeAll();
+ this.headMasterActuStore.add(actuHMRecords);
+ this.headMasterActuStore.totalLength = jsonData.totalHM;
+ this.headMasterActuGridBbar.unbind(this.headMasterActuStore);
+ this.headMasterActuGridBbar.bind(this.headMasterActuStore);
+
+ var gridActuHM = Ext.getCmp(this.headMasterActuGrid.id);
+ if (gridActuHM){
+ gridActuHM.getEl().unmask();
+ }
+
+ // on gere les actu importante
+ if(jsonData.actualiteHP!=null && jsonData.actualiteHP.creaDate!=null){
+ //afficher l'actu importante
+ var actuInfosHP = jsonData.actualiteHP;
+ this.showHighPrioWindow(actuInfosHP);
+ }
+
+
+ },
+
+ onFailureLoadOnCallActus:function(response, options) {
+ //Ext.MessageBox.alert(this.i18n.Actualites.ActualitesView.onFailureDisplayHP.alert.title, this.i18n.Actualites.ActualitesView.onFailureDisplayHP.alert.msg, function(btn){});
+ },
+
+ onGoToLink: function(btn){
+ window.open(this.attachmentRecord.urlSignet, "_blank");
+ },
+
+ formatActualiteAsHTML: function(actuInfos){
+
+ //A little bit of css to overwrite the previous properties
+ actuInfos.content = actuInfos.content.replace(/px;"/g, "px !important;\"");
+
+ var attachementsString = this.formatAttachements(actuInfos.attachements);
+ var attachLink = "";
+ if(attachementsString != ""){
+ attachLink = this.attachementsLinkTpl.apply({attachements: attachementsString});
+ }
+
+ var flashPlayer = "";
+ var mainActuCmp = Ext.getCmp(this.id);
+ if(actuInfos.urlFlashFile != ""){
+ flashPlayer = EntSavoie.viewer.view({
+ fileLink: actuInfos.urlFlashFile,
+ extension: actuInfos.flashFileExtension,
+ isMedia: true
+ });
+ }
+
+ var img = "";
+ var heightImg = 0;
+
+ if(actuInfos.imageId!=0){
+ if(actuInfos.height < 110) {
+ heightImg = actuInfos.height;
+ } else {
+ heightImg = 110;
+ }
+
+ img = "<div style='padding-right:10px !important; float:left;'>" +
+ "<img id='actualites-newsViewerImage' border='no' src='"+actuInfos.urlThumb+"' style='max-height:" + actuInfos.height + "px; max-width:" + actuInfos.width + "px;' />" +
+ "</div>";
+ }
+
+ var listGroup = "<div style='color:#CBCDCE;'>" +
+ actuInfos.grpName +
+ "</div>";
+
+ var html = "";
+ if(flashPlayer != ""){
+ html = "<table height='100%'>"+
+ "<tr height=35>" +
+ "<td width='25%' class='fullView' valign='top'>" +
+ actuInfos.creaDate+", <br />" +
+ actuInfos.author +
+ "</td>" +
+ "<td>" +
+ "<h2 style='color:#15428B; margin:0px !important;'>" +
+ actuInfos.title +
+ "</h2>" +
+ "</td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td height=" + heightImg + " valign='top'>" +
+ img +
+ "</td>" +
+ "<td width='75%' rowspan=2 valign='top'>" +
+ "<br/> " +
+ flashPlayer +
+ "<br/><br/>" +
+ "</td>" +
+ "</tr>" +
+ "<tr>"+
+ "<td valign='top'>" +
+ "<br />" +
+ attachLink +
+ "</td>" +
+ "</tr>"+
+ "<tr>" +
+ "<td>" +
+ " " +
+ "</td>" +
+ "<td>" +
+ "<div class='fullViewBody' valign='top'>" +
+ actuInfos.content +
+ "</div>" +
+ "</td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td valign='bottom'>" +
+ listGroup +
+ "</td>" +
+ "<td>" +
+ " " +
+ "</td>" +
+ "</tr>" +
+ "</table>";
+ } else {
+ html = "<table height='100%'>"+
+ "<tr height=35>" +
+ "<td width='25%' class='fullView' valign='top'>" +
+ actuInfos.creaDate+", <br />" +
+ actuInfos.author +
+ "</td>" +
+ "<td>" +
+ "<h2 style='color:#15428B; margin:0px !important;'>" +
+ actuInfos.title +
+ "</h2>" +
+ "</td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td height=" + heightImg + " valign='top'>" +
+ img +
+ "</td>" +
+ "<td rowspan=2 width='75%' valign='top'>" +
+ "<div class='fullViewBody'>" +
+ actuInfos.content +
+ "</div>" +
+ "</td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td valign='top'>" +
+ "<br />" +
+ attachLink +
+ "</td>" +
+ "</tr>" +
+ "<tr>" +
+ "<td valign='bottom'>" +
+ listGroup +
+ "</td>" +
+ "<td>" +
+ " " +
+ "</td>" +
+ "</tr>" +
+ "</table>";
+ }
+ return html;
+ },
+
+ getBrowserWindowHeight: function(){
+ var windowHeight = 0;
+
+ if (typeof(window.innerHeight)=='number') {
+ windowHeight = window.innerHeight;
+ } else {
+ if (document.documentElement && document.documentElement.clientHeight) {
+ windowHeight = document.documentElement.clientHeight;
+ }
+ else {
+ if (document.body&&document.body.clientHeight) {
+ windowHeight = document.body.clientHeight;
+ }
+ }
+ }
+
+ if (window.pageYOffset) {
+ windowHeight = windowHeight - window.pageYOffset;
+ } else {
+ if(Ext.isIE){
+ windowHeight = windowHeight - document.documentElement.scrollTop;
+ } else {
+ windowHeight = windowHeight - document.body.scrollTop;
+ }
+ }
+
+ return windowHeight - 20;
+ },
+
+ getBrowserWindowWidth: function(){
+ var windowWidth = 0;
+
+ if (typeof(window.innerWidth)=='number') {
+ windowWidth = window.innerWidth;
+ } else {
+ if (document.documentElement && document.documentElement.clientWidth) {
+ windowWidth = document.documentElement.clientWidth;
+ }
+ else {
+ if (document.body&&document.body.clientWidth) {
+ windowWidth = document.body.clientWidth;
+ }
+ }
+ }
+
+ if (window.pageXOffset) {
+ windowWidth = windowWidth - window.pageXOffset;
+ } else {
+ if(Ext.isIE){
+ windowWidth = windowWidth - document.documentElement.scrollLeft;
+ } else {
+ windowWidth = windowWidth - document.body.scrollLeft;
+ }
+ }
+
+ return windowWidth - 20;
+ },
+
+ onGroupeSortChange: function(comboBox) {
+ var value = "";
+ if (this.valueSortingComboBox.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[0]){
+ value = 'dateSort';
+ }
+ else if (this.valueSortingComboBox.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[1]){
+ value = 'author';
+ }
+ else if (this.valueSortingComboBox.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[2]){
+ value = 'title';
+ }
+ else if (this.valueSortingComboBox.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBox.value[3]){
+ value = 'isPrio';
+ }
+
+ var sens;
+ if (this.sortingComboBox.getValue() == this.i18n.Actualites.ActualitesView.sortingComboBox.value[0]){
+ sens = "ASC";
+ }
+ else {
+ sens = "DESC";
+ }
+
+ if (value == "isPrio" || value == "author"){
+ this.groupesActuStore.sort([ {field: value, direction: sens}, {field: 'dateSort', direction: 'DESC'} ], 'ASC');
+ }
+ else {
+ this.groupesActuStore.sort(value, sens);
+ }
+ },
+
+ onHMSortChange: function(comboBox) {
+ var value = "";
+ if (this.valueSortingComboBoxHM.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[0]){
+ value = 'dateSort';
+ }
+ else if (this.valueSortingComboBoxHM.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[1]){
+ value = 'author';
+ }
+ else if (this.valueSortingComboBoxHM.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[2]){
+ value = 'title';
+ }
+ else if (this.valueSortingComboBoxHM.getValue() == this.i18n.Actualites.ActualitesView.valueSortingComboBoxHM.value[3]){
+ value = 'isPrio';
+ }
+
+ var sens;
+ if (this.sortingComboBoxHM.getValue() == this.i18n.Actualites.ActualitesView.sortingComboBoxHM.value[0]){
+ sens = "ASC";
+ }
+ else {
+ sens = "DESC";
+ }
+
+ if (value == "isPrio" || value == "author"){
+ this.headMasterActuStore.sort([ {field: value, direction: sens}, {field: 'dateSort', direction: 'DESC'} ], 'ASC');
+ }
+ else {
+ this.headMasterActuStore.sort(value, sens);
+ }
+ }
+
+});