Changeset 2712


Ignore:
Timestamp:
05/05/10 15:52:35 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Adaptando todo o expressoAdmin1_2 para não realizar reload.

Location:
trunk
Files:
1 deleted
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoAdmin1_2/inc/class.functions.inc.php

    r1913 r2712  
    416416                        ldap_set_option($ldap_conn, LDAP_OPT_REFERRALS, 0); 
    417417                        ldap_bind($ldap_conn,$dn,$passwd); 
    418                          
     418 
     419                        $sort = array( ); 
    419420                        if ($type == 'accounts') 
    420421                        { 
  • trunk/expressoAdmin1_2/inc/class.group.inc.php

    r587 r2712  
    3434                function validate_fields($params) 
    3535                { 
    36                         return $this->ldap_functions->validate_fields_group($params); 
     36                        return serialize( $this->ldap_functions->validate_fields_group($params) ); 
    3737                } 
    3838                 
  • trunk/expressoAdmin1_2/inc/class.maillist.inc.php

    r585 r2712  
    3535                function validate_fields($params) 
    3636                { 
    37                         return $this->ldap_functions->validate_fields_maillist($params); 
     37                        return serialize( $this->ldap_functions->validate_fields_maillist($params) ); 
    3838                } 
    3939                 
  • trunk/expressoAdmin1_2/inc/class.uiaccounts.inc.php

    r2604 r2712  
    357357                        $script .= '</script>'; 
    358358 
     359                        echo "<style>{$this -> css( )}</style>"; 
    359360                        echo $script; 
    360361 
  • trunk/expressoAdmin1_2/inc/class.uimaillists.inc.php

    r2459 r2712  
    4141                        $GLOBALS['phpgw']->js->validate_file('jscode','expressoadmin','expressoAdmin1_2'); 
    4242                        $GLOBALS['phpgw']->js->validate_file('jscode','maillists','expressoAdmin1_2'); 
     43                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>"; 
    4344                } 
    4445                 
     
    167168                function add_maillists() 
    168169                { 
    169                         $GLOBALS['phpgw']->js->set_onload('get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);'); 
    170  
    171170                        $manager_lid = $GLOBALS['phpgw']->accounts->data['account_lid']; 
    172171                        $manager_acl = $this->functions->read_acl($manager_lid); 
     
    210209                        $p->set_var($var); 
    211210                        $p->set_var($this->functions->make_dinamic_lang($p, 'body')); 
     211 
     212                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>get_available_users(document.forms[0].org_context.value, document.forms[0].ea_check_allUsers.checked);</script>"; 
    212213                        $p->pfp('out','create_maillist'); 
    213214                } 
  • trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php

    r2707 r2712  
    126126                        $p->set_var($var); 
    127127                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>"; 
    128                         //echo "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/controller.php' )}?action=';</script>" . $GLOBALS['phpgw']->js->get_script_links( ); 
    129128                        $p->pfp('out','body'); 
    130129                } 
     
    152151                        // Seta variaveis javascript necessárias 
    153152                        $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
    154                         $scripts_java = '<script type="text/javascript" src="'.$webserver_url.'/expressoAdmin1_2/js/jscode/expressoadmin.js"></script>'; 
    155153                         
    156154                        // App, create list of available apps 
     
    206204                                } 
    207205                        } 
    208                          
     206 
     207                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script_thirst' ] .= "<script>var expressoAdmin_controller = '{$GLOBALS[ 'phpgw' ] -> link( '/expressoAdmin1_2/controller.php' )}?action=';</script>"; 
    209208                        echo $p->fp('out','form'); 
    210209                } 
  • trunk/expressoAdmin1_2/js/jscode/expressoadmin.js

    r2707 r2712  
    99        \************************************************************************************/ 
    1010 
    11 function load_lang(){ 
    12         _controller.cache( ).go( { 
    13                 "access" : "$this/inc/load_lang", 
    14                 "handler" : function( data ) 
    15                 { 
    16                         handler_load_lang( expresso.connector.unserialize( data ) ); 
    17                 } 
    18         } ); 
    19 } 
     11ExpressoLivre.lang( 'expressoAdmin1_2' ); 
    2012 
    2113var global_langs = new Array(); 
    2214var emailSugestion = 1; 
    2315 
    24 function handler_load_lang(data) 
    25 { 
    26         global_langs = eval(data); 
    27 } 
    28  
    29 function get_lang(key_raw) 
    30 { 
    31         key = key_raw.replace(/ /g,"_"); 
    32         key = key.replace(/-/g,""); 
    33         lang = eval("global_langs."+key.toLowerCase()); 
    34          
     16function get_lang( key ) 
     17{ 
     18        var lang = array_lang[ key.toLowerCase( ) ]; 
     19 
    3520        if (typeof(lang)=='undefined') 
    36                 return key_raw + '*'; 
     21                return key + '*'; 
    3722        else 
    3823                return lang; 
     
    229214                campo.value = vr.substr( 0, tam - 1 ); 
    230215} 
    231 load_lang(); 
  • trunk/expressoAdmin1_2/js/jscode/groups.js

    r640 r2712  
    77         
    88        if (document.forms[0].cn.value == ''){ 
    9                 alert(get_lang('NAME field is empty') + '.'); 
     9                alert( ExpressoLivre.translate( 'NAME field is empty' ) + '.'); 
    1010                return; 
    1111        } 
    1212                 
    1313        if (document.forms[0].description.value == ''){ 
    14                 alert(get_lang('DESCRIPTION field is empty') + '.'); 
     14                alert( ExpressoLivre.translate( 'DESCRIPTION field is empty' ) + '.'); 
    1515                return; 
    1616        } 
     
    2121                if ( (cn_tmp.length < 3) || ((cn_tmp[0] != 'grupo') && (cn_tmp[0] != 'smb')) ){ 
    2222                        alert( 
    23                                 get_lang('NAME field is incomplete') + '.\n' + 
    24                                 get_lang('the name field must be formed like') + ':\n' + 
    25                                 get_lang('group') + '-' + get_lang('organization') + '-' + get_lang('group name') + '.\n' + 
    26                                 get_lang('eg') + ': ' + 'grupo-celepar-rh.'); 
     23                                 ExpressoLivre.translate( 'NAME field is incomplete' ) + '.\n' + 
     24                                 ExpressoLivre.translate( 'the name field must be formed like' ) + ':\n' + 
     25                                 ExpressoLivre.translate( 'group' ) + '-' +  ExpressoLivre.translate( 'organization' ) + '-' +  ExpressoLivre.translate( 'group name' ) + '.\n' + 
     26                                 ExpressoLivre.translate( 'eg' ) + ': ' + 'grupo-celepar-rh.'); 
    2727                        return; 
    2828                } 
     
    3333         
    3434        if(!reCn.test(document.forms[0].cn.value)){ 
    35                 alert(get_lang('NAME field contains characters not allowed') + '.'); 
     35                alert( ExpressoLivre.translate( 'NAME field contains characters not allowed' ) + '.'); 
    3636                document.forms[0].cn.focus(); 
    3737                return; 
     
    3939 
    4040        if(!reDesc.test(document.forms[0].description.value)){ 
    41                 alert(get_lang('DESCRIPTION field contains characters not allowed') + '.'); 
     41                alert( ExpressoLivre.translate( 'DESCRIPTION field contains characters not allowed' ) + '.'); 
    4242                document.forms[0].description.focus(); 
    4343                return; 
     
    4747        if ( (document.forms[0].email.value != '') && (!reEmail.test(document.forms[0].email.value)) ) 
    4848        { 
    49                 alert(get_lang('EMAIL field is empty') + '.'); 
     49                alert( ExpressoLivre.translate( 'EMAIL field is empty' ) + '.'); 
    5050                return false; 
    5151        } 
     
    5353        var handler_validate_fields = function(data) 
    5454        { 
     55                data = expresso.connector.unserialize( data.trim( ) ); 
    5556                if (!data.status) 
    5657                        alert(data.msg); 
     
    7172        // O CN do grupo foi alterado ou é um novo grupo. 
    7273        if ((document.forms[0].old_cn.value != document.forms[0].cn.value) || (type == 'create_group')){ 
    73                 cExecute ('$this.group.validate_fields&cn='+document.forms[0].cn.value, handler_validate_fields); 
     74                ExpressoLivre.go( { 
     75                        "access" : 'expressoAdmin1_2.group.validate_fields&cn='+document.forms[0].cn.value, 
     76                        "handler" : handler_validate_fields 
     77                } ); 
    7478        } 
    7579        else if (type == 'edit_group') 
     
    9094                alert(data.msg); 
    9195        else{ 
    92                 alert(get_lang('Group successful created') + '.'); 
     96                alert( ExpressoLivre.translate( 'Group successful created' ) + '.'); 
    9397                location.href="./index.php?menuaction=expressoAdmin1_2.uigroups.list_groups"; 
    9498        } 
     
    107111                alert(data.msg); 
    108112        else{ 
    109                 alert(get_lang('Group successful saved') + '.'); 
     113                alert( ExpressoLivre.translate( 'Group successful saved' ) + '.'); 
    110114                location.href="./index.php?menuaction=expressoAdmin1_2.uigroups.list_groups"; 
    111115        } 
     
    156160        if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_groups').value)) 
    157161        { 
    158                 alert(get_lang('It is not allow select all users from the root organization') + '.'); 
     162                alert( ExpressoLivre.translate( 'It is not allow select all users from the root organization' ) + '.'); 
    159163                document.getElementById('ea_check_allUsers').checked = false; 
    160164 
     
    165169                return; 
    166170        } 
    167         cExecute ('$this.ldap_functions.get_available_users&context='+context+'&recursive='+recursive, handler_get_available_users); 
     171        ExpressoLivre.go( { 
     172                "access" : 'expressoAdmin1_2.ldap_functions.get_available_users&context='+escape(context)+'&recursive='+recursive, 
     173                "handler" : handler_get_available_users 
     174        } ); 
    168175} 
    169176 
     
    241248        clearTimeout(finderTimeout);     
    242249        var oWait = document.getElementById("ea_span_searching"); 
    243         oWait.innerHTML = get_lang('Searching') + '...'; 
     250        oWait.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...'; 
    244251        var finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
    245252} 
     
    270277function delete_group(cn, gidnumber) 
    271278{ 
    272         if (confirm(get_lang('Do you really want delete the group') + ' ' + cn + " ??")) 
     279        if (confirm( ExpressoLivre.translate( 'Do you really want delete the group' ) + ' ' + cn + " ??")) 
    273280        { 
    274281                var handler_delete_group = function(data) 
     
    277284                                alert(data.msg); 
    278285                        else 
    279                                 alert(get_lang('Group success deleted') + '.'); 
     286                                alert( ExpressoLivre.translate( 'Group success deleted' ) + '.'); 
    280287                         
    281288                        location.href="./index.php?menuaction=expressoAdmin1_2.uigroups.list_groups"; 
  • trunk/expressoAdmin1_2/js/jscode/institutional_accounts.js

    r2707 r2712  
    2424        { 
    2525                close_lightbox(); 
    26                 write_msg(get_lang('Institutional account successful created') + '.', 'normal'); 
     26                write_msg( ExpressoLivre.translate( 'Institutional account successful created' ) + '.', 'normal'); 
    2727        } 
    2828        return; 
     
    101101        clearTimeout(finderTimeout); 
    102102        var oWait = Element("ea_span_searching"); 
    103         oWait.innerHTML = get_lang('searching') + '...'; 
     103        oWait.innerHTML =  ExpressoLivre.translate( 'searching' ) + '...'; 
    104104        finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
    105105} 
     
    188188function get_institutional_accounts_timeOut(input) 
    189189{ 
    190         var head_table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+get_lang("full name")+'</td><td width="30%">'+get_lang("mail")+'</td><td width="5%" align="center">'+get_lang("remove")+'</td></tr></table>'; 
     190        var head_table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+ ExpressoLivre.translate( "full name" )+'</td><td width="30%">'+ ExpressoLivre.translate( "mail" )+'</td><td width="5%" align="center">'+ ExpressoLivre.translate( "remove" )+'</td></tr></table>'; 
    191191         
    192192        if (input.length > 4) 
     
    208208                if (data.status == 'true') 
    209209                { 
    210                         var table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+get_lang("full name")+'</td><td width="30%">'+get_lang("mail")+'</td><td width="5%" align="center">'+get_lang("remove")+'</td></tr>'+data.trs+'</table>'; 
     210                        var table = '<table border="0" width="90%"><tr bgcolor="#d3dce3"><td width="30%">'+ ExpressoLivre.translate( "full name" )+'</td><td width="30%">'+ ExpressoLivre.translate( "mail" )+'</td><td width="5%" align="center">'+ ExpressoLivre.translate( "remove" )+'</td></tr>'+data.trs+'</table>'; 
    211211                        Element('institutional_accounts_content').innerHTML = table; 
    212212                } 
     
    293293                get_institutional_accounts(Element('ea_institutional_account_search').value); 
    294294                close_lightbox(); 
    295                 write_msg(get_lang('Institutional account successful saved') + '.', 'normal'); 
     295                write_msg( ExpressoLivre.translate( 'Institutional account successful saved' ) + '.', 'normal'); 
    296296        } 
    297297        return; 
     
    300300function delete_institutional_accounts(uid) 
    301301{ 
    302         if (!confirm(get_lang('Are you sure that you want to delete this institutional account') + "?")) 
     302        if (!confirm( ExpressoLivre.translate( 'Are you sure that you want to delete this institutional account' ) + "?")) 
    303303                return; 
    304304         
     
    311311                else 
    312312                { 
    313                         write_msg(get_lang('Institutional account successful deleted') + '.', 'normal'); 
     313                        write_msg( ExpressoLivre.translate( 'Institutional account successful deleted' ) + '.', 'normal'); 
    314314                        get_institutional_accounts(Element('ea_institutional_account_search').value); 
    315315                } 
  • trunk/expressoAdmin1_2/js/jscode/maillists.js

    r482 r2712  
    66 
    77        if (document.forms[0].uid.value == ''){ 
    8                 alert(get_lang('login field is empty') + '.'); 
     8                alert( ExpressoLivre.translate( 'login field is empty' ) + '.'); 
    99                return; 
    1010        } 
    1111 
    1212        if (document.forms[0].cn.value == ''){ 
    13                 alert(get_lang('name field is empty') + '.'); 
     13                alert( ExpressoLivre.translate( 'name field is empty' ) + '.'); 
    1414                return; 
    1515        } 
     
    2020                if ((uid_tmp.length < 3) || (uid_tmp[0] != 'lista')){ 
    2121                        alert( 
    22                                 get_lang('login field is incomplete') + '.\n' + 
    23                                 get_lang('the login field must be formed like') + ':\n' + 
    24                                 get_lang('list') + '-' + get_lang('organization') + '-' + get_lang('listname') + '.\n' + 
    25                                 get_lang('eg') + ': ' + 'lista-celepar-rh.'); 
     22                                 ExpressoLivre.translate( 'login field is incomplete' ) + '.\n' + 
     23                                 ExpressoLivre.translate( 'the login field must be formed like' ) + ':\n' + 
     24                                 ExpressoLivre.translate( 'list' ) + '-' +  ExpressoLivre.translate( 'organization' ) + '-' +  ExpressoLivre.translate( 'listname' ) + '.\n' + 
     25                                 ExpressoLivre.translate( 'eg' ) + ': ' + 'lista-celepar-rh.'); 
    2626                        return; 
    2727                } 
     
    2929                 
    3030        if (document.forms[0].uid.value.split(" ").length > 1){ 
    31                 alert(get_lang('LOGIN field contains characters not allowed') + '.'); 
     31                alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' ) + '.'); 
    3232                document.forms[0].uid.focus(); 
    3333                return; 
     
    3535         
    3636        if (document.forms[0].mail.value == ''){ 
    37                 alert(get_lang('EMAIL field is empty') + '.'); 
     37                alert( ExpressoLivre.translate( 'EMAIL field is empty' ) + '.'); 
    3838                document.forms[0].mail.focus(); 
    3939                return; 
     
    4141        var reEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; 
    4242        if(!reEmail.test(document.forms[0].mail.value)){ 
    43                 alert(get_lang('Email field is not valid') + '.'); 
     43                alert( ExpressoLivre.translate( 'Email field is not valid' ) + '.'); 
    4444                return false; 
    4545        } 
     
    4747        select_userInMaillist = document.getElementById('ea_select_usersInMaillist'); 
    4848        if (select_userInMaillist.options.length == 0){ 
    49                 alert(get_lang('Any user is in the list') + '.'); 
     49                alert( ExpressoLivre.translate( 'Any user is in the list' ) + '.'); 
    5050                return; 
    5151        } 
     
    5353        var handler_validate_fields = function(data) 
    5454        { 
     55                data = expresso.connector.unserialize( data.trim( ) ); 
    5556                if (!data.status) 
    5657                        alert(data.msg); 
     
    7677        // O UID da lista foi alterado ou é uma nova lista. 
    7778        if ((document.forms[0].old_uid.value != document.forms[0].uid.value) || (type == 'create_maillist')){ 
    78                 cExecute ('$this.maillist.validate_fields&uid='+document.forms[0].uid.value+'&mail='+document.forms[0].mail.value, handler_validate_fields); 
     79                ExpressoLivre.go( { 
     80                        "access" : 'expressoAdmin1_2.maillist.validate_fields&uid='+document.forms[0].uid.value+'&mail='+document.forms[0].mail.value, 
     81                        "handler" : handler_validate_fields 
     82                } ); 
    7983        } 
    8084        else if (type == 'edit_maillist') 
     
    9599                alert(data.msg); 
    96100        else{ 
    97                 alert(get_lang('Email list successful created') + '.'); 
     101                alert( ExpressoLivre.translate( 'Email list successful created' ) + '.'); 
    98102                location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists"; 
    99103        } 
     
    109113function return_handler_save(data) 
    110114{ 
     115        alert( data ); 
    111116        if (!data.status) 
    112117                alert(data.msg); 
    113118        else{ 
    114                 alert(get_lang('Email list successful saved') + '.'); 
     119                alert( ExpressoLivre.translate( 'Email list successful saved' ) + '.'); 
    115120                location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists"; 
    116121        } 
     
    137142                alert(data.msg); 
    138143        else 
    139                 alert(get_lang('SCL successful saved') + '.'); 
     144                alert( ExpressoLivre.translate( 'SCL successful saved' ) + '.'); 
    140145        location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists"; 
    141146        return; 
     
    181186                } 
    182187        } 
    183          
     188 
    184189        //Impede chamada recursiva na raiz das organizações 
    185190        if ((recursive) && (document.forms[0].ldap_context.value == document.getElementById('ea_combo_org_maillists').value)) 
    186191        { 
    187                 alert(get_lang('It is not allow select all users from the root organization') + '.'); 
     192                alert( ExpressoLivre.translate( 'It is not allow select all users from the root organization' ) + '.'); 
    188193                document.getElementById('ea_check_allUsers').checked = false; 
    189                  
     194 
    190195                // Limpa select 
    191196                select_available_users = document.getElementById('ea_select_available_users'); 
     
    194199                return; 
    195200        } 
    196         cExecute ('$this.ldap_functions.get_available_users_and_maillist&context='+context+'&recursive='+recursive+'&denied_uidnumber='+document.forms[0].uidnumber.value, handler_get_available_users); 
     201        ExpressoLivre.go( { 
     202                "access" : 'expressoAdmin1_2.ldap_functions.get_available_users_and_maillist&context='+escape(context)+'&recursive='+recursive+'&denied_uidnumber='+document.forms[0].uidnumber.value, 
     203                "handler" : handler_get_available_users 
     204        } ); 
    197205} 
    198206 
     
    325333        clearTimeout(finderTimeout);     
    326334        var oWait = document.getElementById("ea_span_searching"); 
    327         oWait.innerHTML = get_lang('Searching') + '...'; 
     335        oWait.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...'; 
    328336        finderTimeout = setTimeout("optionFinder('"+obj.id+"')",500); 
    329337} 
     
    358366function delete_maillist(uid, uidnumber) 
    359367{ 
    360         if (confirm(get_lang('Do you really want delete the email list') + ' ' + uid + " ??")) 
     368        if (confirm( ExpressoLivre.translate( 'Do you really want delete the email list' ) + ' ' + uid + " ??")) 
    361369         
    362370        { 
     
    366374                                alert(data.msg); 
    367375                        else 
    368                                 alert(get_lang('Email list successful deleted') + '.'); 
     376                                alert( ExpressoLivre.translate( 'Email list successful deleted' ) + '.'); 
    369377                         
    370378                        location.href="./index.php?menuaction=expressoAdmin1_2.uimaillists.list_maillists"; 
     
    414422        for (x in array_dn) 
    415423        { 
     424                if ( array_dn[ x ].constructor == Function ) 
     425                        continue; 
     426 
    416427                var tmp = array_dn[x].split("="); 
    417428                ufn += tmp[1] + '.'; 
  • trunk/expressoAdmin1_2/js/jscode/managers.js

    r2030 r2712  
    22function copy_manager(manager) 
    33{ 
    4         if (!(new_manager = prompt(get_lang('Type new managers login') + ':',""))) 
     4        if (!(new_manager = prompt( ExpressoLivre.translate( 'Type new managers login' ) + ':',""))) 
    55        { 
    66                return; 
     
    1212                        location.reload(); 
    1313                else 
    14                         alert(get_lang('Error at copy manager') + '.'); 
     14                        alert( ExpressoLivre.translate( 'Error at copy manager' ) + '.'); 
    1515        } 
    1616        cExecute ('$this.db_functions.copy_manager&manager='+manager+'&new_manager='+new_manager, handler_copy_manager); 
     
    2626                if (new_context_value.indexOf(children[i].value) != -1) 
    2727                { 
    28                         document.getElementById("ea_spam_warn").innerHTML = get_lang('Context already added or redundant') + '.'; 
     28                        document.getElementById("ea_spam_warn").innerHTML =  ExpressoLivre.translate( 'Context already added or redundant' ) + '.'; 
    2929                        setTimeout("document.getElementById(\"ea_spam_warn\").innerHTML = '&nbsp;'", 4000); 
    3030                        return; 
     
    3535                        children[i].parentNode.parentNode.removeChild(children[i].parentNode); 
    3636                        --i; 
    37                         document.getElementById("ea_spam_warn").innerHTML = get_lang('Removed context redundant') + '.'; 
     37                        document.getElementById("ea_spam_warn").innerHTML =  ExpressoLivre.translate( 'Removed context redundant' ) + '.'; 
    3838                        setTimeout("document.getElementById(\"ea_spam_warn\").innerHTML = '&nbsp;'", 4000); 
    3939                } 
     
    103103        { 
    104104                if (data.type == 'create') 
    105                         alert(get_lang('User successful created') + '.'); 
     105                        alert( ExpressoLivre.translate( 'User successful created' ) + '.'); 
    106106                else 
    107                         alert(get_lang('Manager successful saved') + '.'); 
     107                        alert( ExpressoLivre.translate( 'Manager successful saved' ) + '.'); 
    108108        } 
    109109        location.href="./index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers"; 
     
    118118        var spam = document.getElementById('ea_span_searching_manager'); 
    119119        if (manager_lid.length <= 3) 
    120                 spam.innerHTML = get_lang('Type more') + ' ' + (4 - manager_lid.length) + ' ' + 'letters' + '.'; 
     120                spam.innerHTML =  ExpressoLivre.translate( 'Type more' ) + ' ' + (4 - manager_lid.length) + ' ' + 'letters' + '.'; 
    121121        else 
    122122        { 
    123                 spam.innerHTML = get_lang('Searching') + '...'; 
     123                spam.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...'; 
    124124                searchTimeout = setTimeout("search_user('"+manager_lid+"')",750); 
    125125        } 
  • trunk/expressoAdmin1_2/js/jscode/users.js

    r2604 r2712  
    88                 
    99                if (document.forms[0].uid.value == ''){ 
    10                         alert(get_lang('LOGIN field is empty') + '.'); 
     10                        alert( ExpressoLivre.translate( 'LOGIN field is empty' ) + '.'); 
    1111                        return; 
    1212                } 
    1313                else if (document.forms[0].uid.value.length < document.forms[0].minimumSizeLogin.value){ 
    14                         alert(get_lang('LOGIN field must be bigger than') + ' ' + document.forms[0].minimumSizeLogin.value + ' ' + get_lang('characters') + '.'); 
     14                        alert( ExpressoLivre.translate( 'LOGIN field must be bigger than' )  + ' ' + document.forms[0].minimumSizeLogin.value + ' ' +  ExpressoLivre.translate( 'characters' ) + '.'); 
    1515                        return; 
    1616                } 
     
    2222                        var reUid = /^([a-zA-Z0-9_\-])+$/; 
    2323                if(!reUid.test(document.forms[0].uid.value)){ 
    24                         alert(get_lang('LOGIN field contains characters not allowed') + '.'); 
     24                        alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' ) + '.'); 
    2525                        return; 
    2626                } 
     
    2828                //PASSWORD's 
    2929                if (document.forms[0].password1.value == ''){ 
    30                         alert(get_lang('Password field is empty') + '.'); 
     30                        alert( ExpressoLivre.translate( 'Password field is empty' ) + '.'); 
    3131                        return; 
    3232                } 
    3333                if (document.forms[0].password2.value == ''){ 
    34                         alert(get_lang('repassword field is empty') + '.'); 
     34                        alert( ExpressoLivre.translate( 'repassword field is empty' ) + '.'); 
    3535                        return; 
    3636                } 
     
    3838 
    3939        if (document.forms[0].password1.value != document.forms[0].password2.value){ 
    40                 alert(get_lang('password and repassword are different') + '.'); 
     40                alert( ExpressoLivre.translate( 'password and repassword are different' ) + '.'); 
    4141                return; 
    4242        } 
     
    4949                if(!re_employeenumber.test(document.forms[0].corporative_information_employeenumber.value)) 
    5050                { 
    51                         alert(get_lang('EmployeeNumber contains characters not allowed') + '. ' + get_lang('Only numbers are allowed') + '.'); 
     51                        alert( ExpressoLivre.translate( 'EmployeeNumber contains characters not allowed' )  + '. ' +  ExpressoLivre.translate( 'Only numbers are allowed' ) + '.'); 
    5252                        document.forms[0].corporative_information_employeenumber.focus(); 
    5353                        return; 
     
    5858        document.forms[0].mail.value = document.forms[0].mail.value.toLowerCase(); 
    5959        if (document.forms[0].mail.value == ''){ 
    60                 alert(get_lang('Email field is empty') + '.'); 
     60                alert( ExpressoLivre.translate( 'Email field is empty' ) + '.'); 
    6161                return; 
    6262        } 
    6363        var reEmail = /^([a-zA-Z0-9_\-])+(\.[a-zA-Z0-9_\-]+)*\@([a-zA-Z0-9_\-])+(\.[a-zA-Z0-9_\-]+)*$/; 
    6464        if(!reEmail.test(document.forms[0].mail.value)){ 
    65                 alert(get_lang('Email field is not valid') + '.'); 
     65                alert( ExpressoLivre.translate( 'Email field is not valid' ) + '.'); 
    6666                return false; 
    6767        } 
     
    7070        var reGivenname = /^[a-zA-Z0-9 \-\.]+$/; 
    7171        if(!reGivenname.test(document.forms[0].givenname.value)){ 
    72                 alert(get_lang('First name field contains characters not allowed') + '.'); 
     72                alert( ExpressoLivre.translate( 'First name field contains characters not allowed' ) + '.'); 
    7373                return false; 
    7474        } 
    7575        else if (document.forms[0].givenname.value == ''){ 
    76                 alert(get_lang('First name field is empty') + '.'); 
     76                alert( ExpressoLivre.translate( 'First name field is empty' ) + '.'); 
    7777                return; 
    7878        } 
     
    8181        var reSn = /^[a-zA-Z0-9 \-\.]+$/; 
    8282        if(!reSn.test(document.forms[0].sn.value)){ 
    83                 alert(get_lang('Last name field contains characters not allowed') + '.'); 
     83                alert( ExpressoLivre.translate( 'Last name field contains characters not allowed' ) + '.'); 
    8484                return false; 
    8585        } 
    8686        else if (document.forms[0].sn.value == ''){ 
    87                 alert(get_lang('Last name field is empty') + '.'); 
     87                alert( ExpressoLivre.translate( 'Last name field is empty' ) + '.'); 
    8888                return; 
    8989        } 
     
    9595                if (!reg_tel.exec(document.forms[0].telephonenumber.value)) 
    9696                { 
    97                         alert(get_lang('Phone field is incorrect') + '.'); 
     97                        alert( ExpressoLivre.translate( 'Phone field is incorrect' ) + '.'); 
    9898                        return; 
    9999                } 
     
    102102        //FORWAR ONLY 
    103103        if ((document.forms[0].deliverymode.checked) && (document.forms[0].mailforwardingaddress.value == '')){ 
    104                 alert(get_lang('Forward email is empty') + '.'); 
     104                alert( ExpressoLivre.translate( 'Forward email is empty' ) + '.'); 
    105105                return; 
    106106        } 
     
    108108        // Email Quota 
    109109        if (document.forms[0].mailquota.value == ''){ 
    110                 alert(get_lang('User without email quota') + '.'); 
     110                alert( ExpressoLivre.translate( 'User without email quota' ) + '.'); 
    111111                return; 
    112112        } 
     
    114114        //GROUPS 
    115115        if (document.getElementById('ea_select_user_groups').length < 1){ 
    116                 alert(get_lang('User is not in any group') + '.'); 
     116                alert( ExpressoLivre.translate( 'User is not in any group' ) + '.'); 
    117117                return; 
    118118        } 
     
    121121        if (document.getElementById('tabcontent6').style.display != 'none'){ 
    122122                if ((document.forms[0].sambalogonscript.value == '') && (!document.forms[0].sambalogonscript.disabled)){ 
    123                         alert(get_lang('Logon script is empty') + '.'); 
     123                        alert( ExpressoLivre.translate( 'Logon script is empty' ) + '.'); 
    124124                        return; 
    125125                } 
    126126                if ((document.forms[0].sambahomedirectory.value == '') && (!document.forms[0].sambahomedirectory.disabled)){ 
    127                         alert(get_lang('Users home directory is empty') + '.'); 
     127                        alert( ExpressoLivre.translate( 'Users home directory is empty' ) + '.'); 
    128128                        return; 
    129129                } 
     
    197197function generate_login(first_name,second_name) { 
    198198        if ((first_name=='') || (second_name=='')) { 
    199                 alert(get_lang("You must type the first and the second name before generate the login")); 
     199                alert( ExpressoLivre.translate( "You must type the first and the second name before generate the login" ) ); 
    200200                return; 
    201201        } 
     
    229229                alert(data.msg); 
    230230        else 
    231                 alert(get_lang('User successful created') + '.'); 
     231                alert( ExpressoLivre.translate( 'User successful created' ) + '.'); 
    232232 
    233233        location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users"; 
     
    248248        } 
    249249        else{ 
    250                 alert(get_lang('User successful saved') + '.'); 
     250                alert( ExpressoLivre.translate( 'User successful saved' ) + '.'); 
    251251        } 
    252252        location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users"; 
     
    258258        var handler_get_available_groups = function(data) 
    259259        { 
     260                data = data.trim( ); 
    260261                select_available_groups = document.getElementById('ea_select_available_groups'); 
    261262 
     
    274275                        select_available_groups.outerHTML = select_available_groups.outerHTML; 
    275276                } 
    276         }        
    277                  
    278         _controller.go( { 
    279                 "access" : "$this.ldap_functions.get_available_groups&context="+context, 
    280                 "handler" : function( data ) 
    281                 { 
    282                         handler_get_available_groups( expresso.connector.unserialize( data ) ); 
    283                 } 
     277        } 
     278 
     279        ExpressoLivre.go( { 
     280                "access" : "expressoAdmin1_2.ldap_functions.get_available_groups&context="+escape(context), 
     281                "handler" : handler_get_available_groups 
    284282        } ); 
    285283} 
     
    377375                } 
    378376        } 
    379         _controller.go( { 
    380                 "access" : "$this.ldap_functions.get_available_maillists&context=" + context, 
    381                 "handler" : function( data ) 
    382                 { 
    383                         handler_get_available_maillists( expresso.connector.unserialize( data ) ); 
    384                 } 
     377        ExpressoLivre.go( { 
     378                "access" : "expressoAdmin1_2.ldap_functions.get_available_maillists&context=" + context, 
     379                "handler" : handler_get_available_maillists 
    385380        } ); 
    386381} 
     
    483478                        alert(data.msg); 
    484479                else 
    485                         alert(get_lang('Default password successful saved') + '.'); 
     480                        alert( ExpressoLivre.translate( 'Default password successful saved' ) + '.'); 
    486481                return; 
    487482        } 
     
    496491                        alert(data.msg); 
    497492                else 
    498                         alert(get_lang('Users password successful returned') + '.'); 
     493                        alert( ExpressoLivre.translate( 'Users password successful returned' ) + '.'); 
    499494                return; 
    500495        } 
     
    504499function delete_user(uid, uidnumber) 
    505500{ 
    506         if (confirm(get_lang("Do you really want delete the user") + " " + uid + "?")) 
     501        if (confirm( ExpressoLivre.translate( "Do you really want delete the user" ) + " " + uid + "?")) 
    507502        { 
    508503                var handler_delete_user = function(data) 
     
    511506                                alert(data.msg); 
    512507                        else 
    513                                 alert(get_lang('User successful deleted') + '.'); 
     508                                alert( ExpressoLivre.translate( 'User successful deleted' ) + '.'); 
    514509                         
    515510                        location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users"; 
     
    527522                var reUid = /^([a-zA-Z0-9_\-])+$/; 
    528523 
    529         new_uid = prompt(get_lang('Rename users login from') + ': ' + uid + " " + get_lang("to") + ': ', uid); 
     524        new_uid = prompt( ExpressoLivre.translate( 'Rename users login from' )  + ': ' + uid + " " +  ExpressoLivre.translate( "to" ) + ': ', uid); 
    530525 
    531526        if(!reUid.test(new_uid)){ 
    532                 alert(get_lang('LOGIN field contains characters not allowed') + '.'); 
     527                alert( ExpressoLivre.translate( 'LOGIN field contains characters not allowed' ) + '.'); 
    533528                document.forms[0].account_lid.focus(); 
    534529                return; 
     
    563558                alert(data.msg); 
    564559        else{ 
    565                 alert(get_lang('User login successful renamed') + "\n" + data.exec_return); 
     560                alert( ExpressoLivre.translate( 'User login successful renamed' ) + "\n" + data.exec_return); 
    566561                location.href="./index.php?menuaction=expressoAdmin1_2.uiaccounts.list_users"; 
    567562        } 
     
    579574        clearTimeout(finderTimeout_maillist); 
    580575        var oWait = document.getElementById("ea_span_searching_maillist"); 
    581         oWait.innerHTML = get_lang('Searching') + '...'; 
     576        oWait.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...'; 
    582577        finderTimeout_maillist = setTimeout("optionFinder_maillist('"+obj.id+"')",500); 
    583578} 
     
    613608        clearTimeout(finderTimeout_group); 
    614609        var oWait = document.getElementById("ea_span_searching_group"); 
    615         oWait.innerHTML = get_lang('Searching') + '...'; 
     610        oWait.innerHTML =  ExpressoLivre.translate( 'Searching' ) + '...'; 
    616611        finderTimeout_group = setTimeout("optionFinder_group('"+obj.id+"')",500); 
    617612} 
     
    671666function empty_inbox(uid) 
    672667{ 
    673         var action = get_lang('Cleanned user mailbox'); 
     668        var action =  ExpressoLivre.translate( 'Cleanned user mailbox' ) ; 
    674669        var handler_write_log = function(){} 
    675670        var handler_empty_inbox = function(data) 
     
    679674                else{ 
    680675                        cExecute ('$this.user.write_log_from_ajax&_action='+action+'&userinfo='+uid, handler_write_log); 
    681                         alert(get_lang('Emptied')+' '+ data.inbox_size + ' ' + get_lang('MB from user inbox')); 
     676                        alert( ExpressoLivre.translate( 'Emptied' ) +' '+ data.inbox_size + ' ' +  ExpressoLivre.translate( 'MB from user inbox' ) ); 
    682677                        document.getElementById('mailquota_used').value = data.mailquota_used; 
    683678                } 
     
    765760                } 
    766761} 
    767  
    768  
  • trunk/expressoAdmin1_2/js/modal/modal.js

    r2459 r2712  
    8585        objCaption.setAttribute('id','lightboxFoot'); 
    8686 
    87         var close_button = '<input type=button value="'+get_lang('close')+'" onClick='+close_action+'>'; 
     87        var close_button = '<input type=button value="'+ExpressoLivre.translate( 'close' )+'" onClick='+close_action+'>'; 
    8888        if (type == 'create') 
    89                 var create_save_button = '<input type=button value="'+get_lang('create')+'" onClick='+create_action+'>'; 
     89                var create_save_button = '<input type=button value="'+ExpressoLivre.translate( 'create' )+'" onClick='+create_action+'>'; 
    9090        else if(type == 'save') 
    91                 var create_save_button = '<input type=button value="'+get_lang('save')+'" onClick='+save_action+'>'; 
     91                var create_save_button = '<input type=button value="'+ExpressoLivre.translate( 'save' )+'" onClick='+save_action+'>'; 
    9292        objCaption.innerHTML = '<table width=100% cellspacing="0" cellpadding="0"><tr><td align=left>'+close_button+'</td><td align=right>'+create_save_button+'</td></tr></table>' 
    9393         
     
    194194        return; 
    195195} 
    196 /* 
    197 function load_lang(){ 
    198         cExecute ('$this/js/modal/inc/load_lang', handler_load_lang); 
    199 } 
    200  
    201 var global_langs = new Array(); 
    202 function handler_load_lang(data) 
    203 { 
    204         global_langs = eval(data); 
    205 } 
    206  
    207 function get_lang(key_raw) 
    208 { 
    209         key = key_raw.replace(/ /g,"_"); 
    210  
    211         try{ 
    212                 lang = eval("global_langs."+key.toLowerCase()); 
    213                 return lang; 
    214         } 
    215         catch(e){ 
    216                 return key_raw + '*'; 
    217         } 
    218 }*/ 
    219196 
    220197function make_msg(msg, type) 
     
    294271 
    295272add_css(); 
    296 //load_lang(); 
  • trunk/expressoAdmin1_2/templates/default/accounts.tpl

    r477 r2712  
    77                        <tr> 
    88                                <td align="left" width="25%"> 
    9                                         <form name="form" method="POST" action="{add_action}"> 
    10                                                 <input type="submit" value="{lang_create_user}" "{create_user_disabled}"> 
    11                                                 <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
    12                                         </form> 
     9                                        <input type="button" value="{lang_create_user}" "{create_user_disabled}" onclick="ExpressoLivre.link( '{add_action}' )" /> 
     10                                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    1311                                </td> 
    1412                                <td align="center" "left" width="50%"> 
     
    1614                                </td> 
    1715                                <td align="right" "left" width="25%"> 
    18                                         <form method="POST" action="{accounts_url}"> 
     16                                        <form method="POST" action="{accounts_url}" onsubmit="ExpressoLivre.link( '{accounts_url}', false, 'query='+this.query.value ); return false;"> 
    1917                                                {lang_search}: 
    2018                                                <input type="text" name="query" autocomplete="off" value="{query}"> 
     
    3735                        {rows} 
    3836                        <tr> 
    39                                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     37                                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    4038                        </tr> 
    4139                </table> 
  • trunk/expressoAdmin1_2/templates/default/accounts_form.tpl

    r2632 r2712  
    33<script type="text/javascript"> 
    44var tab = new Tabs(7,'activetab','inactivetab','tab','tabcontent','','','tabpage'); 
    5 function initAll() 
    6 { 
    7         tab.init(); 
    8 } 
     5tab.init(); 
    96{alert_warning}; 
    107</script> 
     
    2724<table width="90%" border="0" cellspacing="0" cellpading="0"> 
    2825        <tr> 
    29                 <th id="tab1" class="activetab" onclick="javascript:tab.display(1);"><a href="#" tabindex="0" accesskey="1" onfocus="tab.display(1);" onclick="tab.display(1); return(false);">{lang_general_information}</a></th> 
    30                 <th id="tab2" class="activetab" style="display:{display_corporative_information}"onclick="javascript:tab.display(2);"><a href="#" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);">{lang_corporative_information}</a></th> 
    31                 <th id="tab3" class="activetab" style="display:{display_emailconfig}"   onclick="javascript:tab.display(3);"><a href="#" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);">{lang_email_config}</a></th> 
    32                 <th id="tab4" class="activetab" style="display:{display_groups}"                onclick="javascript:tab.display(4);"><a href="#" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);">{lang_groups_permission}</a></th> 
    33                 <th id="tab5" class="activetab" style="display:{display_emaillists}"    onclick="javascript:tab.display(5);"><a href="#" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);">{lang_email_lists}</a></th> 
    34                 <th id="tab6" class="activetab" style="display:{display_applications}"  onclick="javascript:tab.display(6);"><a href="#" tabindex="0" accesskey="6" onfocus="tab.display(6);" onclick="tab.display(6); return(false);">{lang_aplication_permission}</a></th> 
    35                 <th id="tab7" class="activetab" style="display:{display_samba_suport}"  onclick="javascript:tab.display(7);"><a href="#" tabindex="0" accesskey="7" onfocus="tab.display(7);" onclick="tab.display(7); return(false);">{lang_samba_config}</a></th> 
     26                <th id="tab1" class="activetab" onclick="javascript:tab.display(1);"><a href="javascript:" tabindex="0" accesskey="1" onfocus="tab.display(1);" onclick="tab.display(1); return(false);">{lang_general_information}</a></th> 
     27                <th id="tab2" class="activetab" style="display:{display_corporative_information}"onclick="javascript:tab.display(2);"><a href="javascript:" tabindex="0" accesskey="2" onfocus="tab.display(2);" onclick="tab.display(2); return(false);">{lang_corporative_information}</a></th> 
     28                <th id="tab3" class="activetab" style="display:{display_emailconfig}"   onclick="javascript:tab.display(3);"><a href="javascript:" tabindex="0" accesskey="3" onfocus="tab.display(3);" onclick="tab.display(3); return(false);">{lang_email_config}</a></th> 
     29                <th id="tab4" class="activetab" style="display:{display_groups}"                onclick="javascript:tab.display(4);"><a href="javascript:" tabindex="0" accesskey="4" onfocus="tab.display(4);" onclick="tab.display(4); return(false);">{lang_groups_permission}</a></th> 
     30                <th id="tab5" class="activetab" style="display:{display_emaillists}"    onclick="javascript:tab.display(5);"><a href="javascript:" tabindex="0" accesskey="5" onfocus="tab.display(5);" onclick="tab.display(5); return(false);">{lang_email_lists}</a></th> 
     31                <th id="tab6" class="activetab" style="display:{display_applications}"  onclick="javascript:tab.display(6);"><a href="javascript:" tabindex="0" accesskey="6" onfocus="tab.display(6);" onclick="tab.display(6); return(false);">{lang_aplication_permission}</a></th> 
     32                <th id="tab7" class="activetab" style="display:{display_samba_suport}"  onclick="javascript:tab.display(7);"><a href="javascript:" tabindex="0" accesskey="7" onfocus="tab.display(7);" onclick="tab.display(7); return(false);">{lang_samba_config}</a></th> 
    3633        </tr> 
    3734</table> 
     
    4340                <tr bgcolor={row_on}> 
    4441                        <td>{lang_search_organization}:</td> 
    45                         <td><input type="text" id="organization_search" {disabled} autocomplete="off" size=20 onKeyUp="javascript:search_organization(this.value, 'ea_combo_org_info');" onBlur="javascript:sinc_combos_org(context.value); get_associated_domain(context.value); get_available_groups(context.value); get_available_maillists(context.value); get_available_sambadomains(context.value, '{type}')"></td> 
     42                        <td><input type="text" id="organization_search" {disabled} autocomplete="off" size=20 onkeyup="javascript:search_organization(this.value, 'ea_combo_org_info');" onBlur="javascript:sinc_combos_org(context.value); get_associated_domain(context.value); get_available_groups(context.value); get_available_maillists(context.value); get_available_sambadomains(context.value, '{type}')"></td> 
    4643                </tr> 
    4744 
     
    298295                                                        {lang_search_organization}: 
    299296                                                        <br> 
    300                                                         <input type="text" id="organization_search" autocomplete="off" size=20 onKeyUp="javascript:search_organization(this.value, 'ea_combo_org_maillists');" onblur="javascript:get_available_maillists(ea_combo_org_maillists.value);"> 
     297                                                        <input type="text" id="organization_search" autocomplete="off" size=20 onkeyup="javascript:search_organization(this.value, 'ea_combo_org_maillists');" onblur="javascript:get_available_maillists(ea_combo_org_maillists.value);"> 
    301298                                                        <br> 
    302299                                                        {lang_organizations}: 
     
    376373        <tr>     
    377374                <td width="90%" align="left"  class="td_left" bgcolor="{color_bg1}"> 
    378                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     375                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    379376                </td> 
    380377                <td width="10%" align="right" class="td_right" bgcolor="{color_bg1}"> 
  • trunk/expressoAdmin1_2/templates/default/groups.tpl

    r309 r2712  
    55    <tr> 
    66                <td align="left" width="25%"> 
    7                         <form name="form" method="POST" action="{add_action}"> 
    8                                 <input type="submit" value="{lang_add_groups}" "{add_group_disabled}"> 
    9                                 <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
    10                         </form> 
     7                        <input type="button" value="{lang_add_groups}" "{add_group_disabled}" onclick="ExpressoLivre.link( '{add_action}' )" /> 
     8                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    119                </td> 
    1210                <td align="center" "left" width="50%"> 
     
    1412                </td> 
    1513        <td align="right" "left" width="25%"> 
    16                 <form method="POST" action="{accounts_url}"> 
     14                <form method="POST" action="{accounts_url}" onsubmit="ExpressoLivre.link( '{accounts_url}', false, 'query='+this.query.value ); return false;"> 
    1715                        {lang_search}: 
    18                         <input type="text" name="query" autocomplete="off" value="{query}"> 
     16                        <input type="text" name="query" autocomplete="off" value="{query}" /> 
    1917                </form> 
    2018        </td> 
     
    5250        </tr> 
    5351        <tr> 
    54                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     52                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    5553        </tr> 
    5654<!-- END row_empty --> 
  • trunk/expressoAdmin1_2/templates/default/groups_form.tpl

    r2476 r2712  
    1717                                        <tr> 
    1818                                                <td colspan="3" align="right" bgcolor="{color_bg1}"> 
    19                                                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
    20                                                         <input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}','{restrictionsOnGroup}');"> 
     19                                                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
     20                                                        <input type="button" value="{lang_save}" onclick="javascript:validate_fields('{type}','{restrictionsOnGroup}');"> 
    2121                                                </td> 
    2222                                        </tr> 
     
    103103                                                <td colspan="3" align="left" bgcolor="{color_bg1}"> 
    104104                                                        <input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}','{restrictionsOnGroup}');"> 
    105                                                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     105                                                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    106106                                                </td> 
    107107                                        </tr> 
  • trunk/expressoAdmin1_2/templates/default/institutional_accounts.tpl

    r2459 r2712  
    77                        <tr> 
    88                                <td align="left" width="25%"> 
    9                                         <input type="button" value="{lang_create_institutional_account}" "{create_institutional_account_disabled}" onClick='{onclick_create_institutional_account}'> 
    10                                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     9                                        <input type="button" value="{lang_create_institutional_account}" "{create_institutional_account_disabled}" onclick='{onclick_create_institutional_account}'> 
     10                                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    1111                                </td> 
    1212                                <td align="center" "left" width="50%"> 
     
    3434                <table border="0" width="90%"> 
    3535                        <tr> 
    36                                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     36                                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    3737                        </tr> 
    3838                </table> 
  • trunk/expressoAdmin1_2/templates/default/logs.tpl

    r471 r2712  
    22<p> 
    33        <div align="center"> 
    4                 <form method="POST" action="{accounts_url}"> 
     4                <script> 
     5                        function search( inputs ) 
     6                        { 
     7                                var post = [ ]; 
     8                                for ( var i = 0; i < inputs.length; i++ ) 
     9                                        if ( inputs[ i ].type == 'text' ) 
     10                                                post[ post.length ] = inputs[ i ].name + '=' + inputs[ i ].value 
     11 
     12                                return post.join( '&' ); 
     13                        } 
     14                </script> 
     15                <form method="POST" action="{search_action}" onsubmit="ExpressoLivre.link( '{search_action}', null, search( this.getElementsByTagName( 'input' ) ) ); return false;"> 
    516                        <table border="0" width="90%"> 
    617                                <tr> 
    7                                         <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     18                                        <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    819                                </tr> 
    920 
     
    8596        </tr> 
    8697        <tr> 
    87                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     98                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    8899        </tr> 
    89100<!-- END row_empty --> 
  • trunk/expressoAdmin1_2/templates/default/maillists.tpl

    r493 r2712  
    66                <td align="left" width="25%"> 
    77                        <form name="form" method="POST" action="{add_action}"> 
    8                                 <input type="submit" value="{lang_add_email_lists}" "{add_email_lists_disabled}"> 
    9                                 <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     8                                <input type="button" value="{lang_add_email_lists}" "{add_email_lists_disabled}" onclick="ExpressoLivre.link( '{add_action}' )" /> 
     9                                <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    1010                        </form> 
    1111                </td> 
     
    5858   </tr> 
    5959        <tr> 
    60                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     60                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )"></td> 
    6161        </tr> 
    6262<!-- END row_empty --> 
  • trunk/expressoAdmin1_2/templates/default/maillists_form.tpl

    r621 r2712  
    66                </td> 
    77                <td valign="top"> 
    8                         <table border="0" width=100% cellspacing="4"> 
    9                                 <form action="{form_action}" method="POST" name="app_form"> 
     8                        <form action="{form_action}" method="POST" name="app_form"> 
     9                                <table border="0" width=100% cellspacing="4"> 
    1010                                        <input type="hidden" name="uidnumber" value="{uidnumber}"> 
    1111                                        <input type="hidden" name="old_uid" value="{uid}"> 
     
    1717                                        <tr> 
    1818                                                <td colspan="3" align="right" bgcolor="{color_bg1}"> 
    19                                                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     19                                                        <input type="button" value="{lang_back}" onClick="ExpressoLivre.link( '{back_url}' )" /> 
    2020                                                        <input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}');"> 
    2121                                                </td> 
     
    8080                                                <td colspan="3" align="left" bgcolor="{color_bg1}"> 
    8181                                                        <input type="button" value="{lang_save}" onClick="javascript:validate_fields('{type}');"> 
    82                                                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     82                                                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    8383                                                </td> 
    8484                                        </tr> 
    85                                 </form> 
    86                         </table> 
     85                                </table> 
     86                        </form> 
    8787                </td> 
    8888        </tr> 
  • trunk/expressoAdmin1_2/templates/default/sectors.tpl

    r1516 r2712  
    11<!-- BEGIN list --> 
    2 <form method="POST" action="{action}"> 
     2<form method="POST" action="{action}" onsubmit="ExpressoLivre.link( '{action}' ); return false;"> 
    33<p> 
    44  <table border="0" width="55%" align="center"> 
     
    1111   <td align="left"> 
    1212                {input_add} 
    13                 <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     13                <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    1414    </form> 
    1515   </td> 
     
    4646   </tr> 
    4747        <tr> 
    48                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     48                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    4949        </tr> 
    5050<!-- END row_empty --> 
  • trunk/expressoAdmin1_2/templates/default/sectors_form.tpl

    r2459 r2712  
    6161                        <td align="left" colspan="2"> 
    6262                        <input type="submit" name="button_submit" value={lang_save}> 
    63                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     63                                <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    6464                                <!-- 
    6565                        <input type="hidden" name="context" value="{context}"> 
  • trunk/expressoAdmin1_2/templates/default/shared_accounts.tpl

    r1913 r2712  
    88                                <td align="left" width="25%"> 
    99                                        <input type="button" value="{lang_create_shared_account}" "{create_share:_account_disabled}" onClick='{onclick_create_shared_account}'> 
    10                                         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     10                                        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )"> 
    1111                                </td> 
    1212                                <td align="center" "left" width="50%"> 
     
    3434                <table border="0" width="90%"> 
    3535                        <tr> 
    36                                 <td><input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"></td> 
     36                                <td><input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /></td> 
    3737                        </tr> 
    3838                </table> 
  • trunk/expressoAdmin1_2/templates/default/totalsessions.tpl

    r2 r2712  
    99        </Font> 
    1010        <br> 
    11         <input type="button" value="{lang_back}" onClick="document.location.href='{back_url}'"> 
     11        <input type="button" value="{lang_back}" onclick="ExpressoLivre.link( '{back_url}' )" /> 
    1212</center> 
    1313<!-- END list --> 
  • trunk/expressoMail1_2/js/jscode/globals.js

    r2645 r2712  
    1212var sort_box_reverse = 1; 
    1313var last_message_selected = ''; 
    14 //var array_lang = new Array(); 
    1514var cyrus_delimiter = ''; 
    1615var ccaddress_array = new Array(); 
  • trunk/expressoMail1_2/js/jscode/load_lang.js

    r2630 r2712  
    1 ( function( ) 
    2 { 
    3         var lang = document.getElementsByTagName( 'html' ).item( 0 ).getAttribute( 'xml:lang' ); 
    4         var _connector = new XConnector; 
    5  
    6         var request = _connector.cache( ).go( { 
    7                 'access' : URL_SERVER + 'expressoMail1_2/inc/load_lang.php?lang=' + lang, 
    8                 'handler' : function( data ) 
    9                 { 
    10                         window.array_lang = data.JSON( ); 
    11                 } 
    12         } ); 
    13 } )(); 
     1ExpressoLivre.lang( 'expressoMail1_2' ); 
  • trunk/phpgwapi/inc/class.expressolivre.inc.php

    r2704 r2712  
    2727                ); 
    2828        } 
     29 
     30        function lang( $param ) 
     31        { 
     32                $lang = ( array_key_exists( 'lang', $param ) ) ? $param[ 'lang' ] : false; 
     33                $module = ( array_key_exists( 'module', $param ) ) ? $param[ 'module' ] : false; 
     34 
     35                if ( ! ( $lang && $module ) ) 
     36                        return '{}'; 
     37 
     38                $array_keys = array( ); 
     39                $fn = dirname( __FILE__ ) . "/../../{$module}/setup/phpgw_{$lang}.lang"; 
     40                $lang = array( ); 
     41 
     42                if ( file_exists( $fn ) ) 
     43                { 
     44                        $fp = fopen( $fn, 'r' ); 
     45                        while ( $data = fgets( $fp, 16000 ) ) 
     46                        { 
     47                                list( $message_id, $app_name, $null, $content ) = explode( "\t", substr( $data, 0, -1 ) ); 
     48                                $lang[ ] = '"' . str_replace( '"', '\"', strtolower( $message_id ) ) . '" : "' . str_replace( '"', '\"', $content ) . '"'; 
     49                        } 
     50                        fclose( $fp ); 
     51                } 
     52 
     53                return '{' . implode( ",\n", $lang ) . '}'; 
     54        } 
    2955} 
    3056 
  • trunk/phpgwapi/js/expressolivre/expressolivre.js

    r2707 r2712  
    66        var _xlink = null; 
    77 
     8        window.array_lang = [ ]; 
     9 
     10        var _language = [ ] 
     11 
    812        function _go( ) 
    913        { 
    1014                _xconnector.go.apply( _xconnector, arguments ); 
     15        } 
     16 
     17        function _lang( ) 
     18        { 
     19                if ( ! ( arguments.length && arguments[ 0 ].constructor == String ) ) 
     20                        return false; 
     21 
     22                var module = arguments[ 0 ]; 
     23                var lang = document.getElementsByTagName( 'html' ).item( 0 ).getAttribute( 'xml:lang' ); 
     24 
     25                _xconnector.go( { 
     26                        'access' : 'phpgwapi.expressolivre.lang&lang=' + lang + '&module=' + module, 
     27                        'handler' : function( data ) 
     28                        { 
     29                                data = data.JSON( ); 
     30                                for ( var key in data ) 
     31                                        window.array_lang[ key ] = _language[ key ] = data[ key ]; 
     32                        } 
     33                } ); 
    1134        } 
    1235 
     
    3154        } 
    3255 
     56        function _translate( ) 
     57        { 
     58                if ( ! ( arguments.length && arguments[ 0 ].constructor == String ) ) 
     59                        return false; 
     60 
     61                var _phrase = arguments[ 0 ]; 
     62 
     63                if ( _language[ _phrase.toLowerCase( ) ] ) 
     64                        return _language[ _phrase.toLowerCase( ) ]; 
     65                else 
     66                        return _phrase + '*'; 
     67        } 
     68 
    3369        function _ExpressoLivre( ) 
    3470        { 
     
    3672                { 
    3773                        this.go = _go; 
     74                        this.lang = _lang; 
    3875                        this.link = _link; 
    3976                        this.path = _path; 
    4077                        this.theme = _theme; 
    4178                        this.template = _template; 
     79                        this.translate = _translate; 
    4280                } ); 
    4381        } 
  • trunk/phpgwapi/js/tools/xconnector.js

    r2685 r2712  
    218218                        '_ACCESS'       : _argv.access, 
    219219                        '_HANDLER'      : { }, 
    220                         '_POST'         : ( ( _argv.post ) ? _argv.post : false ),  // [GET | POST] 
     220                        '_POST'         : ( ( _argv.post && _argv.post != null ) ? _argv.post : false ),  // [GET | POST] 
    221221                        '_MODE'         : 'TEXT', // [XML | TEXT] 
    222222                        '_TYPE'         : null, // [4 for request | 3 for stream] 
  • trunk/phpgwapi/js/tools/xlink.js

    r2710 r2712  
    1717                        _action = window.location.protocol + '//' + window.location.host + _action; 
    1818 
    19                 if ( _action == _last_request ) 
     19                var _post = ( arguments.length == 3 && arguments[ 2 ] && arguments[ 2 ].constructor == String ) ? arguments[ 2 ] : null; 
     20 
     21                if ( _post == null && _action == _last_request ) 
    2022                        return false; 
    2123 
     
    3638                        'access' : _action, 
    3739                        'cache' : _cache, 
    38                         'handler' : _handler 
     40                        'handler' : _handler, 
     41                        'post' : _post 
    3942                } ); 
    4043 
     
    148151                _click( arguments[ 0 ], 
    149152                        ( 
    150                                 ( arguments.length > 1 && arguments[ 1 ].constructor == Boolean ) ? 
     153                                ( arguments.length > 1 && arguments[ 1 ] && arguments[ 1 ].constructor == Boolean ) ? 
    151154                                        arguments[ 1 ] : false 
     155                        ), 
     156                        ( 
     157                                ( arguments.length > 2 && arguments[ 2 ] && arguments[ 2 ].constructor == String ) ? 
     158                                        arguments[ 2 ] : null 
    152159                        ) 
    153160                ); 
  • trunk/phpgwapi/js/tools/xobject.js

    r2665 r2712  
    2121        String.prototype.trim = function( ) 
    2222        { 
    23                 return this.replace( /^ +| +$/g, '' ); 
     23                return this.replace( /^\s+|\s+$/g, '' ); 
    2424        }; 
    2525 
Note: See TracChangeset for help on using the changeset viewer.