--- /dev/null
+/*
+Copyright (c) Igor Barma, Alexandre Desoubeaux, Christian Martel, Eric Brun, Mathieu Amblard, Gwenael Gevet, Pierre Guillot, 2012
+For licensing, see README.txt or http://www.pentilanero.com (Cecill-C or AGPL or LGPL)
+*/
+Ext.ns("EntSavoie");
+
+EntSavoie.manageDocument = {
+
+ /**
+ * Désarchive un fichier zip
+ */
+ unzipFile: function(config) {
+
+ this.wait = new Ext.LoadMask(document.body, {msg: EntSavoie.manageDocument.i18n.waitMsg });
+ this.wait.show();
+
+ Ext.apply(this, config);
+
+ Ext.Ajax.request({
+ url:this.actionURLAjax,
+ params:{
+ cmd: "unzipFile",
+ folderId: this.folderId,
+ fileName: this.fileName,
+ title: this.title,
+ scopeGroupId: this.scopeGroupId
+ },
+ success: this.onSuccessUnzip,
+ failure: this.onFailureUnzip,
+ scope: this
+ });
+
+ },
+
+ /**
+ * Fonction appelée si le désarchivage s'est correctement déroulé et avertit l'utilisateur de caractères spéciaux
+ */
+ onSuccessUnzip: function(response, options) {
+ /*var backObj = Ext.decode(response.responseText);
+ if (!backObj.portal_message_zip) {
+ window.location=this.renderUrlAjax+"&folderId="+this.folderId;
+ }
+ else {
+ Ext.Msg.show({
+ title:'Erreur'
+ ,msg:backObj.portal_message_zip
+ ,modal:true
+ ,icon:Ext.Msg.ERROR
+ ,buttons:Ext.Msg.OK
+ });
+ this.wait.hide();
+ }*/
+
+ // Rafraichissement de l'interface
+ this.gridEntityManager.refreshInterfaceUnzip(response);
+
+ this.wait.hide();
+ },
+
+ /**
+ * Fonction appelée si le désarchivage ne s'est pas correctement déroulé
+ */
+ onFailureUnzip: function(response, options) {
+ this.wait.hide();
+ }//,
+
+ /**
+ * Visualisation d'un fichier
+ */
+ /*view : function(config) {
+ Ext.apply(this, config);
+
+ this.destroyListener = this.destroyListener || this.defaultDestroyListener;
+ this.listenerScope = this.listenerScope || this;
+
+ // Si le fichier est reconnu et que ce n'est pas un fichier texte
+ if ((this.hasViewer(this.mimeType)) && !this.isTXT(this.mimeType)) {
+ if(this.isImage){
+ var mediaWindow = new Ext.ux.MediaWindow({
+ x : (document.documentElement.clientWidth/3) + document.documentElement.scrollLeft,
+ y : (document.documentElement.clientHeight/3) + document.documentElement.scrollTop,
+ height : 400,
+ width : 500,
+ autoScroll : true,
+ modal : false,
+ region : 'center',
+ title : this.objTitle,
+ mediaMask: EntSavoie.manageDocument.i18n.mediaMask,
+ autoMask: true,
+ mediaCfg : {
+ mediaType: this.getMediaType(this.mimeType),
+ url : this.objUrl + "&contentDispo=inline",
+ autoSize : true,
+ start : true,
+ controls : true,
+ loop : true,
+ status : true,
+ autoHeight : true,
+ autoWidth : true
+ }
+ });
+ } else {
+ var mediaWindow = new Ext.ux.MediaWindow({
+ x : (document.documentElement.clientWidth/12) + document.documentElement.scrollLeft,
+ y : (document.documentElement.clientHeight/12) + document.documentElement.scrollTop,
+ height : 650,
+ width : 1000,
+ autoScroll : true,
+ modal : false,
+ region : 'center',
+ title : this.objTitle,
+ mediaMask: EntSavoie.manageDocument.i18n.mediaMask,
+ autoMask: true,
+ mediaCfg : {
+ mediaType: this.getMediaType(this.mimeType),
+ url : this.objUrl + "&contentDispo=inline",
+ autoSize : true,
+ start : true,
+ controls : true,
+ loop : true,
+ status : true,
+ autoHeight : true,
+ autoWidth : true
+ }
+ });
+ }
+ mediaWindow.on("destroy", this.destroyListener, this.listenerScope);
+ mediaWindow.show();
+ }
+ // Sinon si le fichier est reconnu et que c'est un fichier texte
+ else if ((this.hasViewer(this.mimeType)) && this.isTXT(this.mimeType)) {
+ var mediaWindow = new Ext.ux.MediaWindow({
+ x : (document.documentElement.clientWidth/3) + document.documentElement.scrollLeft,
+ y : (document.documentElement.clientHeight/3) + document.documentElement.scrollTop,
+ height : 400,
+ width : 500,
+ autoScroll : true,
+ modal : false,
+ region : 'center',
+ title : this.objTitle,
+ autoMask: true,
+ mediaCfg : {
+ mediaType: this.getMediaType(this.mimeType),
+ url : this.objUrl + "&contentDispo=inline",
+ autoSize : true,
+ start : true,
+ controls : true,
+ loop : true,
+ status : true,
+ autoHeight : true,
+ autoWidth : true
+ }
+
+ });
+ mediaWindow.on("destroy", this.destroyListener, this.listenerScope);
+ mediaWindow.show();
+ }
+ else {
+ return false;
+ }
+
+ },
+
+ defaultDestroyListener: function(wdn) {
+
+ },*/
+
+ /**
+ * Fournit une correspondance reconnu par uxMedia pour le contentType du fichier
+ */
+ /*getMediaType: function(type){
+ return EntSavoie.mediaTypeMap[type];
+ },*/
+
+ /**
+ * Retourne true si le contentType du fichier est pris en charge
+ */
+ /*hasViewer: function(type){
+ if (type in EntSavoie.mediaTypeMap) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ },*/
+
+ /**
+ * Retourne true si le contentType du fichier est de type texte
+ */
+ /* isTXT: function(type){
+ if (type!="text/plain" && type!="application/javascript" && type!="text/javascript" && type!="text/css") {
+ return false;
+ }
+ else {
+ return true;
+ }
+ }*/
+};
+
+/*EntSavoie.mediaTypeMap = {
+
+ //"audio/x-wav": "WAV",
+
+ //"application/pdf": "PDFFRAME",
+
+ //"application/x-shockwave-flash": "SWF",
+ //"video/quicktime": "QT",
+ //"audio/vnd.rn-realaudio": "REAL",
+ //"video/vnd.rn-realvideo": "REAL",
+ //"audio/x-pn-realaudio": "REAL",
+ //"audio/x-pn-realaudio-plugin": "REAL",
+ //"video/x-msvideo": "AVI",
+
+ "image/gif": "GIF",
+ //"image/tiff": "TIFF",
+ "image/jpeg": "JPEG",
+ "image/png": "PNG",
+
+ "text/html": "HTM",
+ "text/plain": "TXT",
+ //"text/rtf": "RTF",
+ //"text/richtext": "RTF",
+ //"application/rtf": "RTF",
+
+ "application/javascript": "JS",
+ "text/javascript": "JS",
+ "text/css": "CSS",
+ "text/xml": "XML"
+
+ //"application/vnd.oasis.opendocument.text": "ODT",
+ //"application/vnd.oasis.opendocument.spreadsheet": "ODS",
+ //"application/vnd.sun.xml.impress": "IMPRESS",
+
+ //"application/x-oleobject": "DATAVIEW",
+ //"application/vnd.ms-excel": "OWCXLS",
+ //"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "OWCXLS",
+ //"application/vnd.ms-word": "OWCWORD",
+ //"application/vnd.openxmlformats-officedocument.wordprocessingml.document" :"OWCWORD",
+ //"application/msword": "OWCWORD",
+ //"application/x-msoffice": "OFFICE",
+ //"application/vnd.ms-powerpoint": "POWERPOINT",
+ //"application/vnd.ms-visio.viewer": "VISIO"
+
+};*/
+
+
+
+
+
+