Changeset 7270


Ignore:
Timestamp:
09/21/12 12:14:32 (8 years ago)
Author:
fernando
Message:

Ticket #3088 - Melhoria no arquivamento local do Expresso - desativar serviço no ExpressoMail?

Location:
sandbox/2.5.0-expresso1
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.5.0-expresso1/expressoMail1_2/js/mail_archiver.js

    r7261 r7270  
    257257        //Redraw "Offline" linkage, intended to recoonect MailArchiver link     
    258258        connector.purgeCache(); 
    259         ttreeBox.name_folder = "root"; 
    260         ttreeBox.update_folder(); 
    261         draw_tree_local_folders(); 
    262         ttreeBox.update_folder(); 
    263         change_folder('INBOX', 'INBOX', ttreeBox);   
     259        draw_new_tree_folder(); 
     260        change_folder('INBOX', 'INBOX');  
    264261    } 
    265262} 
     
    283280        else{ 
    284281            window.clearInterval(expresso_mail_archive.timer); 
    285             write_msg(get_lang('MailArchiver does not seems to be running or installed at this workstation, local messages are disabled. Check it out!'),true); 
     282            write_msg(get_lang('MailArchiver does not seems to be running or installed at this workstation, local messages are disabled. Check it out!'),false); 
     283            expresso_mail_archive.enabled = false; 
     284            expresso_mail_archive.turnOffLocalTreeStructure(); 
    286285        } 
    287286    } 
    288287    else{ 
    289288        window.clearInterval(expresso_mail_archive.timer); 
    290         write_msg(get_lang('MailArchiver does not seems to be running or installed at this workstation, local messages are disabled. Check it out!'),true); 
    291         expresso_mail_archive.enabled = false;         
     289        write_msg(get_lang('MailArchiver does not seems to be running or installed at this workstation, local messages are disabled. Check it out!'),false); 
     290        expresso_mail_archive.enabled = false; 
     291        expresso_mail_archive.turnOffLocalTreeStructure();  
    292292    } 
    293293    //window.alert('fooArc set to null'); 
     
    301301    write_msg(get_lang('Mail Archiver is not responding. There is some communicating issue hang it up. Some services may not work properly. Check it out!')); 
    302302    obj.DeactivateStatusListener(obj); 
     303    //draw_new_tree_folder(); 
    303304    return; 
    304305} 
     
    322323            expresso_mail_archive.DeactivateResources(expresso_mail_archive);             
    323324        } 
    324         else 
     325        //else 
    325326            //window.alert('ok'); 
    326327         
     
    351352    obj.SystemCheck(); 
    352353    obj.ActivateStatusListener(obj); 
    353     connector.resetProgressBarText(); 
    354     //auto_refresh(); 
     354    //connector.resetProgressBarText(); 
     355    auto_refresh(); 
    355356} 
    356357 
     
    12111212    }     
    12121213    catch(e){ 
    1213         if(!expresso_mail_archive.enabled) 
     1214        if (!expresso_mail_archive.enabled) 
    12141215            write_msg(get_lang('MailArchiver does not seems to be running or installed at this workstation, local messages are disabled. Check it out!'),false); 
    12151216        else{ 
    12161217            window.clearInterval(expresso_mail_archive.timer); 
    1217             write_msg(get_lang('There is something wrong with MailArchiver environment. Contact you support'),true); 
     1218            write_msg(get_lang('There is something wrong with MailArchiver environment. Contact you support'), false); 
    12181219            expresso_mail_archive.enabled = false; 
    12191220            expresso_mail_archive.turnOffLocalTreeStructure(); 
     
    12261227MailArchiver.prototype.getFaultInfoOperationOK = function(faultinfo){ 
    12271228    try{ 
    1228         write_msg(get_lang('MailArchiver remote service reports the following error:', true) + faultinfo.getReturn().getSoapFaultString()); 
     1229        write_msg(get_lang('MailArchiver remote service reports the following error:', false) + faultinfo.getReturn().getSoapFaultString()); 
    12291230    } catch(e){ 
    1230         write_msg(get_lang('The archive service reports a unknown error. Try to refresh your browser screen', true)); 
     1231        write_msg(get_lang('The archive service reports a unknown error. Try to refresh your browser screen', false)); 
    12311232    } 
    12321233    expresso_mail_archive.resetObject(); 
     
    12341235    window.setTimeout("eval('document.getElementById(\"main_title\").innerHTML =\"Expresso Mail\"')",3000);         
    12351236    connector.purgeCache(); 
     1237    expresso_mail_archive.turnOffLocalTreeStructure(); 
    12361238} 
    12371239 
     
    12391241MailArchiver.prototype.getFaultInfoOperationFailure = function(errorCode, errorDesc){ 
    12401242    try{ 
    1241         write_msg(get_lang('SoapFault capture fails at:' + errorCode + ' | ' + errorDesc, true)); 
     1243        write_msg(get_lang('SoapFault capture fails at:' + errorCode + ' | ' + errorDesc, false)); 
    12421244    } catch(e){ 
    1243         write_msg(get_lang('Service error mapping', true)); 
     1245        write_msg(get_lang('Service error mapping', false)); 
    12441246    }     
    12451247} 
     
    12621264    //window.alert('callback de createfolderoperationok'); 
    12631265    draw_tree_local_folders(); 
    1264     expresso_mail_archive.drawdata.treeObject._drawn = true; 
     1266    //expresso_mail_archive.drawdata.treeObject._drawn = true; 
    12651267    //ttreeBox.update_folder();     
    12661268} 
     
    20722074 
    20732075MailArchiver.prototype.turnOffLocalTreeStructure = function (){ 
    2074     var disabled_local_span = document.getElementById('llocal_disabledtree_folders'); 
    2075  
    2076     if((!disabled_local_span) && (!document.getElementById('services_retry'))){ 
    2077         var n_LocalDisabled = new dNode({id: "local_disabled", caption: get_lang('Offline'), onClick: "services_retry()", plusSign:false}); 
    2078         tree_folders.add(n_LocalDisabled, 'local_root'); 
    2079                              
    2080         var disabled_local_span = document.getElementById('llocal_disabledtree_folders'); 
    2081         disabled_local_span.style.backgroundImage="url(../phpgwapi/templates/"+template+"/images/foldertree_services.png)"; 
    2082         var service_retry = document.createElement("SPAN"); 
    2083         service_retry.id = 'services_retry'; 
    2084         service_retry.className = 'clean_trash'; 
    2085         service_retry.style.cursor = 'pointer'; 
    2086         service_retry.onclick = function () {services_retry();}; 
    2087         service_retry.innerHTML = "["+get_lang("Retry")+"]"; 
    2088         service_retry.title= get_lang("Reconect to MailArchiver services"); 
    2089         service_retry.onmouseover = function() {service_retry.style.color="red";}; 
    2090         service_retry.onmouseout= function() {service_retry.style.color="#666666";}; //#114FA4 
    2091         disabled_local_span.parentNode.appendChild(service_retry); 
    2092                              
    2093         var div_ma_host = document.createElement('div'); 
    2094         div_ma_host.id = 'div_login_ma_host'; 
    2095         div_ma_host.style.position = 'absolute'; 
    2096         div_ma_host.style.padding = '0px'; 
    2097         div_ma_host.style.margin = '0px'; 
    2098         div_ma_host.style.top = '25px'; 
    2099         div_ma_host.style.left = '0px'; 
    2100         div_ma_host.style.width = '145px'; 
    2101         div_ma_host.style.height = '80px'; 
    2102         div_ma_host.style.border = '1px solid #CCCCCC'; 
    2103         div_ma_host.style.backgroundColor = '#F0F0F0'; 
    2104         div_ma_host.style.fontWeight = 'normal'; 
    2105         disabled_local_span.appendChild(div_ma_host); 
    2106         div_ma_host.innerHTML = '<p><b>'+get_lang('In trouble?')+'</b></p><p>&rarr; ' + get_lang('Try to access') + '<br/><a href="' + mail_archive_protocol + "://" + mail_archive_host + ":" + mail_archive_port + '/admin" target="_blank" title="MailArchiver Admin">'+get_lang('MailArchiver admin console')+'.</p>';                             
    2107     } 
    2108     //Only creates the MA login linkage 
    2109     else{ 
    2110         var div_ma_host = document.createElement('div'); 
    2111         div_ma_host.id = 'div_login_ma_host'; 
    2112         div_ma_host.style.position = 'absolute'; 
    2113         div_ma_host.style.padding = '0px'; 
    2114         div_ma_host.style.margin = '0px'; 
    2115         div_ma_host.style.top = '25px'; 
    2116         div_ma_host.style.width = '145px'; 
    2117         div_ma_host.style.height = '80px'; 
    2118         div_ma_host.style.border = '1px solid #CCCCCC'; 
    2119         div_ma_host.style.backgroundColor = '#F0F0F0'; 
    2120         div_ma_host.style.fontWeight = 'normal'; 
    2121         disabled_local_span.appendChild(div_ma_host); 
    2122         div_ma_host.innerHTML = '<p><b>'+get_lang('In trouble?')+'</b></p><p>&rarr; ' + get_lang('Try to access') + '<br/><a href="' + mail_archive_protocol + "://" + mail_archive_host + ":" + mail_archive_port + '/admin" target="_blank" title="MailArchiver Admin">'+get_lang('MailArchiver admin console')+'.</p>';                                                         
    2123     }     
     2076     draw_new_tree_folder();   
    21242077} 
    21252078 
  • sandbox/2.5.0-expresso1/expressoMail1_2/js/main.js

    r7234 r7270  
    48984898        if ((expresso_mail_archive.enabled == null) && (expresso_mail_archive.timer == null) && (expresso_mail_archive.counter > 0)){ 
    48994899            connector.hideProgressBar(); 
    4900             connector.resetProgressBarText(); 
     4900            //connector.resetProgressBarText(); 
    49014901            write_msg(get_lang('Sorry, but you need to reload this web page. Click at reload page at web browsing top navigation.')); 
    49024902            return; 
     
    49044904 
    49054905        if (arguments.length == 0){ 
    4906            connector.setProgressBarText(get_lang('Trying to communicate with Mail Archiver...')); 
     4906           write_msg(get_lang('Trying to communicate with Mail Archiver...')); 
    49074907        } 
    49084908 
     
    49674967        write_msg(get_lang('Sorry, but Mail Archiver still seems to be sleeping. Check out your system services!')); 
    49684968        connector.hideProgressBar(); 
    4969         connector.resetProgressBarText(); 
     4969        //connector.resetProgressBarText(); 
    49704970        check_services_tryouts = 1; 
    49714971    } 
     
    49754975function check_services_restart(){ 
    49764976    try{ 
    4977         connector.setProgressBarText(get_lang('Wait: attempt %1 from %2...', check_services_tryouts, check_services_tryouts_limit)); 
     4977                write_msg(get_lang('Wait: attempt %1 from %2...', check_services_tryouts, check_services_tryouts_limit)); 
    49784978        if(check_services_tryouts <= 5){ 
    49794979            try{ 
    49804980                ArchiveServices = new web_service_mailarchiver_serpro__ArchiveServices(); 
    49814981                ArchiveServices.url = mail_archive_protocol + "://" + mail_archive_host + ":" + mail_archive_port + "/arcserv/ArchiveServices"; 
    4982                 window.clearInterval(ttintval2); 
     4982                window.clearInterval(ttintval); 
    49834983                expresso_mail_archive.Restart(expresso_mail_archive); 
    49844984            } 
     
    49864986                check_services_tryouts++; 
    49874987                window.clearInterval(ttintval); 
    4988                 ttintval2 = window.setTimeout('services_retry(true)',1); 
     4988                ttintval = window.setTimeout('services_retry(true)',1); 
    49894989            } 
    49904990        } 
     
    49924992            write_msg(get_lang('Sorry, but Mail Archiver still seems to be sleeping. Check out your system services!')); 
    49934993            connector.hideProgressBar(); 
    4994             connector.resetProgressBarText(); 
     4994            //connector.resetProgressBarText(); 
    49954995            check_services_tryouts = 1; 
    49964996        } 
     
    49994999        write_msg(get_lang('Sorry, but Mail Archiver still seems to be sleeping. Check out your system services!')); 
    50005000        connector.hideProgressBar(); 
    5001         connector.resetProgressBarText(); 
     5001        //connector.resetProgressBarText(); 
    50025002        check_services_tryouts = 1; 
    50035003    } 
  • sandbox/2.5.0-expresso1/expressoMail1_2/templates/default/main.css

    r7157 r7270  
    15821582        vertical-align: middle; 
    15831583} 
     1584 
     1585/* Mail Archive */ 
     1586.local-folder { 
     1587 
     1588} 
     1589 
     1590.local-connect { 
     1591        width: 16px; 
     1592        height: 16px; 
     1593        background: url("images/connect_delete.gif") no-repeat; 
     1594        display: inline-block; 
     1595        cursor: pointer; 
     1596} 
     1597 
     1598.local-admin { 
     1599        width: 16px; 
     1600        height: 16px; 
     1601        background: url("images/config.png") no-repeat; 
     1602        display: inline-block; 
     1603        cursor: pointer; 
     1604} 
  • sandbox/2.5.0-expresso1/prototype/modules/mail/js/foldertree.js

    r7263 r7270  
    9393if(preferences.use_local_messages != 0){ 
    9494 
    95     if(expresso_mail_archive.folders){ //MailArchive 
     95    if(expresso_mail_archive.folders && !expresso_offline && expresso_mail_archive.enabled == true) { //MailArchive 
    9696        //pega pastas locais do mailarchiver e insere no array de pastas 
    9797            expresso_mail_archive.getFoldersList("home"); 
     
    163163            animated: "fast" 
    164164    }).find(".folder").unbind("click").click(function(event){ 
     165 
     166        if ($(this).next().hasClass("local-connect")) { 
     167            return; 
     168        } 
     169 
     170        if ($(this).hasClass("local-folder")) { 
     171            return; 
     172        } 
    165173         
    166174        // MUDANÇA DE PASTAS! 
     
    347355        function(){ 
    348356            //CASO A LI NÃO TENHA UM eventNU FLUTUANTE AINDA, O eventNU É ADICIONADO! 
    349             if(!$(this).children(":last").hasClass("float-menu") && !$(this).children(":last").hasClass("new_folder")){ 
     357            if(!$(this).children(":last").hasClass("float-menu") && !$(this).children(":last").hasClass("new_folder") && !($(this).next().hasClass("local-connect"))){ /*se houver a classe local-connect, não adiciona o botão de conectar*/ 
    350358                var folder_ = $(this); 
    351359                var folder_name; 
  • sandbox/2.5.0-expresso1/prototype/modules/mail/templates/detailedfoldertree.ejs

    r7202 r7270  
    5151  <%}%> 
    5252  <% if(preferences.use_local_messages == 1) { %> 
    53   <li><span class="folder head_folder">Pastas locais</span> 
    54       <% recursive_forest(data.folders[2]); %> 
    55   </li> 
     53     <% if(expresso_mail_archive.enabled && data.folders[2].length > 0) { /*MailArchive ativado*/ %> 
     54        <li> 
     55                <span class="folder local-folder" style="display: inline;">Pastas locais</span> 
     56                <% recursive_forest(data.folders[2]); %> 
     57        </li> 
     58    <%} else { /*MailArchive desativado*/ %> 
     59        <li> 
     60                <span class="folder local-folder" style="display: inline;" title="MailArchive Desconectado">Pastas locais</span> 
     61                <span class="local-connect" onclick="services_retry();" title="Conectar ao MailArchive"></span> 
     62                <a class="local-admin" href="http://127.0.0.1:4333/admin" title="MailArchiver Admin" target="_blank"></a> 
     63        </li> 
     64        <%}%> 
    5665  <%}%> 
    5766  <li><span class="folder head_folder all_accomp followup-messages">Para acompanhamento</span> 
Note: See TracChangeset for help on using the changeset viewer.