Changeset 5394


Ignore:
Timestamp:
01/18/12 13:23:58 (12 years ago)
Author:
acoutinho
Message:

Ticket #2434 - Melhoria e correcao de bugs na importacao de eventos pelo expressoMail

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.db_functions.inc.php

    r5388 r5394  
    394394            $uiicalendar = CreateObject("calendar.uiicalendar"); 
    395395                        if($params['selected'] || $params['readable']){ 
     396                                $user = $params['id_user']; 
     397                                 
    396398                                $_REQUEST['data'] = $fileContent; 
    397399                                $_REQUEST['type'] = 'iCal'; 
     
    404406                                $output = ob_get_clean();                        
    405407                                $valid = json_decode($output, true); 
    406  
    407  
    408408                                if($_REQUEST['readable']){       
    409409                                        if(!$valid) 
     
    411411                                                $return = false; 
    412412                                                $output = unserialize($output); 
    413                                                 foreach($output[0] as $key => $value){ 
    414                                                         if(array_key_exists("id",$output[0][$key])) 
    415                                                                 $return = true; 
     413                                         
     414                                                ob_start(); 
     415                                                var_dump($output[0]);                                            
     416                                                $l = ob_get_clean(); 
     417                                                file_put_contents( "/tmp/acoutinho.log",  $l , FILE_APPEND); 
     418 
     419                                                 
     420                                                 
     421                                                foreach($output[0] as $key => &$value){ 
     422                                                 
     423                                                        if(isset($value['user'])){                                                       
     424                                                                if($user == $value['user']) 
     425                                                                        return  $value['schedulable']; 
     426                                                        } 
    416427                                                } 
    417                                                 return $return; 
    418428                                        } 
    419429                                        return false; 
  • trunk/expressoMail1_2/index.php

    r5390 r5394  
    9191        '; 
    9292 
     93        /** 
     94        * Importacao de plugins e dados do nova agenda 
     95        * 
     96        * 
     97        */ 
     98         
     99        echo" 
     100                 
     101                <script type='text/javascript' src='../prototype/app/plugins/datejs/date-pt-BR.js'></script> 
     102                <script type='text/javascript' src='../prototype/app/plugins/datejs/sugarpak.js'></script> 
     103                <script type='text/javascript' src='../prototype/app/plugins/datejs/parser.js'></script> 
     104                <script type='text/javascript' src='../prototype/app/plugins/dateFormat/dateFormat.js'></script> 
     105                 
     106                <script src='../prototype/app/plugins/ejs/ejs.js' language='javascript'></script> 
     107                <script src='../prototype/app/plugins/store/jquery.store.js' language='javascript'></script> 
     108                <script src='../prototype/app/datalayer.js' language='javascript'></script> 
     109                <script type='text/javascript' src='../prototype/app/plugins/scrollto/jquery.scrollTo.js'></script> 
     110                <script language='javascript'>DataLayer.dispatchPath = '../prototype/';</script> 
     111         
     112                <script> 
     113                $.ajax({ 
     114                                url: '../prototype/modules/calendar/index.php', 
     115                                async: false, 
     116                                success: function(){ 
     117                                } 
     118                }); 
     119                </script> 
     120                <script type='text/javascript' src='../prototype/modules/calendar/js/calendar.codecs.js'></script> 
     121                <script type='text/javascript' src='../prototype/modules/calendar/js/helpers.js'></script> 
     122                <script language='javascript'>var CalendarBkp = Calendar;</script> 
     123 
     124         
     125         
     126        "; 
     127         
     128         echo "<script language='javascript'>Calendar = $.extend(CalendarBkp, Calendar);</script>"; 
     129         
     130         
    93131        /* 
    94132         * TODO: implementar o controle como preferência do usuário  
  • trunk/expressoMail1_2/js/main.js

    r5393 r5394  
    34073407                        success: function(){ 
    34083408                                $.ajax({ 
    3409                                         url: "controller.php?action="+import_url+'&from_ajax=true&selected='+$("#select-agenda option:selected").val()+'&readable=true', 
     3409                                        url: "controller.php?action="+import_url+'&from_ajax=true&id_user='+User.me.id+'&readable=true&cirus_delimiter='+cyrus_delimiter, 
    34103410                                        async: false, 
    34113411                                        success: function(data){ 
    34123412                                                data = connector.unserialize(data); 
    3413                                                 if(data){ 
    3414                                                         up = true; 
    3415                                                         $("#select-agenda").css("display", "none"); 
    3416                                                         $("#import-dialog" ).children("p:first-child").css("display", "none"); 
    3417                                                         $("#import-dialog" ).dialog({ 
    3418                                                                 height: 160, 
    3419                                                                 title: 'Atualizar Evento' 
    3420                                                         }); 
    3421                                                         $(".ui-dialog-buttonpane").find(".ui-button:last").children().html("Atualizar"); 
     3413                                                 
     3414                                                         
     3415                                                var createDialog = function(isCorrentEvent){ 
     3416                                                         
     3417                                                        if(!(!!isCorrentEvent)){ 
     3418                                                                $("#select-agenda").html(''); 
     3419                                                                for(var calendario in Calendar.calendarIds){ 
     3420                                                                        var doc = document .createElement("OPTION"); 
     3421                                                                        doc.value = Calendar.signatures[parseInt(calendario)].calendar.id; 
     3422                                                                        doc.innerHTML = Calendar.signatures[parseInt(calendario)].calendar.name; 
     3423                                                                        $("#select-agenda").append(doc); 
     3424                                                                };                                       
     3425                                                         
     3426                                                        }else{ 
     3427                                                                up = true; 
     3428                                                                $("#select-agenda").css("display", "none"); 
     3429                                                                $("#import-dialog" ).children("p:first-child").css("display", "none"); 
     3430                                                                $("#import-dialog" ).dialog({ 
     3431                                                                        height: 160, 
     3432                                                                        title: 'Atualizar Evento' 
     3433                                                                }); 
     3434                                                                $(".ui-dialog-buttonpane").find(".ui-button:last").children().html("Atualizar");                 
     3435                                                        }; 
     3436                                                        $( "#import-dialog" ).dialog( "open" );  
     3437                                                }; 
     3438                                                 
     3439                                                 
     3440                                                 
     3441                                                if(!!data){ 
     3442                                                        var isCorrentEvent = false; 
     3443                                                        var count = 0; 
     3444                                                         
     3445                                                        $.getJSON("../prototype/request.php", 
     3446                                                        { 
     3447                                                                concept : "calendarToSchedulable", 
     3448                                                                filter : ['AND', ['IN', 'calendar', Calendar.calendarIds], ['=', 'schedulable', data]] 
     3449                                                        }, createDialog); 
     3450                                                }else{ 
     3451                                                        createDialog(false); 
    34223452                                                } 
    3423                                                 else{ 
    3424                                                         $.getJSON("../prototype/me.php", function(user){ 
    3425                                                                 logUser = user; 
    3426                                                                 up = false; 
    3427                                                                 $("#select-agenda").css("display", ""); 
    3428                                                                 $("#import-dialog" ).children("p:first-child").css("display", ""); 
    3429                                                                 $.getJSON("../prototype/request.php", 
    3430                                                                 { 
    3431                                                                         concept : "calendarSignature", 
    3432                                                                         criteria : {'deepness' : 2}, 
    3433                                                                         filter : ["=", "user", logUser.id] 
    3434                                                                 }, function(calendarSignatures){ 
    3435                                                                         $("#select-agenda").html(''); 
    3436                                                                         for(var calendario in calendarSignatures){ 
    3437                                                                                 var doc = document .createElement("OPTION"); 
    3438                                                                                 doc.value = calendarSignatures[parseInt(calendario)].calendar.id; 
    3439                                                                                 doc.innerHTML = calendarSignatures[parseInt(calendario)].calendar.name; 
    3440                                                                                 $("#select-agenda").append(doc); 
    3441                                                                         } 
    3442                                                                 }); 
    3443                                                         }); 
    3444                                                 } 
    3445                                         } 
    3446                                 }); 
    3447                         } 
    3448                 }); 
    3449         } 
    3450         else 
    3451         {                        
    3452                 if(confirm(get_lang("Do you confirm this import to your Calendar?"))){ 
    3453                         cExecute( import_url +'&from_ajax=true',handler_import_calendar); 
    3454                 } 
    3455         } 
    3456         $( "#import-dialog" ).dialog( "open" ); 
     3453                                }}); 
     3454                        }}); 
     3455                } 
    34573456} 
    34583457function open_msg_part(data){ 
  • trunk/prototype/app/datalayer.js

    r5376 r5394  
    10131013            result = this.request( concept, id || filter.filter, filter.criteria ); 
    10141014 
    1015             if( result && bothSides && !filter.criteria.format ) 
     1015            if( result && bothSides && (!filter ||  
     1016                                                                        !filter.criteria ||  
     1017                                                                        !filter.criteria.format) ) 
    10161018            { 
    10171019              var newResult = []; 
Note: See TracChangeset for help on using the changeset viewer.