Changeset 2802


Ignore:
Timestamp:
05/18/10 09:41:04 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Permitindo o envio de formulário por requisição background

Location:
trunk
Files:
1 added
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/inc/class.uiapplications.inc.php

    r2691 r2802  
    282282                        if ($_POST['delete']) 
    283283                        { 
    284                                 return $this->delete(); 
     284                                echo $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.delete&start=' )}{$start}&app_name={$app_name}' );</script>"; 
     285                                exit; 
    285286                        } 
    286287 
     
    300301                                        )); 
    301302 
    302                                         $GLOBALS['phpgw']->redirect_link('/#index.php','menuaction=admin.uiapplications.get_list&start='.$start); 
     303                                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start)}' );</script>"; 
     304                                        exit; 
    303305                                } 
    304306                        } 
     
    354356                        if ($GLOBALS['phpgw']->acl->check('applications_access',8,'admin')) 
    355357                        { 
    356                                 $GLOBALS['phpgw']->redirect_link('/#'); 
     358                                $GLOBALS['phpgw']->redirect_link('/'); 
    357359                        } 
    358360                        $app_name = get_var('app_name',array('POST','GET')); 
     
    365367                                        $this->bo->delete($app_name); 
    366368                                } 
    367                                 $GLOBALS['phpgw']->redirect_link('/#index.php','menuaction=admin.uiapplications.get_list&start='.$start); 
     369                                $GLOBALS['phpgw']->redirect_link('/index.php','menuaction=admin.uiapplications.get_list&start='.$start); 
    368370                        } 
    369371 
  • trunk/admin/inc/class.uicategories.inc.php

    r2686 r2802  
    418418                                                unset($values); 
    419419                                        } 
    420                                         } 
    421                                         if ($redirect_) 
    422                                                 $GLOBALS['phpgw']->redirect_link('/#index.php',$link_data); 
     420                                } 
     421                                if ($redirect_) 
     422                                { 
     423                                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS[ 'phpgw' ] -> link('/index.php',$link_data)}' );</script>"; 
     424                                        exit; 
     425                                } 
    423426 
    424427                        } 
     
    427430 
    428431                        $this->set_langs(); 
    429                 // if ExpressoMail 1.2 has been installed and enabled, show the plugin using AJAX.  
    430                 if($GLOBALS['phpgw_info']['server']['cal_expressoMail']) { 
    431                         $this->template_dir = 'calendar/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'];                                                     
    432                         $module_name = 'expressoMail'.(str_replace("1.","1_",$GLOBALS['phpgw_info']['server']['cal_expressoMail'])); 
    433                         if($GLOBALS['phpgw_info']['user']['apps'][$module_name]){                                                                
    434                                 $ldap_manager = CreateObject('contactcenter.bo_ldap_manager'); 
    435                                 $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];                                
    436                                 $_SESSION['phpgw_info']['expressomail']['user']['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; 
    437                                 $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server']; 
    438                                 $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null; 
    439                                 // Carrega todos scripts necessarios                             
    440                                 $scripts =      "<script src='".$module_name."/js/connector.js' type='text/javascript'></script>". 
    441                                                         "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ".                                                                                         
    442                                                         "<script src='".$this->template_dir."/js/search.js' type='text/javascript'></script>";                           
    443                                 // Fim                                                           
    444                                 $this->template->set_var('scripts',$scripts); 
    445                                 $this->template->set_var('template_set', $this->template_dir); 
    446                         } 
    447                 } 
    448                 // FIM if. 
     432                        // if ExpressoMail 1.2 has been installed and enabled, show the plugin using AJAX.  
     433                        if($GLOBALS['phpgw_info']['server']['cal_expressoMail']) { 
     434                                $this->template_dir = 'calendar/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'];                                                     
     435                                $module_name = 'expressoMail'.(str_replace("1.","1_",$GLOBALS['phpgw_info']['server']['cal_expressoMail'])); 
     436                                if($GLOBALS['phpgw_info']['user']['apps'][$module_name]){                                                                
     437                                        $ldap_manager = CreateObject('contactcenter.bo_ldap_manager'); 
     438                                        $_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];                                
     439                                        $_SESSION['phpgw_info']['expressomail']['user']['owner'] = $GLOBALS['phpgw_info']['user']['account_id']; 
     440                                        $_SESSION['phpgw_info']['expressomail']['server'] = $GLOBALS['phpgw_info']['server']; 
     441                                        $_SESSION['phpgw_info']['expressomail']['ldap_server'] = $ldap_manager ? $ldap_manager->srcs[1] : null; 
     442                                        // Carrega todos scripts necessarios                             
     443                                        $scripts =      "<script src='".$module_name."/js/connector.js' type='text/javascript'></script>". 
     444                                                "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ".                                                                                         
     445                                                "<script src='".$this->template_dir."/js/search.js' type='text/javascript'></script>";                           
     446                                        // Fim                                                           
     447                                        $this->template->set_var('scripts',$scripts); 
     448                                        $this->template->set_var('template_set', $this->template_dir); 
     449                                } 
     450                        } 
     451                        // FIM if. 
    449452 
    450453                        $this->template->set_file(array('form' => 'category_form.tpl')); 
     
    567570                        if (!$this->cat_id || $_POST['cancel']) 
    568571                        { 
    569                                 $GLOBALS['phpgw']->redirect_link('/#index.php',$link_data); 
     572                                $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS[ 'phpgw' ] -> link('/index.php',$link_data)}' );</script>"; 
     573                                exit; 
    570574                        } 
    571575 
     
    580584                                        $this->bo->delete($this->cat_id,False); 
    581585                                } 
    582                                 $GLOBALS['phpgw']->redirect_link('/#index.php',$link_data); 
     586                                $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS[ 'phpgw' ] -> link('/index.php',$link_data)}' );</script>"; 
     587                                exit; 
    583588                        } 
    584589                        $this->template->set_file(array('category_delete' => 'delete_cat.tpl')); 
  • trunk/admin/inc/class.uiconfig.inc.php

    r2686 r2802  
    126126                                if(!$errors) 
    127127                                { 
    128                                         $GLOBALS['phpgw']->redirect_link('/#admin/'); 
     128                                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS[ 'phpgw' ] -> link('/admin/')}' );</script>"; 
     129                                        exit; 
    129130                                } 
    130131                        } 
  • trunk/admin/inc/class.uimainscreen.inc.php

    r2703 r2802  
    2424 
    2525                        $html = createObject('phpgwapi.html'); 
    26                         $section     = addslashes($_POST['section']); 
    27                         $select_lang = addslashes($_POST['select_lang']); 
     26                        $section     = addslashes($_REQUEST['section']); 
     27                        $select_lang = addslashes($_REQUEST['select_lang']); 
    2828                        $message     = addslashes($_POST['message']); 
    2929 
     
    4141                                $acl_ok['loginhelp'] = True; 
    4242                        } 
    43                         if ($_POST['cancel'] && !isset($_POST['message']) ||  
    44                             !count($acl_ok) || $_POST['submit'] && !isset($acl_ok[$section])) 
     43 
     44                        if ($_POST['cancel'] && !isset($_POST['message']) || !count($acl_ok) || $_POST['submit'] && !isset($acl_ok[$section])) 
    4545                        { 
    4646                                $GLOBALS['phpgw']->redirect_link('/admin/index.php'); 
     
    5656                                $GLOBALS['phpgw']->db->query("DELETE FROM phpgw_lang WHERE message_id='$section" . "_message' AND app_name='" 
    5757                                        . "$section' AND lang='$select_lang'",__LINE__,__FILE__); 
     58 
    5859                                $GLOBALS['phpgw']->db->query("INSERT INTO phpgw_lang (message_id,app_name,lang,content)VALUES ('$section" . "_message','$section','$select_lang','" 
    5960                                        . $message . "')",__LINE__,__FILE__); 
    60                                         $feedback_message = '<center>'.lang('message has been updated').'</center>'; 
    61                                  
    62                                 $section = ''; 
     61 
     62                                $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) }&section={$section}&saved=true' );</script>"; 
     63                                exit; 
    6364                        } 
    6465                        if ($_POST['cancel'])   // back to section/lang-selection 
     
    8687                        } 
    8788 
    88                          
    89  
    90                          
     89                        if ( array_key_exists( 'saved', $_GET ) && $_GET[ 'saved' ] == 'true' ) 
     90                        { 
     91                                $feedback_message = '<center>'.lang('message has been updated').'</center>'; 
     92                                $section = ''; 
     93                        } 
     94 
    9195                        if (empty($section)) 
    9296                        { 
     
    126130                                { 
    127131                                        $select_section .= ' <option value="'.$key.'"'. 
    128                                                 ($key == $_POST['section'] ? ' selected' : '') . '>' .  
     132                                                ($key == $_REQUEST['section'] ? ' selected' : '') . '>' .  
    129133                                                ($key == 'mainscreen' ? lang('Main screen') : lang($key)) . "</option>\n"; 
    130134                                } 
     
    136140                                $tr_color = $GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color); 
    137141                                $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); 
    138                                 $GLOBALS['phpgw']->template->set_var('value','<input type="submit" value="' . lang('Edit') 
     142                                $GLOBALS['phpgw']->template->set_var('value','<input type="button" value="' . lang('Edit') 
     143                                        . '" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) 
     144                                        . '\' + \'&section=\' + escape( this.form.section.item( 1 ).value ) + \'&select_lang=\' + escape( this.form.select_lang.item( 1 ).value ) )' 
    139145                                        . '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' ) . '\' )">'); 
    140146                                $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
     
    148154                                $current_message = $GLOBALS['phpgw']->db->f('content'); 
    149155                                 
    150                                 if($_POST['htmlarea']) 
    151                                 { 
    152                                    $text_or_htmlarea=$html->htmlarea('message',stripslashes($current_message)); 
    153                                    $htmlarea_button='<input type="submit" name="no-htmlarea" onclick="self.location.href=\''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true').'\'" value="'.lang('disable WYSIWYG-editor').'">';        
     156                                if($_REQUEST['htmlarea']) 
     157                                { 
     158                                        //$text_or_htmlarea=$html->htmlarea('message',stripslashes($current_message)); 
     159 
     160                                        include_once("news_admin/inc/fckeditor.php"); 
     161                                        $oFCKeditor = new FCKeditor( 'message' ); 
     162 
     163                                        $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; 
     164                                        $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; 
     165 
     166                                        if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1)) 
     167                                                $webserver_url .= '/'; 
     168 
     169                                        $oFCKeditor->BasePath = $webserver_url . 'news_admin/templates/default/fckeditor/';  
     170                                        $oFCKeditor->ToolbarSet = 'Basic'; 
     171                                        $oFCKeditor->Value = $current_message; 
     172 
     173                                        $text_or_htmlarea = $oFCKeditor->Create( ); 
     174 
     175                                        $htmlarea_button='<input type="button" name="no-htmlarea" onclick="ExpressoLivre.link( \''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true&section=' . $section ) . '\');" value="'.lang('disable WYSIWYG-editor').'">';         
    154176                                } 
    155177                                else 
    156178                                { 
    157                                    $text_or_htmlarea='<textarea name="message" style="width:100%; min-width:350px; height:300px;" wrap="virtual">' . stripslashes($current_message) . '</textarea>'; 
    158                                    $htmlarea_button='<input type="submit" name="htmlarea" onclick="self.location.href=\''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true').'\'" value="'.lang('activate WYSIWYG-editor').'">'; 
     179                                        $text_or_htmlarea='<textarea name="message" style="width:100%; min-width:350px; height:300px;" wrap="virtual">' . stripslashes($current_message) . '</textarea>'; 
     180                                        $htmlarea_button='<input type="button" name="htmlarea" onclick="ExpressoLivre.link( \''.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index&htmlarea=true&section=' . $section ) . '\' );" value="'.lang('activate WYSIWYG-editor').'">'; 
    159181 
    160182                                }                           
     
    163185                                //$GLOBALS['phpgw']->common->phpgw_header(); 
    164186                                //echo parse_navbar(); 
    165                                  
     187 
    166188                                $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uimainscreen.index')); 
    167189                                $GLOBALS['phpgw']->template->set_var('select_lang',$select_lang); 
     
    184206                                $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); 
    185207                                $GLOBALS['phpgw']->template->set_var('value','<input type="submit" name="submit" value="' . lang('Save') 
    186                                 . '"><input type="submit" name="cancel" value="'. lang('cancel') .'">'.$htmlarea_button); 
     208                                . '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/index.php','menuaction=admin.uimainscreen.index' ) . '\' )">'.$htmlarea_button); 
    187209                                $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
    188210                        } 
  • trunk/admin/templates/classic/config.tpl

    r1517 r2802  
    11<!-- BEGIN header --> 
     2<script> 
     3function FCKeditor_OnComplete( editorInstance ) 
     4{ 
     5        editorInstance.LinkedField.form.onsubmit = function( ) 
     6        { 
     7                document.getElementById( 'newsettings[agree_term]' ).value = FCKeditorAPI.GetInstance( editorInstance.Name ).GetHTML( ); 
     8                return ExpressoLivre.form( editorInstance.LinkedField.form ); 
     9        }; 
     10} 
     11</script> 
    212<form method="POST" action="{action_url}"> 
    313<table align="center" width="85%" callspacing="0" style="{ border: 1px solid #000000; }"> 
  • trunk/admin/templates/default/application_form.tpl

    r2703 r2802  
    22{error} 
    33<br> 
    4 <form action="{form_action}" method="POST"> 
     4<form action="{form_action}" method="POST" onsubmit="return ExpressoLivre.form( this );"> 
    55 {hidden_vars} 
    66 <div align="center"> 
     
    1414  <tr> 
    1515   <td nowrap> 
    16     <input type="submit" name="save" value="{lang_save_button}"> &nbsp; 
     16    <input type="button" name="save" value="{lang_save_button}" onclick="this.type='submit'" /> &nbsp; 
    1717    <input type="button" name="cancel" value="{lang_cancel_button}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    1818   </td> 
    1919   <td align="right">&nbsp; 
    2020<!-- BEGIN delete_button --> 
    21     <input type="submit" name="delete" value="{lang_delete_button}"> 
     21    <input type="button" name="delete" value="{lang_delete_button}" onclick="this.type='submit'" /> 
    2222<!-- END delete_button --> 
    2323   </td> 
  • trunk/admin/templates/default/category_form.tpl

    r2703 r2802  
    77<center> 
    88{message}<br> 
    9 <form name="edit_cat" action="{action_url}" method="POST"> 
     9<form name="edit_cat" action="{action_url}" method="POST" onsubmit="return ExpressoLivre.form( this );"> 
    1010<table border="0" width="80%" cellspacing="2" cellpadding="2">  
    1111{hidden_vars} 
  • trunk/admin/templates/default/config.tpl

    r2703 r2802  
    11<!-- BEGIN header --> 
     2<script> 
     3function FCKeditor_OnComplete( editorInstance ) 
     4{ 
     5        editorInstance.LinkedField.form.onsubmit = function( ) 
     6        { 
     7                document.getElementById( 'newsettings[agree_term]' ).value = FCKeditorAPI.GetInstance( editorInstance.Name ).GetHTML( ); 
     8                return ExpressoLivre.form( editorInstance.LinkedField.form ); 
     9        }; 
     10} 
     11</script> 
    212<form method="POST" action="{action_url}"> 
    313<table align="center" width="85%" callspacing="0"> 
  • trunk/admin/templates/default/delete_cat.tpl

    r2703 r2802  
    22<!-- BEGIN form --> 
    33<br> 
    4         <form method="POST" action="{action_url}"> 
     4        <form method="POST" action="{action_url}" onsubmit="return ExpressoLivre.form( this );"> 
    55                {hidden_vars} 
    66                <table border="0" with="65%" cellpadding="2" cellspacing="2" align="center"> 
     
    1717<!-- BEGIN delete --> 
    1818                                <td align="center"> 
    19                                         <input type="submit" name="confirm" value="{lang_yes}"> 
     19                                        <input type="button" name="confirm" value="{lang_yes}" onclick="this.type = 'submit'" /> 
    2020                                </td> 
    2121                                <td align="center"> 
     
    2525<!-- BEGIN done --> 
    2626                                <td align="center"> 
    27                                         <input type="submit" name="cancel" value="{lang_ok}"> 
     27                                        <input type="button" name="cancel" value="{lang_ok}" onclick="this.type = 'submit'" /> 
    2828                                </td> 
    2929<!-- END done --> 
  • trunk/admin/templates/default/delete_common.tpl

    r2703 r2802  
    22<p> 
    33<center> 
    4  <form action="{form_action}" method="POST"> 
     4 <form action="{form_action}" method="POST" onsubmit="return ExpressoLivre.form( this );"> 
    55  {hidden_vars} 
    66  <table align="center" border="0" width="55%" cols="2"> 
  • trunk/admin/templates/default/mainscreen_message.tpl

    r1362 r2802  
    11<!-- BEGIN form --> 
    22<div align="center">{error_message}</div> 
    3 <form method="POST" action="{form_action}"> 
     3<form method="POST" action="{form_action}" onsubmit="return ExpressoLivre.form( this );"> 
    44 <table border="0" align="center" > 
    55<input type="hidden" name="select_lang" value="{select_lang}"> 
  • trunk/calendar/inc/class.uicalendar.inc.php

    r2748 r2802  
    48974897                                $this->index(); 
    48984898                        } 
    4899                          
     4899 
    49004900                        if(isset($param['event'])) 
    49014901                        { 
    49024902                                $event = $param['event']; 
    49034903                        } 
    4904                          
     4904 
    49054905                        $hourformat = substr($this->bo->users_timeformat,0,1); 
    4906                          
     4906 
    49074907                        // $sb = CreateObject('phpgwapi.sbox'); 
    49084908                        $sb = CreateObject('phpgwapi.sbox2'); 
    49094909                        $jscal = CreateObject('phpgwapi.jscalendar');   // before phpgw_header() !!! 
    4910                          
     4910 
    49114911                        //unset($GLOBALS['phpgw_info']['flags']['noheader']); 
    49124912                        //unset($GLOBALS['phpgw_info']['flags']['nonavbar']); 
     
    49154915                        $GLOBALS['phpgw_info']['flags']['app_header'] = $event['id'] ? lang('Editing event') : lang('Adding event'); 
    49164916                        if ($param['plain'] != "True"){ 
    4917                         //      $GLOBALS['phpgw']->common->phpgw_header(); 
     4917                                //      $GLOBALS['phpgw']->common->phpgw_header(); 
    49184918                        } 
    49194919                        else{ 
     
    49324932                        $p->set_block('edit','list','list'); 
    49334933                        $p->set_block('edit','hr','hr'); 
    4934                          
     4934 
    49354935                        $vars = Array( 
    49364936                                'font'                  => $this->theme['font'], 
     
    49394939                                'accounts_link'         => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.accounts_popup'), 
    49404940                                'common_hidden' => '<input type="hidden" name="cal[id]" value="'.$event['id'].'">'."\n" 
    4941                                         . '<input type="hidden" name="cal[owner]" value="'.$event['owner'].'">'."\n" 
    4942                                         . '<input type="hidden" name="cal[uid]" value="'.$event['uid'].'">'."\n" 
    4943                                         . ($_GET['cal_id'] && $event['id'] == 0?'<input type="hidden" name="cal[reference]" value="'.$_GET['cal_id'].'">'."\n": 
    4944                                         (@isset($event['reference'])?'<input type="hidden" name="cal[reference]" value="'.$event['reference'].'">'."\n":'')) 
    4945                                         . (@isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && $GLOBALS['phpgw_info']['server']['deny_user_grants_access']? 
    4946                                         '<input type="hidden" name="participants[]" value="'.$this->bo->owner.'">'."\n":''), 
     4941                                . '<input type="hidden" name="cal[owner]" value="'.$event['owner'].'">'."\n" 
     4942                                . '<input type="hidden" name="cal[uid]" value="'.$event['uid'].'">'."\n" 
     4943                                . ($_GET['cal_id'] && $event['id'] == 0?'<input type="hidden" name="cal[reference]" value="'.$_GET['cal_id'].'">'."\n": 
     4944                                (@isset($event['reference'])?'<input type="hidden" name="cal[reference]" value="'.$event['reference'].'">'."\n":'')) 
     4945                                . (@isset($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) && $GLOBALS['phpgw_info']['server']['deny_user_grants_access']? 
     4946                                '<input type="hidden" name="participants[]" value="'.$this->bo->owner.'">'."\n":''), 
    49474947                                'errormsg'              => ($param['cd']?$GLOBALS['phpgw']->common->check_code($param['cd']):'') 
    49484948                        ); 
    4949                          
     4949 
    49504950                        $p->set_var($vars); 
    49514951 
    4952 // Brief Description 
     4952                        // Brief Description 
    49534953                        $var['title'] = Array( 
    49544954                                'tr_color' => $this->theme['th_bg'], 
     
    49574957                        ); 
    49584958 
    4959 // Full Description 
     4959                        // Full Description 
    49604960                        $var['description'] = Array( 
    49614961                                'field' => lang('Full Description'), 
     
    49634963                        ); 
    49644964 
    4965 // Display Categories 
     4965                        // Display Categories 
    49664966                        if(strpos($event['category'],',')) 
    49674967                        { 
     
    49864986                        ); 
    49874987 
    4988 // Location 
     4988                        // Location 
    49894989                        $var['location'] = Array( 
    49904990                                'field' => lang('Location'), 
     
    49924992                        ); 
    49934993 
    4994 // Date 
     4994                        // Date 
    49954995 
    49964996                        $start = $this->bo->maketime($event['start']) - $GLOBALS['phpgw']->datetime->tz_offset; 
    49974997                        $var['startdate'] = Array( 
    49984998                                'field' => lang('Start Date'), 
    4999 /* 
     4999                        /* 
    50005000                                'data'  => $GLOBALS['phpgw']->common->dateformatorder( 
    50015001                                   $sb->getYears('start[year]',(int)$GLOBALS['phpgw']->common->show_date($start,'Y')), 
     
    50035003                                   $sb->getDays('start[mday]',(int)$GLOBALS['phpgw']->common->show_date($start,'d')) 
    50045004                                ) 
    5005 */ 
     5005                        */ 
    50065006                                'data' => $jscal->input('start[str]',$start) 
    50075007                        ); 
    50085008 
    5009 // Time 
     5009                        // Time 
    50105010                        if ($this->bo->prefs['common']['timeformat'] == '12') 
    50115011                        { 
     
    50185018                        ); 
    50195019 
    5020 // End Date 
     5020                        // End Date 
    50215021                        $end = $this->bo->maketime($event['end']) - $GLOBALS['phpgw']->datetime->tz_offset; 
    50225022                        $var['enddate'] = Array( 
    50235023                                'field' => lang('End Date'), 
    5024 /* 
     5024                        /* 
    50255025                                'data'  => $GLOBALS['phpgw']->common->dateformatorder( 
    50265026                                   $sb->getYears('end[year]',(int)$GLOBALS['phpgw']->common->show_date($end,'Y')), 
     
    50285028                                   $sb->getDays('end[mday]',(int)$GLOBALS['phpgw']->common->show_date($end,'d')) 
    50295029                                ) 
    5030 */ 
     5030                        */ 
    50315031                                'data' => $jscal->input('end[str]',$end) 
    50325032                        ); 
    50335033 
    5034 // End Time 
     5034                        // End Time 
    50355035                        if ($this->bo->prefs['common']['timeformat'] == '12') 
    50365036                        { 
     
    50435043                        ); 
    50445044 
    5045 // Priority 
     5045                        // Priority 
    50465046                        $var['priority'] = Array( 
    50475047                                'field' => lang('Priority'), 
     
    50515051                        // Access 
    50525052                        $var['access'] = Array( 
    5053                         'field' => lang('Type'), 
    5054                         'data'  => '<select onchange="javascript:changeViewMode(this.value);" id="cal[type]" name="cal[type]" '.($event['type'] == 'H'?'DISABLED':'').'><option value="normal" '.(($event['public'] && $event['type'] == 'E')?'SELECTED':'').' >'.lang('Normal').'</option><option value="private" '.((!$event['public'] && $event['type'] == 'E')?'SELECTED':'').' >'. lang('Restrict').'</option><option value="privateHiddenFields" '.($event['type']=='P'?'SELECTED':'').' >'. lang('Private').'</option><option value="hourAppointment" '.($event['type'] == 'H'?'SELECTED':'').' >'.lang('Hours Appointment').'</option></select>' 
     5053                                'field' => lang('Type'), 
     5054                                'data'  => '<select onchange="javascript:changeViewMode(this.value);" id="cal[type]" name="cal[type]" '.($event['type'] == 'H'?'DISABLED':'').'><option value="normal" '.(($event['public'] && $event['type'] == 'E')?'SELECTED':'').' >'.lang('Normal').'</option><option value="private" '.((!$event['public'] && $event['type'] == 'E')?'SELECTED':'').' >'. lang('Restrict').'</option><option value="privateHiddenFields" '.($event['type']=='P'?'SELECTED':'').' >'. lang('Private').'</option><option value="hourAppointment" '.($event['type'] == 'H'?'SELECTED':'').' >'.lang('Hours Appointment').'</option></select>' 
    50555055                        ); //event['public'] 
    50565056 
     
    50665066                                                        { 
    50675067                                                                $str .= '<option value="' . $id.$event['participants'][$id] . '"'.($event['participants'][$id]?' selected':'').'>('.$GLOBALS['phpgw']->accounts->get_type($id) 
    5068                                                                                 .') ' . $GLOBALS['phpgw']->common->grab_owner_name($id) . '</option>' . "\n"; 
     5068                                                                        .') ' . $GLOBALS['phpgw']->common->grab_owner_name($id) . '</option>' . "\n"; 
    50695069                                                        } 
    50705070                                                } 
    50715071                                                $var['participants'] = array 
    5072                                                 ( 
    5073                                                         'field' => '<input type="button" value="' . lang('Participants') . '" onClick="accounts_popup();">' . "\n" 
    5074                                                                         . '<input type="hidden" name="accountid" value="' . $accountid . '">', 
    5075                                                         'data'  => "\n".'   <select name="participants[]" multiple size="7">' . "\n" . $str . '</select>' 
    5076                                                 ); 
     5072                                                        ( 
     5073                                                                'field' => '<input type="button" value="' . lang('Participants') . '" onClick="accounts_popup();">' . "\n" 
     5074                                                                . '<input type="hidden" name="accountid" value="' . $accountid . '">', 
     5075                                                                'data'  => "\n".'   <select name="participants[]" multiple size="7">' . "\n" . $str . '</select>' 
     5076                                                        ); 
    50775077                                                break; 
    50785078                                        default: 
     
    50895089                                                $str = utf8_decode($str); 
    50905090                                                $footer_ext_participantes =     '<br>&nbsp;&nbsp;'.lang("The email addresses must be separated by ','");                                                 
    5091                                                  
     5091 
    50925092                                                $var['participants'] = array 
    50935093                                                ( 
    50945094                                                        'field' => lang('Participants'),                                                         
    50955095                                                        'data'  => " 
    5096                                                                         <table width='100%' border='0'> 
    5097                                                                                 <tr> 
    5098                                                                                         <td width='30%'>                                                                                 
    5099                                                                                                 <center>Participantes</center>                                                                                           
    5100                                                                                         </td> 
    5101                                                                                         <td width='8%' >&nbsp;</td> 
    5102                                                                                         <td width='40%'>&nbsp;</td> 
    5103                                                                                 </tr>                                                                                                                                            
    5104                                                                                 <tr>             
    5105                                                                                         <td width='30%'>                                                                                         
    5106                                                                                                 <center><select id='user_list' name='participants[]' style='width: 220px' multiple size='7'>".$str."</select></center>                                                                           
    5107                                                                                         </td>                            
    5108                                                                                         <td width='8%'> 
    5109                                                                                         <center> 
    5110                                                                                                 <table width='100%' border='0'>                                                                  
    5111                                                                                                         <tr height='5'><td>&nbsp;</td></tr>                                                                      
    5112                                                                                                         <tr><td align='center'>                                                                  
    5113                                                                                                                 <button type='button' onClick='javascript:openListUsers(340,533, " 
    5114                                                                                                                 .$event['owner']. 
    5115                                                                                                                 ")'><img src='calendar/templates/".$_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set']."/images/add.png' style='vertical-align: middle;' >&nbsp;Adicionar</button> 
    5116                                                                                                                 </td> 
    5117                                                                                                         </tr>                                                    
    5118                                                                                                         <tr height='5'><td>&nbsp;</td></tr> 
    5119                                                                                                         <tr><td  align='center'> 
    5120                                                                                                                 <button type='button' onClick='javascript:rem()'><img src='calendar/templates/".$_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set']."/images/rem.png' style='vertical-align: middle;' >&nbsp;Remover</button> 
    5121                                                                                                                 </td> 
    5122                                                                                                         </tr> 
    5123                                                                                                 </table> 
    5124                                                                                         </center> 
    5125                                                                                         </td> 
    5126                                                                                         <td width='40%'>&nbsp;</td> 
    5127                                                                                 </tr> 
    5128                                                                                 </table> 
    5129                                                                                 <script src='{$GLOBALS['phpgw'] -> link( '/calendar' )}/js/edit.js' type='text/javascript'></script> 
    5130                                                                         " 
     5096                                                        <table width='100%' border='0'> 
     5097                                                        <tr> 
     5098                                                        <td width='30%'>                                                                                 
     5099                                                        <center>Participantes</center>                                                                                           
     5100                                                        </td> 
     5101                                                        <td width='8%' >&nbsp;</td> 
     5102                                                        <td width='40%'>&nbsp;</td> 
     5103                                                        </tr>                                                                                                                                            
     5104                                                        <tr>             
     5105                                                        <td width='30%'>                                                                                         
     5106                                                        <center><select id='user_list' name='participants[]' style='width: 220px' multiple size='7'>".$str."</select></center>                                                                           
     5107                                                        </td>                            
     5108                                                        <td width='8%'> 
     5109                                                        <center> 
     5110                                                        <table width='100%' border='0'>                                                                  
     5111                                                        <tr height='5'><td>&nbsp;</td></tr>                                                                      
     5112                                                        <tr><td align='center'>                                                                  
     5113                                                        <button type='button' onClick='javascript:openListUsers(340,533, " 
     5114                                                        .$event['owner']. 
     5115                                                        ")'><img src='calendar/templates/".$_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set']."/images/add.png' style='vertical-align: middle;' >&nbsp;Adicionar</button> 
     5116                                                        </td> 
     5117                                                        </tr>                                                    
     5118                                                        <tr height='5'><td>&nbsp;</td></tr> 
     5119                                                        <tr><td  align='center'> 
     5120                                                        <button type='button' onClick='javascript:rem()'><img src='calendar/templates/".$_SESSION['phpgw_info']['calendar']['user']['preferences']['common']['template_set']."/images/rem.png' style='vertical-align: middle;' >&nbsp;Remover</button> 
     5121                                                        </td> 
     5122                                                        </tr> 
     5123                                                        </table> 
     5124                                                        </center> 
     5125                                                        </td> 
     5126                                                        <td width='40%'>&nbsp;</td> 
     5127                                                        </tr> 
     5128                                                        </table> 
     5129                                                        <script src='{$GLOBALS['phpgw'] -> link( '/calendar' )}/js/edit.js' type='text/javascript'></script>" 
    51315130                                                ); 
     5131 
    51325132                                                // if ExpressoMail 1.2 has been installed and enabled, show the plugin using AJAX.  
    5133                                                 if($GLOBALS['phpgw_info']['server']['cal_expressoMail']) {                                                       
     5133                                                if($GLOBALS['phpgw_info']['server']['cal_expressoMail']) { 
    51345134                                                        $module_name = 'expressoMail'.(str_replace("1.","1_",$GLOBALS['phpgw_info']['server']['cal_expressoMail'])); 
    51355135 
     
    51795179                                                                        'field' => ' 
    51805180                                                                        <script src="'.$GLOBALS['phpgw'] -> link( '/calendar' ).'/js/edit.js" type="text/javascript"></script><div id=\'disponibility\' style=\'display:none;position:absolute\' bgcolor=\'#FFFFFF\'> 
    5181         <iframe src=\'#\' id=\'frame_disponibility\' width=\'500\' marginHeight=\'0\' marginWidth=\'0\' height=\'200px\'></iframe> 
    5182 </div> 
     5181                                                                        <iframe src=\'#\' id=\'frame_disponibility\' width=\'500\' marginHeight=\'0\' marginWidth=\'0\' height=\'200px\'></iframe> 
     5182                                                                        </div> 
    51835183                                                                        '.lang('Participants'), 
    5184                                                                         'data'  => ' 
    5185                                                                                         <input type="hidden" id="txt_loading" value="'.lang("Loading").'">' . 
    5186                                                                                         '<input type="hidden" id="txt_searching" value="'.lang("Searching").'">' . 
    5187                                                                                         '<input type="hidden" id="txt_users" value="'.lang("Users").'">' .                                                       
    5188                                                                                         '<input type="hidden" id="txt_groups" value="'.lang("Groups").'">' . 
    5189                                                                                         '<table width="100%" border="0">'. 
    5190                                                                                         '<tr>'. 
    5191                                                                                         '<td width="25%"><br><br>'. 
    5192                                                                                         '<br><br>&nbsp;&nbsp;<b>'.lang("Event's participants").'</b><br>'. 
    5193                                                                                         '       <select id="user_list" name="participants[]" style="width: 300px" multiple size="13">'.$str.'</select>'. 
    5194                                                                                         '</td>'. 
    5195                                                                                         '<td width="30px" valign="middle" align="center">&nbsp;'. 
    5196                                                                                         '</td>'. 
    5197                                                                                         '<td valign="bottom">'. 
    5198                                                                                         '       '.lang("Organization").': '. 
    5199                                                                                         '       <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value,\''.($recursive ? "" : "search").'\',\''.$GLOBALS['phpgw_info']['server']['auto_search'].'\');">'.$combo_org.'</select>'. 
    5200                                                                                         '       <br>'. 
    5201                                                                                         '       <font color="red"><span id="cal_span_searching">&nbsp;</span></font>'.                                                                   
    5202                                                                                         '       <br>'.lang("Search for").':'. 
    5203                                                                                         '       <input value="" id="cal_input_searchUser" size="35" autocomplete="off" onkeyup="javascript:optionFinderTimeout(this,'.$GLOBALS['phpgw_info']['server']['min_num_characters'].',\''.($recursive ? "" : "search").'\',\''.$GLOBALS['phpgw_info']['server']['auto_search'].'\')"><br>'. 
    5204                                                                                         '       <b>'.lang("Available users and groups").'</b><br>'. 
    5205                                                                                         '       <select id="user_list_in" style="width: 300px" multiple size="13"></select>'. 
    5206                                                                                         '</td>'. 
    5207                                                                                         '</tr>'. 
    5208                                             '<tr>'. 
    5209                                             '<td width="25%">'. 
    5210                                             '<button type="button" id="time_map" onClick="javascript:show_disponibility();">'.lang("Disponibility map").'</button>'. 
    5211                                             '</td>'. 
    5212                                             '<td width="30px" valign="middle" align="center">&nbsp;'. 
    5213                                                                                         '</td>'. 
    5214                                             '<td valign="bottom">'. 
    5215                                             '<button type="button" onClick="javascript:add_user();"><img src="calendar/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'].'/images/add.png" style="vertical-align: middle;" >&nbsp;'.lang("Add").'</button>'. 
    5216                                                                                         '&nbsp;&nbsp;<button type="button" onClick="javascript:remove_user();"><img src="calendar/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'].'/images/rem.png" style="vertical-align: middle;" >&nbsp;'.lang("Remove").'</button>'. 
    5217                                             '</td>'. 
    5218                                                                                         '</tr>'. 
    5219                                                                                         '</table>'.  
    5220                                                                                         '<script type="text/javascript" src="' . $GLOBALS[ 'phpgw' ] -> link( '/phpgwapi/js/dJSWin/dJSWin.js' ) .'"></script>'.          
    5221                                                                                         '<script src="' . $GLOBALS[ 'phpgw' ] -> link( '/calendar/js/edit_exmail.js' ) . '" type="text/javascript"></script>' . 
    5222                                                                                         $load_lang_vars.                                 
    5223                                                                                         "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ".                                                                                         
    5224                                                                                         "<script type='text/javascript'>" . 
    5225                                                                                         "var timeout_get_available_users = setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\',\'".($recursive ? "" : "search")."\',\'".$GLOBALS['phpgw_info']['server']['auto_search']."\')',1000);".  
    5226                                                                                         "</script> " 
     5184                                                                                'data'  => ' 
     5185                                                                                <input type="hidden" id="txt_loading" value="'.lang("Loading").'">' . 
     5186                                                                                '<input type="hidden" id="txt_searching" value="'.lang("Searching").'">' . 
     5187                                                                                '<input type="hidden" id="txt_users" value="'.lang("Users").'">' .                                                       
     5188                                                                                '<input type="hidden" id="txt_groups" value="'.lang("Groups").'">' . 
     5189                                                                                '<table width="100%" border="0">'. 
     5190                                                                                '<tr>'. 
     5191                                                                                '<td width="25%"><br><br>'. 
     5192                                                                                '<br><br>&nbsp;&nbsp;<b>'.lang("Event's participants").'</b><br>'. 
     5193                                                                                '       <select id="user_list" name="participants[]" style="width: 300px" multiple size="13">'.$str.'</select>'. 
     5194                                                                                '</td>'. 
     5195                                                                                '<td width="30px" valign="middle" align="center">&nbsp;'. 
     5196                                                                                '</td>'. 
     5197                                                                                '<td valign="bottom">'. 
     5198                                                                                '       '.lang("Organization").': '. 
     5199                                                                                '       <select name="org_context" id="combo_org" onchange="javascript:get_available_users(\''.$module_name.'\',this.value,\''.($recursive ? "" : "search").'\',\''.$GLOBALS['phpgw_info']['server']['auto_search'].'\');">'.$combo_org.'</select>'. 
     5200                                                                                '       <br>'. 
     5201                                                                                '       <font color="red"><span id="cal_span_searching">&nbsp;</span></font>'.                                                                   
     5202                                                                                '       <br>'.lang("Search for").':'. 
     5203                                                                                '       <input value="" id="cal_input_searchUser" size="35" autocomplete="off" onkeyup="javascript:optionFinderTimeout(this,'.$GLOBALS['phpgw_info']['server']['min_num_characters'].',\''.($recursive ? "" : "search").'\',\''.$GLOBALS['phpgw_info']['server']['auto_search'].'\')"><br>'. 
     5204                                                                                '       <b>'.lang("Available users and groups").'</b><br>'. 
     5205                                                                                '       <select id="user_list_in" style="width: 300px" multiple size="13"></select>'. 
     5206                                                                                '</td>'. 
     5207                                                                                '</tr>'. 
     5208                                                                                '<tr>'. 
     5209                                                                                '<td width="25%">'. 
     5210                                                                                '<button type="button" id="time_map" onClick="javascript:show_disponibility();">'.lang("Disponibility map").'</button>'. 
     5211                                                                                '</td>'. 
     5212                                                                                '<td width="30px" valign="middle" align="center">&nbsp;'. 
     5213                                                                                '</td>'. 
     5214                                                                                '<td valign="bottom">'. 
     5215                                                                                '<button type="button" onClick="javascript:add_user();"><img src="calendar/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'].'/images/add.png" style="vertical-align: middle;" >&nbsp;'.lang("Add").'</button>'. 
     5216                                                                                '&nbsp;&nbsp;<button type="button" onClick="javascript:remove_user();"><img src="calendar/templates/'.$GLOBALS['phpgw_info']['user']['preferences']['common']['template_set'].'/images/rem.png" style="vertical-align: middle;" >&nbsp;'.lang("Remove").'</button>'. 
     5217                                                                                '</td>'. 
     5218                                                                                '</tr>'. 
     5219                                                                                '</table>'.  
     5220                                                                                '<script type="text/javascript" src="' . $GLOBALS[ 'phpgw' ] -> link( '/phpgwapi/js/dJSWin/dJSWin.js' ) .'"></script>'.          
     5221                                                                                '<script src="' . $GLOBALS[ 'phpgw' ] -> link( '/calendar/js/edit_exmail.js' ) . '" type="text/javascript"></script>' . 
     5222                                                                                $load_lang_vars.                                 
     5223                                                                                "<script type='text/javascript'>var DEFAULT_URL = '".$module_name."/controller.php?action=';</script> ".                                                                                         
     5224                                                                                "<script type='text/javascript'>" . 
     5225                                                                                "var timeout_get_available_users = setTimeout('get_available_users(\"".$module_name."\",\'".$user_context."\',\'".($recursive ? "" : "search")."\',\'".$GLOBALS['phpgw_info']['server']['auto_search']."\')',1000);".  
     5226                                                                                "</script> " 
    52275227                                                                ); 
    52285228                                                        }                                                
    52295229                                                }                                                
    5230                                                  
     5230 
    52315231                                                $var['participants']['data'] .= '<br /><a id="a_ext_participants" title="'.lang("It types below the email addresses, if you want to invite other people out" . 
    52325232                                                        " of this system").'" name="a_ext_participants" onClick="javascript:showExParticipants(this,\''.$module_name.'\');return false;" href="#a_ext_participants"><b>'.lang("Inform").' '.lang("external participants").'</b>&nbsp;<img align="top" ' . 
     
    52465246                                                        '</table>'; 
    52475247                                                break; 
    5248                                                  
    5249                                 } 
     5248 
     5249                                        } 
    52505250                                if((($event['id'] > 0) && isset($event['participants'][$event['owner']])) || !$event['id']) 
    52515251                                { 
  • trunk/calendar/js/edit_exmail.js

    r2748 r2802  
    164164        var count_users = select_users.options.length; 
    165165        var new_options = ''; 
    166          
     166 
     167        for ( var i = 0; i < count_available_users; i++ ) 
     168                if ( select_available_users.options[ i ].selected ) 
     169                { 
     170                        select_users.appendChild( select_available_users.options[ i-- ] ); 
     171                        count_available_users--; 
     172                } 
     173 
     174        /* 
    167175        for (i = 0 ; i < count_available_users ; i++) { 
    168176                if (select_available_users.options[i].selected) { 
     
    195203                select_users.outerHTML = select_users.outerHTML; 
    196204        } 
     205        */ 
    197206} 
    198207 
  • trunk/calendar/templates/default/edit.tpl

    r1154 r2802  
    1515                Window1=window.open('{accounts_link}',"Search","width=800,height=600,toolbar=no,scrollbars=yes,resizable=yes"); 
    1616        } 
     17        function send_form( ) 
     18        { 
     19                var participants; 
     20 
     21                if ( ( participants = document.getElementById( 'user_list_in' ) ) ) 
     22                        for ( var i = 0; i < participants.length; i++ ) 
     23                                participants.options[ i ].selected = false; 
     24 
     25                if ( ( participants = document.getElementById( 'user_list' ) ) ) 
     26                        for ( var i = 0; i < participants.length; i++ ) 
     27                                participants.options[ i ].selected = true; 
     28 
     29                return ExpressoLivre.form( arguments[ 0 ].parentNode.removeChild( arguments[ 0 ] ) ); 
     30        } 
    1731</script> 
    1832<center> 
    1933<font color="#000000" face="{font}"> 
    2034 
    21 <form action="{action_url}" method="post" name="app_form"> 
     35<form action="{action_url}" method="post" name="app_form" onsubmit="return send_form( this );"> 
    2236{common_hidden} 
    2337<table id="editFormTable" border="0" width="90%"   class="prefTable"> 
  • trunk/expressoAdmin1_2/inc/class.shared_accounts.inc.php

    r2707 r2802  
    110110                        $return['mailquota_used'] = $quota['mailquota_used'];                         
    111111                        $i = 0; 
    112                                                 error_log( var_export( $owners_acl, true ), 3, '/tmp/log' ); 
    113112                        if( is_array($owners_acl) ){ 
    114113                                foreach($owners_acl as $key => $value) 
     
    125124                                $return['owners_acl'] = false; 
    126125                        }                         
    127                                                 error_log( var_export( $return, true ), 3, '/tmp/log' ); 
    128126                        return json_encode( $return ); 
    129127                } 
  • trunk/expressoAdmin1_2/inc/class.uimanagers.inc.php

    r2712 r2802  
    304304                        $var = Array( 
    305305                                'scripts_java'                          => '',//$scripts_java, 
    306                                 'action'                                        => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.uimanagers.validate'), 
     306                                'action'                                        => $GLOBALS['phpgw']->link('/index.php','menuaction=expressoAdmin1_2.manager.'), 
    307307                                'display_samba_suport'          => $this->config['expressoAdmin_samba_support'] == 'true' ? '' : 'display:none', 
    308308                                'color_bg1'                                     => "#E8F0F0", 
  • trunk/expressoAdmin1_2/js/jscode/managers.js

    r2712 r2802  
    8383                { 
    8484                        if (type == 'add') 
    85                                 cExecuteForm ("$this.manager.create", document.forms[0], handler_createsave_manager); 
     85                                document.managers_form.action += 'create'; 
    8686                        else 
    87                                 cExecuteForm ("$this.manager.save", document.forms[0], handler_createsave_manager); 
     87                                document.managers_form.action += 'save'; 
     88 
     89                        XForm( document.managers_form, return_handler_createsave_manager ); 
    8890                } 
    8991        }; 
     
    106108                else 
    107109                        alert( ExpressoLivre.translate( 'Manager successful saved' ) + '.'); 
     110 
     111                ExpressoLivre.link( ExpressoLivre.path( ) + 'index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers' ); 
    108112        } 
    109         location.href="./index.php?menuaction=expressoAdmin1_2.uimanagers.list_managers"; 
    110         return; 
    111113} 
    112114 
  • trunk/expressoAdmin1_2/templates/default/config.tpl

    r2707 r2802  
    11<!-- BEGIN header --> 
    2 <form method="POST" action="{action_url}"> 
    3 <table border="0" align="center"> 
    42<script> 
    53function test_db_connection() 
     
    2826</script> 
    2927 
     28<form method="POST" action="{action_url}" onsubmit="return ExpressoLivre.form( this );"> 
     29<table border="0" align="center"> 
    3030<!-- END header --> 
    3131<!-- BEGIN body --> 
  • trunk/expressoMail1_2/inc/class.ldap_functions.inc.php

    r2517 r2802  
    469469                    } 
    470470                } 
    471                 return array("users" => $user_options, "groups" => $group_options); 
     471                return json_encode( array("users" => $user_options, "groups" => $group_options) ); 
    472472        } 
    473473 
     
    623623            } 
    624624        } 
    625         return array("users" => $user_options, "groups" => $group_options); 
     625        return json_encode( array("users" => $user_options, "groups" => $group_options) ); 
    626626    } 
    627627 
  • trunk/expressoMail1_2/templates/classic/config.tpl

    r2703 r2802  
    11<!-- BEGIN header --> 
    2 <form method="POST" action="{action_url}"> 
     2<form method="POST" action="{action_url}"  onsubmit="return ExpressoLivre.form( this );"> 
    33<table border="0" align="center"> 
    44   <tr bgcolor="{th_bg}"> 
  • trunk/expressoMail1_2/templates/default/config.tpl

    r2752 r2802  
    11<!-- BEGIN header --> 
    2 <form method="POST" action="{action_url}"> 
     2<form method="POST" action="{action_url}" onsubmit="return ExpressoLivre.form( this );"> 
    33<table border="0" align="center"> 
    44   <tr bgcolor="{th_bg}"> 
  • trunk/index.php

    r2748 r2802  
    9292        if ( is_object( $GLOBALS[ $class ] ) && ( ( ! property_exists( $class, 'public_functions' ) ) || (is_array($GLOBALS[$class]->public_functions) && $GLOBALS[$class]->public_functions[$method]) && ! $invalid_data ) ) 
    9393        { 
    94                 echo execmethod( $_GET[ 'menuaction' ], $_GET ); 
     94                echo execmethod( $_GET[ 'menuaction' ], $_REQUEST ); 
    9595                unset($app); 
    9696                unset($class); 
  • trunk/phpgwapi/js/expressolivre/expressolivre.js

    r2732 r2802  
    1414 
    1515        var _loading = new Image( ); 
     16 
     17        function _form( ) 
     18        { 
     19                if ( ! arguments.length ) 
     20                        return false; 
     21 
     22                var _handler = null; 
     23 
     24                if ( arguments.length > 1 && arguments[ 1 ] && arguments[ 1 ].constructor == Function ) 
     25                        _handler = arguments[ 1 ]; 
     26                else 
     27                        _handler = _xlink.manipulator; 
     28 
     29                _wait( ); 
     30 
     31                return XForm( arguments[ 0 ], _handler ); 
     32        } 
    1633 
    1734        function _go( ) 
     
    7390        } 
    7491 
     92        function _wait( ) 
     93        { 
     94                if ( _divAppboxHeader ) 
     95                        _divAppboxHeader.innerHTML = ''; 
     96 
     97                if ( _divAppbox ) 
     98                { 
     99                        var _center = document.createElement( 'center' ); 
     100                        _center.appendChild( _loading ); 
     101 
     102                        _divAppbox.innerHTML = ''; 
     103                        _divAppbox.appendChild( _center ); 
     104                } 
     105        } 
     106 
    75107        function _ExpressoLivre( ) 
    76108        { 
    77109                return ( new function( ) 
    78110                { 
     111                        this.form = _form; 
    79112                        this.go = _go; 
    80113                        this.lang = _lang; 
     
    91124        _xlink = new XLink( _path( ) ); 
    92125        _xlink.handler( { 
    93                         "before" : function( ) 
    94                         { 
    95                                 if ( _divAppboxHeader ) 
    96                                         _divAppboxHeader.innerHTML = ''; 
     126                "before" : _wait, 
     127                "after" : function( ) 
     128                { 
     129                        if ( _divAppbox ) 
     130                                _divAppbox.innerHTML = ''; 
    97131 
    98                                 if ( _divAppbox ) 
    99                                 { 
    100                                         var _center = document.createElement( 'center' ); 
    101                                         _center.appendChild( _loading ); 
    102  
    103                                         _divAppbox.innerHTML = ''; 
    104                                         _divAppbox.appendChild( _center ); 
    105                                 } 
    106                         }, 
    107                         "after" : function( ) 
    108                         { 
    109                                 if ( _divAppbox ) 
    110                                         _divAppbox.innerHTML = ''; 
    111  
    112                                 while ( arguments[ 0 ].hasChildNodes( ) ) 
    113                                         _divAppbox.appendChild( arguments[ 0 ].firstChild ); 
    114                         } 
     132                        while ( arguments[ 0 ].hasChildNodes( ) ) 
     133                                _divAppbox.appendChild( arguments[ 0 ].firstChild ); 
     134                } 
    115135        } ); 
    116136 
     
    129149                _divAppbox = document.getElementById( 'divAppbox' ); 
    130150                _divAppbox.innerHTML = ''; 
     151 
     152                document.title = 'ExpressoLivre'; 
    131153 
    132154                document.getElementsByTagName( 'body' ).item( 0 ).style.overflowY = 'scroll'; 
  • trunk/phpgwapi/js/tools/xlink.js

    r2756 r2802  
    33        var _connector = new XConnector; 
    44        var _script = new XScript; 
     5        var _location = window.location; 
    56 
    67        function Link( ) 
    78        { 
    89                var _path = ( arguments.length && arguments[ 0 ].constructor == String ) ? arguments[ 0 ] : '/'; 
     10 
    911                var _last_request = null; 
    10  
    1112                var _before = null; 
    1213                var _after = null; 
    1314 
    14                 if ( window.location.protocol + '//' + window.location.host + window.location.pathname != _path ) 
     15                if ( _location.protocol + '//' + _location.host + _location.pathname != _path ) 
    1516                        window.location.href = _path + ( 
    16                                 ( window.location.hash ) ? 
    17                                         window.location.hash : '#' + String( window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search ).substr( _path.length ) 
     17                                ( _location.hash ) ? 
     18                                        _location.hash : '#' + String( _location.protocol + '//' + _location.host + _location.pathname + _location.search ).substr( _path.length ) 
    1819                        ); 
    1920 
    2021                function _click( _action, _cache ) 
    2122                { 
    22                         if ( _action.indexOf( window.location.host ) < 0 ) 
    23                                 _action = window.location.protocol + '//' + window.location.host + _action; 
     23                        if ( _action.indexOf( _location.host ) < 0 ) 
     24                                _action = _location.protocol + '//' + _location.host + _action; 
    2425 
    2526                        var _post = ( arguments.length == 3 && arguments[ 2 ] && arguments[ 2 ].constructor == String ) ? arguments[ 2 ] : null; 
     
    3536                                'access' : _action, 
    3637                                'cache' : _cache, 
    37                                 'handler' : _handler, 
     38                                'handler' : _manipulator, 
    3839                                'post' : _post 
    3940                        } ); 
     
    6970                } 
    7071 
    71                 function _handler( data ) 
     72                function _manipulator( _data ) 
    7273                { 
    73                         data = data.trim( ); 
    74                         data = data.replace( /\n/g, '__LINE_FEED_CHARACTER__' ); 
    75                         data = data.replace( /\r|\t/g, '' ); 
    76                         var _js = data.match( /<script[^>]*>.*?<\/script>/gi ); 
     74                        if ( ! ( _data.constructor == String ) ) 
     75                                return false; 
     76 
     77                        var _line_feed = '__LINE_FEED_CHARACTER_' + ( Date.parse( new Date ) ) + '__'; 
     78 
     79                        _data = _data.trim( ).replace( /[\r\t]/g, '' ).replace( /\n/g, _line_feed ); 
     80 
     81                        _line_feed = new RegExp( _line_feed, 'g' ); 
     82 
     83                        var _js = _data.match( new RegExp( '<script[^>]*>.*?<\/script>', 'gi' ) ); 
     84 
    7785                        if ( _js ) 
    7886                        { 
    7987                                var _tag = /<script([^>]+src=["'](\S+)["'])?[^>]*>(.*?)<\/script>/i; 
     88 
    8089                                for ( var i = 0; i < _js.length; i++ ) 
    8190                                { 
    82                                         data = data.replace( _js[ i ], '' ); 
     91                                        _data = _data.replace( _js[ i ], '' ); 
    8392 
    8493                                        _js[ i ] = _tag.exec( _js[ i ] ); 
    8594 
    86                                         if ( _js[ i ][ 2 ] == undefined || _js[ i ][ 2 ].length == 0 ) 
    87                                                 _script.inline( _js[ i ][ 3 ].replace( /__LINE_FEED_CHARACTER__/g, '\n' ) ); 
     95                                        var _external = _js[ i ][ 2 ]; 
     96 
     97                                        if ( _external == undefined || _external.length == 0 ) 
     98                                                _script.inline( _js[ i ][ 3 ].replace( _line_feed, '\n' ) ); 
    8899                                        else 
    89100                                        { 
    90                                                 var _external = _js[ i ][ 2 ]; 
    91  
    92101                                                if ( _external.indexOf( window.location.host ) < 0 ) 
    93102                                                        _external = window.location.protocol + '//' + window.location.host + _external; 
     
    105114                                } 
    106115                        } 
    107                         data = data.replace( /__LINE_FEED_CHARACTER__|[\r\t]/g, '' ); 
    108116 
    109117                        var el = document.createElement( 'div' ); 
    110                         el.innerHTML = data; 
     118                        el.innerHTML = _data.replace( _line_feed, '' ); 
    111119 
    112120                        var _links = el.getElementsByTagName( 'a' ); 
     
    120128                } 
    121129 
    122                 function _manipulator( ) 
     130                function _handler( ) 
    123131                { 
    124132                        if ( arguments.length != 1 ) 
     
    156164 
    157165                this.intercept = _intercept; 
    158                 this.handler = _manipulator; 
     166                this.handler = _handler; 
     167                this.manipulator = _manipulator; 
    159168        } 
    160169 
  • trunk/preferences/inc/class.uicategories.inc.php

    r2495 r2802  
    453453                                else 
    454454                                { 
    455                                         $cat_id = $this->bo->save_cat($values); 
    456                                         return $this->index(); 
    457                                         //$GLOBALS['phpgw']->template->set_var('message',lang('Category %1 has been updated !',$cat_name)); 
     455                                        $this->bo->save_cat($values); 
     456                                        $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'java_script' ] .= "<script>ExpressoLivre.link( '{$GLOBALS[ 'phpgw' ] -> link( '/index.php', $link_data )}' );</script>"; 
     457                                        exit; 
    458458                                } 
    459459                        } 
  • trunk/preferences/templates/default/category_form.tpl

    r2 r2802  
    44<center> 
    55{message}<br> 
    6 <table border="0" width="80%" cellspacing="2" cellpadding="2">  
    7 <form name="form" action="{actionurl}" method="POST"> 
     6<form name="form" action="{actionurl}" method="POST" onsubmit="return ExpressoLivre.form( this );"> 
     7<table border="0" width="80%" cellspacing="2" cellpadding="2"> 
    88        <tr bgcolor="{th_bg}"> 
    99                <td colspan="2">{lang_parent}</td> 
     
    3232 
    3333        <tr valign="bottom" height="50"> 
    34                 <td><input type="submit" name="save" value="{lang_save}"></form></td> 
    35                 <td><form method="POST" action="{cancel_url}"> 
    36                         <input type="submit" name="cancel" value="{lang_cancel}"></form></td> 
     34                <td><input type="submit" name="save" value="{lang_save}"></td> 
     35                <td><input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_url}' );"/></td> 
    3736        </tr> 
    3837</table> 
     38</form> 
    3939</center> 
    4040 
     
    4646                <td> 
    4747                        {hidden_vars} 
    48                         <input type="submit" name="save" value="{lang_save}"></form></td> 
    49                 <td> 
    50                         <form method="POST" action="{cancel_url}"> 
    51                         <input type="submit" name="cancel" value="{lang_cancel}"></form></td> 
     48                        <input type="submit" name="save" value="{lang_save}"></td> 
     49                <td><input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_url}' );"/></td> 
    5250                <td align="right">{delete}</td> 
    5351        </tr> 
    5452</table> 
     53</form> 
    5554</center> 
    5655 
  • trunk/preferences/templates/default/listcats.tpl

    r2 r2802  
    5252        <tr valign="bottom" height="50"> 
    5353                <td> 
    54                         <form method="POST" action="{add_action}"> 
    55                                 <input type="submit" value="{lang_add}"> 
    56                         </form> 
     54                        <input type="button" value="{lang_add}" onclick="ExpressoLivre.link( '{add_action}' );" /> 
    5755                </td> 
    5856                <td> 
    59                         <form method="POST" action="{doneurl}"> 
    60                                 <input type="submit" name="done" value="{lang_cancel}"> 
    61                         </form> 
     57                        <input type="button" name="done" value="{lang_cancel}" onclick="ExpressoLivre.link( '{doneurl}' );" /> 
    6258                </td> 
    6359                <td width="80%">&nbsp;</td> 
Note: See TracChangeset for help on using the changeset viewer.