Changeset 7982 for branches/2.5/admin


Ignore:
Timestamp:
03/08/13 16:32:58 (11 years ago)
Author:
douglas
Message:

Ticket #3378 - Importação automatica de eventos nos participantes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/admin/inc/class.uiconfig.inc.php

    r7655 r7982  
    5353                                default: 
    5454                                        $appname = $_GET['appname']; 
    55                                         $config_appname = $appname; 
     55                                        $config_appname = (isset($_GET['config']) && $_GET['config']) ? $_GET['config'] : $appname ; 
    5656                                        break; 
    5757                        } 
     
    7272                        } 
    7373         
    74                 if($appname === "expressoCalendar"){                                             
     74                if($appname === "expressoCalendar"){  
     75  
     76            if($config_appname == 'expressoCalendar' )  
     77            {  
     78                $t->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=' . $appname));  
     79  
     80            };  
     81  
     82            if($_POST['newsettings']['expressoCalendar_autoImportCalendars'] == 'true')  
     83            {  
     84                $db = $GLOBALS['phpgw']->db;  
     85                $calendars = array();  
     86                $db->query('SELECT calendar_signature.user_uidnumber as "user",calendar.id as "calendar" FROM calendar,calendar_signature WHERE calendar.id = calendar_signature.calendar_id AND calendar.type = 0 AND calendar_signature.is_owner = 1 AND (SELECT id from module_preference WHERE user_uidnumber = calendar_signature.user_uidnumber AND module_preference.module = \'expressoCalendar\' AND module_preference.name = \'dafaultImportCalendar\'  ) IS NULL');  
     87                while( $db->next_record() )  
     88                {  
     89                    $calendars[] = $db->row();  
     90                }  
     91  
     92                foreach($calendars as $v)  
     93                {  
     94                    $db->query('INSERT INTO module_preference ("user_uidnumber","value","name","module") VALUES ( \''.$v['user'].'\' , \''.$v['calendar'].'\',\'dafaultImportCalendar\' , \'expressoCalendar\')');  
     95                }  
     96            }  
     97  
    7598                        if (isset($_POST['migration']) && ($_POST['migration']  == "true")){ 
    7699                         
     
    80103                                $migratrion->calendar(); 
    81104                        } 
     105  
    82106                } 
    83107 
     
    105129                                                        if(function_exists(substr($key,0,strrpos($key,'_')))) 
    106130                                { 
    107                                 call_user_func(substr($key,0,strrpos($key,'_')),&$config); 
     131                                call_user_func(substr($key,0,strrpos($key,'_')), $config); 
    108132                                }  
    109133                                else  
     
    114138                                if($GLOBALS['config_error']) 
    115139                                                        { 
    116                                                                 $errors .= lang($GLOBALS['config_error']) . ' '; 
     140                                                                $errors = lang($GLOBALS['config_error']) . ' '; 
    117141                                                                $GLOBALS['config_error'] = False; 
    118142                                                        } 
Note: See TracChangeset for help on using the changeset viewer.