Changeset 5858


Ignore:
Timestamp:
04/02/12 14:50:09 (12 years ago)
Author:
alexandrecorreia
Message:

Ticket #2583 - Novas dialogs com Jquery para o novo visual do expresso ( com EJS ).

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/main.js

    r5844 r5858  
    31683168} 
    31693169 
    3170 function import_window(){ 
    3171         var win = arrayJSWin["import_window"]; 
    3172         var form_upload = Element("form_upload"); 
    3173         if(!win) { 
    3174                 var form = document.createElement("DIV"); 
    3175                 form.id  = "import_window"; 
    3176                 form.style.visibility = "hidden"; 
    3177                 form.style.position = "absolute"; 
    3178                 form.style.background = "#eeeeee"; 
    3179                 form.style.left = "0px"; 
    3180                 form.style.top  = "0px"; 
    3181                 form.style.width = "0px"; 
    3182                 form.style.height = "0px"; 
    3183                 document.body.appendChild(form); 
    3184                 form_upload = document.createElement("DIV"); 
    3185                 form_upload.id = "form_upload"; 
    3186                 form_upload.style.position = "absolute"; 
    3187                 form_upload.style.top = "5px"; 
    3188                 form_upload.style.left = "5px"; 
    3189                 form_upload.name =  get_lang('zip mails to import'); 
    3190                 form_upload.style.width = "450px"; 
    3191                 form_upload.style.height = "100px"; 
    3192                 form.appendChild(form_upload); 
    3193                 form.style.width  =  form.firstChild.style.width; 
    3194                 form.style.height = form.firstChild.style.height; 
    3195                 form.style.zIndex = "10000"; 
    3196                 var title = form.firstChild.name; 
    3197                 var wHeight = form.offsetHeight + "px"; 
    3198                 var wWidth =  form.offsetWidth   + "px"; 
    3199                 form.style.width = form.offsetWidth - 5; 
    3200                 win = new dJSWin({ 
    3201                         id: 'win_'+form.id, 
    3202                         content_id: form.id, 
    3203                         width: wWidth, 
    3204                         height: wHeight, 
    3205                         title_color: '#3978d6', 
    3206                         bg_color: '#eee', 
    3207                         title: title, 
    3208                         title_text_color: 'white', 
    3209                         button_x_img: '../phpgwapi/images/winclose.gif', 
    3210                         border: true}); 
    3211                 win.draw(); 
    3212         } 
     3170function import_window() 
     3171{ 
     3172        var importEmails = $("#importEmails"); 
     3173                importEmails.html( DataLayer.render( BASE_PATH + "modules/mail/templates/importEmails.ejs", {})); 
     3174                importEmails.dialog( 
     3175                { 
     3176                        height          : 280, 
     3177                        width           : 500, 
     3178                        resizable       : false, 
     3179                        title           : get_lang('zip mails to import'), 
     3180                        modal           : true, 
     3181                        buttons         : [ 
     3182                                                         { 
     3183                                                                text    : get_lang("Close"),  
     3184                                                                click   : function() 
     3185                                                                { 
     3186                                                                        importEmails.dialog("destroy"); 
     3187                                                                } 
     3188                                                         }, 
     3189                                                         { 
     3190                                                                text    : get_lang("Import"),  
     3191                                                                click   : function() 
     3192                                                                { 
     3193                                                                        var input_file   = importEmails.find("input[type=file]"); 
     3194                                                                        var input_hidden = importEmails.find("input[name=folder]");  
     3195                                                                         
     3196                                                                        if( input_file.attr("value") == "" ) 
     3197                                                                        { 
     3198                                                                                $.Zebra_Dialog(get_lang("You must choose a file") + " !",{ 
     3199                                                                                        'type'                          : 'warning', 
     3200                                                                                        'overlay_opacity'       : '0.5', 
     3201                                                                                        'onClose'                       :  function(){ 
     3202                                                                                                $("#importMessageAccordion").accordion('activate',0);    
     3203                                                                                        } 
     3204                                                                                }); 
     3205                                                                        } 
     3206                                                                        else 
     3207                                                                        { 
     3208                                                                                if( input_hidden.attr("value") == "" ) 
     3209                                                                                        $.Zebra_Dialog( get_lang("You must choose a folder") + " !" , { 
     3210                                                                                                'type'                          : 'warning', 
     3211                                                                                                'overlay_opacity'       : '0.5', 
     3212                                                                                                'onClose'                       :  function(){ 
     3213                                                                                                        $("#importMessageAccordion").accordion('activate',1);    
     3214                                                                                                } 
     3215                                                                                        }); 
     3216                                                                                else 
     3217                                                                                { 
     3218                                                                                        var handler_return = function(data) 
     3219                                                                                        { 
     3220                                                                                                importEmails.dialog("destroy"); 
     3221                                                                                                 
     3222                                                                                                return_import_msgs( data, input_hidden.attr("value") ); 
     3223                                                                                        } 
     3224 
     3225                                                                                        var formSend =  document.getElementById("importFileMessages"); 
     3226                                                                                         
     3227                                                                                        write_msg(get_lang('You must wait while the messages will be imported...')); 
     3228                                                                                         
     3229                                                                                        cExecuteForm('$this.imap_functions.import_msgs', formSend , handler_return ); 
     3230                                                                                } 
     3231                                                                        } 
     3232                                                                } 
     3233                                                         } 
     3234                                                ] 
     3235                }); 
     3236 
     3237        importEmails.css("overflow","hidden"); 
     3238                 
     3239        importEmails.find("input[type=file]").change(function() 
     3240        {  
     3241                var deniedExtension = true; 
     3242                var fileExtension       = ["eml","zip"]; 
     3243                var fileName            = importEmails.find("input[type=file]").attr('value'); 
     3244                        fileName                = fileName.split("."); 
     3245                 
     3246                if( fileName[1] ) 
     3247                { 
     3248                        for( var i in fileExtension ) 
     3249                        { 
     3250                                if( fileExtension[i].toUpperCase() === fileName[1].toUpperCase() ) 
     3251                                { 
     3252                                        deniedExtension = false; 
     3253                                        break; 
     3254                                } 
     3255                        } 
     3256                } 
     3257 
     3258                if( deniedExtension ) 
     3259                { 
     3260                        $.Zebra_Dialog( get_lang('File extension forbidden or invalid file') , { 
     3261                                'type'                          : 'warning', 
     3262                                'overlay_opacity'       : '0.5' 
     3263                        }); 
     3264                } 
     3265 
     3266                $("#lblFileName").html( ( !deniedExtension ) ? importEmails.find("input[type=file]").attr('value') : "" ); 
     3267                 
     3268        });      
     3269                 
     3270        $("#importMessageAccordion").accordion();        
     3271 
     3272        var foldersTree = jQuery("#foldertree-container-importMessage") 
     3273        .removeClass('empty-container') 
     3274        .html(DataLayer.render(BASE_PATH + 'api/templates/foldertree.ejs', {folders: [cp_tree1, cp_tree2, [] ]})) 
     3275        .find("#foldertree").treeview() 
     3276        .click(function(event) 
     3277        { 
     3278                //request new selected folder messages 
     3279                var target = $(event.target); 
     3280 
     3281                if( target.is('.collapsable-hitarea, .expandable-hitarea, .lastCollapsable, .lastExpandable, .treeview') ) 
     3282                    return; 
     3283 
     3284                if( !target.attr('id') ) 
     3285                    target = target.parent(); 
     3286 
     3287        if (target.attr('id') == "foldertree") return; 
     3288                 
     3289                var targetId = target.attr('id'); 
     3290                var child = target.find('.folder'); 
     3291                 
     3292                $('.filetree span.folder.selected').removeClass('selected'); 
     3293                if(!target.is('#foldertree > .expandable, #foldertree > .collapsable')) 
     3294                        $(target).children('.folder').addClass('selected'); 
     3295                 
     3296                selectedFolder = { 
     3297                    id: targetId,  
     3298                    name: child.attr('title'), 
     3299                    'class': child.attr('class') 
     3300                }; 
     3301                 
     3302                importEmails.find("input[name=folder]").attr("value", targetId); 
     3303        }); 
    32133304         
    3214     form_upload.innerHTML = '<div style="margin:3px;">' +   
    3215                                                         '<fieldset>' +  
    3216                                                                 '<legend>' + get_lang('zip mails to import') + '</legend>' +  
    3217                                                                 '<form method="POST" name="form_import" enctype="multipart/form-data">' +  
    3218                                                                         '<input name="file_1" maxlength="255" size="35" id="file_1" type="file"><br>' +  
    3219                                                                         '<input style="margin:5px;" title="'+get_lang('Select a folder')+'" value="'+get_lang('Select a folder')+'" type="button" onclick="javascript:select_import_folder()">'+  
    3220                                                                         '<input title="'+get_lang("Close")+'" value="'+get_lang("Close")+'" type="button" onclick="arrayJSWin[\'import_window\'].close();">' +  
    3221                                                                 '</form>' +                                                               
    3222                                                         '</fieldset>' +  
    3223                                                         '</div>';  
    3224     win.open(); 
    3225 } 
    3226  
    3227 function import_msgs(wfolders_tree){ 
    3228         function handler(data){ 
    3229                 // Its necessary to encapsulate the data returned (IE bugfix) 
    3230                 return_import_msgs(data,wfolders_tree); 
    3231         } 
    3232         var countFiles = document.form_import.countFiles; 
    3233         if(!countFiles){ 
    3234                 countFiles = document.createElement("INPUT"); 
    3235                 countFiles.type = "hidden"; 
    3236                 countFiles.name = "countFiles"; 
    3237                 countFiles.value = "1"; 
    3238                 document.form_import.appendChild(countFiles); 
    3239         } 
    3240         var folder = document.createElement("INPUT"); 
    3241         folder.type = "hidden"; 
    3242         folder.name = "folder"; 
    3243         folder.value = wfolders_tree._selected.id; 
    3244         document.form_import.appendChild(folder); 
    3245         write_msg(get_lang('You must wait while the messages will be imported...')); 
    3246  
    3247         cExecuteForm('$this.imap_functions.import_msgs', document.form_import, handler); 
    3248 } 
    3249 function return_import_msgs(data, wfolders_tree){ 
     3305        $("#lblFileName").prev().css("margin-left", "10px"); 
     3306        $("#lblFileName").prev().css("font-weight", "bold"); 
     3307} 
     3308 
     3309function return_import_msgs(data, folderID){ 
    32503310        if(data && data.error){ 
    32513311                write_msg(data.error); 
     
    32743334                                        Element("dJSWin_wfolders_bok").blur(); 
    32753335                                }                                
    3276                                 if(openTab.imapBox[0] == wfolders_tree._selected.id) 
     3336                                if(openTab.imapBox[0] == folderID) 
    32773337                                { 
    32783338                                        openTab.imapBox[0] = ''; 
  • trunk/expressoMail1_2/setup/phpgw_pt-br.lang

    r5830 r5858  
    7676Check Spelling  expressoMail1_2 pt-br   Corretor Ortográfico 
    7777Choose a name   expressoMail1_2 pt-br   Escolha um nome 
     78Choose the file expressoMail1_2 pt-br   Escolha o arquivo 
    7879Chose the text you want transform in link before.       expressoMail1_2 pt-br   Selecione o texto que deseja transformar em link. 
    7980Clean   expressoMail1_2 pt-br   Limpar 
     
    184185File extension forbidden or invalid file        expressoMail1_2 pt-br   Extensão de arquivo proibido ou arquivo inválido 
    185186files   expressoMail1_2 pt-br   arquivos 
     187File name       expressoMail1_2 pt-br   Nome do arquivo 
    186188Filters expressoMail1_2 pt-br   Filtros 
    187189Filters maintenance     expressoMail1_2 pt-br   Manutenção de Filtros 
     
    465467attachment(s)   expressoMail1_2 pt-br   anexo(s). 
    466468Select a name   expressoMail1_2 pt-br   Selecione um nome 
     469Select a zip file or eml        expressoMail1_2 pt-br   Selecione um arquivo zip ou eml 
    467470Select an organization and click on button <b>Search</b>        expressoMail1_2 pt-br   Selecione uma Organização e clique no botão <b>Pesquisar</b> 
    468471Select Date     expressoMail1_2 pt-br   Selecione uma data 
  • trunk/expressoMail1_2/templates/default/index.tpl

    r5786 r5858  
    208208<div id="followupFlag" class="followupflag-configure-win" style="display: none;"></div> 
    209209<div class="expressomail-module-container" style="display: none;"></div> 
     210<div id="importEmails" style="display:none;padding:5px;"></div> 
     211 
    210212<!-- END list --> 
Note: See TracChangeset for help on using the changeset viewer.