Project

General

Profile

Message de confirmation en cas de download > 100 items

Afin de sensibiliser l'utilisateur sur l'espace nécessaire on affiche une message de confirmation lorsque le nombre d'items téléchargés est > 100

On ajoute dans le fichier source:workspace/client-user/js/components/livegrid/dependencies/contextMenu.js@6#L886


//Cas où on clique droit 
        if (this.getNbRowsSelected() >100  ){
            var sizeGo=Math.round(this.getNbRowsSelected()*0.01*10)/10;
             Ext.Msg.confirm('Confirm','You are about to download '+ this.getNbRowsSelected()+' files (around '+ sizeGo+ ' Go). Do you want to continue ?',function(btn){  
                 if(btn === 'yes'){  
                     if (method == "GET" ) {
//                         Ext.Msg.alert("Loading", "Please wait ...");
//                         Ext.getBody().mask("loading...", "x-mask-loading");
                         window.open(url,'_self');
                         Ext.getBody().unmask();
                         return;
                     } else {
                         this._executeRequestForResource(url, method);
                     }
                 }else{  
                     return;
                 }  
             });
        }
        //Cas où on utilise le menu 
        else if ((this.getNbRowsSelected()==0 && this.grid.store.totalLength >100)){
            var sizeGo=Math.round(this.grid.store.totalLength*0.01*10)/10;
             Ext.Msg.confirm('Confirm','You are about to download '+ this.grid.store.totalLength+' files (around '+ sizeGo + ' Go). Do you want to continue ?',function(btn){  
                 if(btn === 'yes'){  
                     if (method == "GET" ) {
//                         Ext.Msg.alert("Loading", "Please wait ...");
//                         Ext.getBody().mask("loading...", "x-mask-loading");
                         window.open(url,'_self');
                         Ext.getBody().unmask();
                         return;
                     } else {
                         this._executeRequestForResource(url, method);
                     }
                 }else{  
                     return;
                 }  
             });
        }

        else {
            if (method == "GET" ) {
//                 Ext.Msg.alert("Loading", "Please wait ...");
//                 Ext.getBody().mask("loading...", "x-mask-loading");
                 window.open(url,'_self');
                 Ext.getBody().unmask();
                 return;
             } else {
                 this._executeRequestForResource(url, method);
             }
        }