Changeset 6352 for sandbox/2.4.1-3


Ignore:
Timestamp:
05/30/12 11:35:44 (12 years ago)
Author:
gustavo
Message:

Ticket #2768 - Melhorias na inserção de destinatários na criacao de mensagem

Location:
sandbox/2.4.1-3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.1-3/.htaccess

    r6098 r6352  
    126126RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK|OPTIONS|HEAD)$ [NC] 
    127127RewriteRule ^.*$ - [F]  
     128RewriteRule ^rest(.*)$ prototype/rest/$1 [QSA,L] 
     129 
    128130 
    129131# 
  • sandbox/2.4.1-3/home.php

    r5042 r6352  
    9898                echo parse_navbar(); 
    9999        } 
    100         // Default Applications (Home Page)  
    101         $default_apps = Array(                   
    102                         'workflow',                      
    103                         'expressoMail1_2', 
    104                         'calendar', 
    105                         'news_admin' 
    106                 ); 
    107         $sorted_apps = array(); 
    108         $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
    109         @reset($user_apps);      
    110         for($i = 0; $i < count($default_apps);$i++) { 
    111                 if(array_key_exists($default_apps[$i], $user_apps)){ 
    112                         $sorted_apps[] = $default_apps[$i]; 
    113                 }                
    114         } 
    115          
    116         foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
    117                 $sorted_apps[] = $p['name']; 
    118         } 
    119          
     100 
     101/* 
     102//ESSE TRECHO DE CÓDIGO DEVE SER INSERIDO NOVAMENTE POSTERIORMENTE !!!!!!!!!!! 
     103 
     104        // Default Applications (Home Page)  
     105        $default_apps = Array(                   
     106                        'workflow',                      
     107                        'expressoMail1_2', 
     108                        'calendar', 
     109                        'news_admin' 
     110                ); 
     111        $sorted_apps = array(); 
     112        $user_apps = $GLOBALS['phpgw_info']['user']['apps'];  
     113        @reset($user_apps);      
     114        for($i = 0; $i < count($default_apps);$i++) { 
     115                if(array_key_exists($default_apps[$i], $user_apps)){ 
     116                        $sorted_apps[] = $default_apps[$i]; 
     117                }                
     118        } 
     119         
     120        foreach($GLOBALS['phpgw_info']['user']['apps'] as $i => $p) { 
     121                $sorted_apps[] = $p['name']; 
     122        } 
     123 
    120124        $portal_oldvarnames = array('mainscreen_showevents', 'homeShowEvents','homeShowLatest','mainscreen_showmail','mainscreen_showbirthdays','mainscreen_show_new_updated'); 
    121         $done = array(); 
    122         // Display elements, within appropriate table cells      
    123         @reset($sorted_apps); 
    124         $idx = 1; 
    125         echo "<table width='100%' cellpadding=5>"; 
    126         foreach($sorted_apps as $appname) 
    127         { 
    128                 if((int)$done[$appname] == 1 || empty($appname)){ 
    129                         continue; 
    130                 }                
    131                 $varnames = $portal_oldvarnames; 
    132                 $varnames[] = 'homepage_display'; 
    133                 $thisd = 0; 
    134                 $tmp = ''; 
    135                  
    136                 foreach($varnames as $varcheck) 
    137                 { 
    138                                                                          
    139                         /*if($appname == 'expressoMail1_2') { 
    140                                 $tmp = $appname; 
    141                                 $appname = 'expressoMail'; 
    142                         }*/                              
    143  
    144                         if(array_search($appname, $default_apps) !== False){ 
    145                                 $thisd = 1; 
    146                                 break; 
    147                         } 
    148                         if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
    149                                 $thisd = 1; 
    150                                 break; 
    151                         } 
    152                         else  { 
    153                                 $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
    154                                 if($_thisd > 0) { 
    155                                         $thisd = $_thisd; 
    156                                         break; 
    157                                 } 
    158                         } 
    159                 } 
    160  
    161                 if($thisd > 0) 
    162                 { 
    163                         if($tmp) { 
    164                 $appname = $tmp; 
    165                                 $tmp = ''; 
    166                         } 
    167                         if($idx == 0) {                          
    168                                 print '<tr>'; 
    169                         } 
    170                         print '<td style="vertical-align:top;" width="45%">'; 
    171                         $GLOBALS['phpgw']->hooks->single('home',$appname);                       
    172                         print '</td>'; 
    173                          
    174                         if($idx == 2){ 
    175                                 $idx = 0; 
    176                                 print '</tr>'; 
    177                         }                        
    178                         $idx++; 
    179                         $neworder[] = $appname; 
    180                 } 
    181                 $done[$appname] = 1; 
    182         } 
    183         print '</table>'; 
     125        $done = array(); 
     126        // Display elements, within appropriate table cells      
     127        @reset($sorted_apps); 
     128        $idx = 1; 
     129        echo "<table width='100%' cellpadding=5>"; 
     130        foreach($sorted_apps as $appname) 
     131        { 
     132                if((int)$done[$appname] == 1 || empty($appname)){ 
     133                        continue; 
     134                } 
     135                $varnames = $portal_oldvarnames; 
     136                $varnames[] = 'homepage_display'; 
     137                $thisd = 0; 
     138                $tmp = ''; 
     139 
     140                foreach($varnames as $varcheck) 
     141                { 
     142 
     143                        /*if($appname == 'expressoMail1_2') { 
     144                                $tmp = $appname; 
     145                                $appname = 'expressoMail'; 
     146                        }*/ 
     147/* 
     148                        if(array_search($appname, $default_apps) !== False){ 
     149                                $thisd = 1; 
     150                                break; 
     151                        } 
     152                        if($GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]=='True') { 
     153                                $thisd = 1; 
     154                                break; 
     155                        } 
     156                        else  { 
     157                                $_thisd = (int)$GLOBALS['phpgw_info']['user']['preferences'][$appname][$varcheck]; 
     158                                if($_thisd > 0) { 
     159                                        $thisd = $_thisd; 
     160                                        break; 
     161                                } 
     162                        } 
     163                } 
     164 
     165               if($thisd > 0) 
     166                { 
     167                        if($tmp) { 
     168                $appname = $tmp; 
     169                                $tmp = ''; 
     170                        } 
     171                        if($idx == 0) { 
     172                                print '<tr>'; 
     173                        } 
     174                        print '<td style="vertical-align:top;" width="45%">'; 
     175                        $GLOBALS['phpgw']->hooks->single('home',$appname); 
     176                        print '</td>'; 
     177 
     178                        if($idx == 2){ 
     179                                $idx = 0; 
     180                                print '</tr>'; 
     181                        } 
     182                        $idx++; 
     183                        $neworder[] = $appname; 
     184                } 
     185                $done[$appname] = 1; 
     186        } 
     187        print '</table>'; 
     188*/ 
     189 
     190 
     191 
     192//Inicio         
     193        echo ' 
     194            <link rel="Stylesheet" type="text/css" href="prototype/plugins/jquery/jquery-ui.css" />                                      
     195     
     196            <script type="text/javascript" src="prototype/plugins/jquery/jquery.min.js"></script> 
     197         
     198            <script type="text/javascript" src="prototype/plugins/jquery/jquery-ui.min.js"></script> 
     199            <script type="text/javascript" src="prototype/plugins/jquery/jquery-ui.custom.min.js"></script> 
     200            <script src="prototype/plugins/json2/json2.js" language="javascript"></script> 
     201            <script src="prototype/plugins/ejs/ejs.js" language="javascript"></script> 
     202            <script src="prototype/plugins/store/jquery.store.js" language="javascript"></script> 
     203             
     204            <script src="prototype/api/datalayer.js" language="javascript"></script>     
     205            
     206            <script type="text/javascript" src="prototype/plugins/datejs/date-pt-BR.js"></script> 
     207            <script type="text/javascript" src="prototype/plugins/datejs/sugarpak.js"></script> 
     208            <script type="text/javascript" src="prototype/plugins/datejs/parser.js"></script> 
     209 
     210            <script type="text/javascript" src="prototype/plugins/countdown/jquery.countdown.min.js"></script> 
     211            <script type="text/javascript" src="prototype/plugins/countdown/jquery.countdown-pt-BR.js"></script> 
     212 
     213            <script type="text/javascript" src="prototype/modules/home/js/home.js"></script> 
     214            <link rel="Stylesheet" type="text/css" href="prototype/modules/home/css/home.css" />         
     215        '; 
     216 
     217        echo' 
     218            <tr> 
     219                <td> 
     220                    <div class="portlets" style="width: 100%;"></div> 
     221                <td> 
     222            </tr>'; 
     223 
     224//Fim    
    184225        $GLOBALS['phpgw']->common->phpgw_footer(); 
    185226?> 
  • sandbox/2.4.1-3/phpgwapi/templates/default/login_default.php

    r5281 r6352  
    177177                        else 
    178178                                $_POST['login'] = $_POST['user']; 
     179 
     180                        /** 
     181                         * LOGIN OAUTH POR CURL 
     182                         */ 
     183                        $ch = curl_init(); 
     184 
     185                        $param  = 'grant_type=password'; 
     186                        $param .= '&client_id=' . $GLOBALS['oauth']['client_id']; 
     187                        $param .= '&client_secret=' . $GLOBALS['oauth']['client_secret']; 
     188                        $param .= '&username=' . $_POST['user']; 
     189                        $param .= '&password=' . $_POST['passwd']; 
     190 
     191                        // set URL and other appropriate options 
     192                        curl_setopt($ch, CURLOPT_URL, $GLOBALS['oauth']['url_token']); 
     193                        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: */*')); 
     194                        curl_setopt($ch, CURLOPT_POST, TRUE); 
     195                        curl_setopt($ch, CURLOPT_POSTFIELDS, $param); 
     196                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);  //configura para nao imprimir a saida na tela 
     197                        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);//Passe um nï¿œmero long como parï¿œmetro que contï¿œm o limite de tempo, em segundos, que vocï¿œ permite as funᅵᅵes CURL levar.  
     198 
     199                        // grab URL and pass it to the browser 
     200                        $res = curl_exec($ch); 
     201                         
     202                        // close cURL resource, and free up system resources 
     203                        curl_close($ch); 
     204                        $a = json_decode($res); 
     205         
     206                        if ( isset($a->access_token) ) { 
     207                                $_SESSION['oauth']['access_token'] = $a->access_token; 
     208                                $_SESSION['oauth']['expires_in'] = $a->expires_in; 
     209                                $_SESSION['oauth']['token_type'] = $a->token_type; 
     210                                $_SESSION['oauth']['scope'] = $a->scope; 
     211                                $_SESSION['oauth']['refresh_token'] = $a->refresh_token; 
     212                                 
     213                                 
     214                        } 
     215                        else { 
     216                        } 
     217                        /** 
     218                         * #################### 
     219                         */ 
     220 
    179221                } 
    180222                if(getenv('REQUEST_METHOD') != 'POST' && $_SERVER['REQUEST_METHOD'] != 'POST' && 
     
    598640        if(isset($ultima_revisao)) $tmpl->set_var('ultima_rev','<br>' . $ultima_revisao); 
    599641 
    600         // Adiciona código personalizado de outro template 
     642        // Adiciona cï¿œdigo personalizado de outro template 
    601643        // que esteja utilizando o login_default.php 
    602644        if(is_file('.'.$template_dir.'/login.inc.php')) { 
Note: See TracChangeset for help on using the changeset viewer.