Changeset 5636


Ignore:
Timestamp:
03/05/12 19:01:39 (12 years ago)
Author:
acoutinho
Message:

Ticket #2434 - Implementacao da funcionalidade de mapa de disponibilidade

Location:
trunk
Files:
3 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/index.php

    r5622 r5636  
    2828        //jquery and Editor  
    2929                echo '                           
     30                                <link rel="stylesheet" type="text/css" href="../prototype/plugins/fullcalendar/fullcalendar.css"></link> 
     31                                <link rel="stylesheet" type="text/css" href="../prototype/plugins/fullcalendar/fullcalendar.print.css"></link> 
     32                                <link rel="stylesheet" type="text/css" href="../prototype/plugins/icalendar/jquery.icalendar.css"></link> 
     33                         
     34                         
    3035                                        <link rel="Stylesheet" type="text/css" href="templates/default/expressoMail_reset.css" /> 
    3136                                        <script type="text/javascript" src="../prototype/plugins/jquery/jquery.min.js"></script> 
     
    5661                                        <link rel="stylesheet" type="text/css" href="../prototype/plugins/zebradialog/css/zebra_dialog.css"></link> 
    5762                                        <link rel="stylesheet" type="text/css" href="../prototype/plugins/fileupload/jquery.fileupload-ui.css"></link> 
     63                                         
    5864                                        <link rel="stylesheet" href="../prototype/plugins/farbtastic/farbtastic.css" type="text/css" > 
    5965                                        <script type="text/javascript" src="../prototype/plugins/zebradialog/javascript/zebra_dialog.js"></script> 
  • trunk/expressoMail1_2/js/main.js

    r5626 r5636  
    32303230                 
    32313231                //$.ajax({ url: "../expressoCalendar/index.php", async: false}); 
    3232                 $.ajax({url: "../prototype/modules/calendar/js/calendar.date.js", async: false}); 
    3233                 $.ajax({url: "../prototype/modules/calendar/js/helpers.js", async: false}); 
     3232                $.ajax({url: "../prototype/modules/calendar/js/calendar.date.js", async: false, beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 
     3233                $.ajax({url: "../prototype/modules/calendar/js/map.disponibility.js", async: false, beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 
     3234                $.ajax({url: "../prototype/modules/calendar/js/helpers.js", async: false, beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 
    32343235                //$.ajax({ url: "../prototype/modules/calendar/js/timezone.js", async: false}); 
    32353236                //$.ajax({ url: "../prototype/modules/calendar/js/calendar.codecs.js", async: false}); 
    3236                 $.ajax({url: "../prototype/plugins/encoder/encoder.js", async: false}); 
    3237                 $.ajax({url: "../prototype/plugins/dateFormat/dateFormat.js", async: false}); 
    3238  
     3237                $.ajax({url: "../prototype/plugins/encoder/encoder.js", async: false, beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 
     3238                $.ajax({url: "../prototype/plugins/dateFormat/dateFormat.js", async: false, beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 
     3239 
     3240                $.ajax({ url: "../prototype/plugins/fullcalendar/fullcalendar.js", async: false , beforeSend: function( xhr ) { xhr.overrideMimeType('text/javascript; charset=ISO-8859-1')}}); 
     3241                 
    32393242                 
    32403243                DataLayer.dispatchPath = "../prototype/";        
  • trunk/expressoMail1_2/templates/default/expressoMail_reset.css

    r5592 r5636  
    88 * http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ 
    99 */ 
    10  
     10/* 
    1111.new-event-win.active applet, .new-event-win.active object, .new-event-win.active iframe, .new-event-win.active fieldset, .new-event-win.active div 
    1212.new-event-win.active h1, .new-event-win.active h2, .new-event-win.active h3, .new-event-win.active h4, .new-event-win.active h5, .new-event-win.active h6, .new-event-win.active p, .new-event-win.active blockquote, .new-event-win.active pre, 
     
    2727        /*vertical-align: baseline;*/ 
    2828/*      font-family: Arial,Helvetica,sans-serif;*/ 
    29 } 
    30  
     29/*}*/ 
    3130.new-event-win.active:focus { 
    3231        outline: 0; 
     
    114113        border: 0; 
    115114} 
     115 
     116.new-event-win.active .fc-event-skin { 
     117        border-color: #36C !important; 
     118        background-color: #36C !important;  
     119        color: white !important; 
     120} 
     121 
     122.fc-event-vert .fc-event-bg { 
     123        display: block !important; 
     124} 
     125 
     126.map-event{ 
     127 
     128} 
     129 
     130#new_event_map .map-event .fc-event-inner.fc-event-skin{ 
     131        border-style: dashed !important; 
     132        border-width: 2px !important; 
     133        border-color: #36C !important; 
     134        background-color: transparent !important; 
     135} 
     136 
     137 #new_event_map .map-event .fc-event-inner.fc-event-skin .fc-event-head{ 
     138        background-color: transparent !important; 
     139        color: transparent !important; 
     140} 
     141 
     142 
    116143/*#divAppbox 
    117144{ background: #fff url( ../images/bgBlockContent.jpg ) repeat-x; border-color: #9c9c9c; } 
  • trunk/prototype/modules/calendar/css/style.css

    r5592 r5636  
    437437 
    438438 
    439  
     439.map-event{ 
     440        border-style: dashed; 
     441        border-width: 2px; 
     442        border-color: #36C; 
     443        background-color: transparent; 
     444        color: black; 
     445} 
     446 
     447 
     448#new_event_map .fc-event-head.fc-event-skin,.fc-event-inner.fc-event-skin{ 
     449        border-color: transparent; 
     450} 
  • trunk/prototype/modules/calendar/interceptors/DBMapping.php

    r5615 r5636  
    123123 
    124124    public function encodeUpdateSchedulable( &$uri , &$params , &$criteria , $original ){        
    125         if(isset($params['startTime'])) 
    126                 $params['rangeStart'] = $params['startTime'] ; 
    127         if(isset($params['endTime'])) 
    128                 $params['rangeEnd'] = $params['endTime'] ;        
    129                  
    130                  
     125         
     126                $event = Controller::find( array( 'concept' => 'schedulable' , array('timezone') ,'id' => $params['id'] ) );     
     127                 
     128                if(isset($params['startTime'])){ 
     129                         
     130                        if(!is_numeric($params['startTime']) ) 
     131                                $params['startTime'] =  strtotime( $params['startTime'] . ' ' .$event['timezone']).'000'; 
     132                        else 
     133                                $params['rangeStart'] = $params['startTime'] ; 
     134                    
     135                }if(isset($params['endTime'])){ 
     136                         
     137                        if (!is_numeric($params['endTime'])) 
     138                                $params['endTime'] =   strtotime( $params['endTime'] . ' ' .$event['timezone']).'000'; 
     139                        else 
     140                                $params['rangeEnd'] = $params['endTime'] ;        
     141                                 
     142                }     
    131143     }         
    132144      
  • trunk/prototype/modules/calendar/interceptors/Helpers.php

    r5615 r5636  
    44 
    55    public static function futureEvent( $startTime , $rangeEnd ) 
    6     { 
     6    {    
    77        //Verifica data   
    88                $range = new DateTime( '@'.(int)($rangeEnd / 1000) , new DateTimeZone('UTC') ); 
  • trunk/prototype/modules/calendar/js/calendar.codecs.js

    r5617 r5636  
    434434                        return { 
    435435                                participant : meAttendee(form.attendee),  
    436                                 startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd hh:mm:00'), 
    437                                 endTime:  Date.parseExact(form.endDate + ( !!form.allDay ? " 00:00": " "+$.trim(form.endHour)), formatString ).toString('yyyy-MM-dd hh:mm:00'), 
     436                                startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd HH:mm:00'), 
     437                                endTime:  Date.parseExact(form.endDate + ( !!form.allDay ? " 00:00": " "+$.trim(form.endHour)), formatString ).toString('yyyy-MM-dd HH:mm:00'), 
    438438                                allDay: ( !!form.allDay ? 1 : 0 ), 
    439439                                schedulable: form.idEvent 
     
    521521                                                                        participant: me.id, 
    522522                                                                        type: 'suggestion', 
    523                                                                         startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd hh:mm:00'), 
    524                                                                         endTime:  Date.parseExact(form.endDate + ( !!form.allDay ? " 00:00": " "+$.trim(form.endHour)), formatString ).toString('yyyy-MM-dd hh:mm:00'), 
     523                                                                        startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd HH:mm:00'), 
     524                                                                        endTime:  Date.parseExact(form.endDate + ( !!form.allDay ? " 00:00": " "+$.trim(form.endHour)), formatString ).toString('yyyy-MM-dd HH:mm:00'), 
    525525                                                                        allDay: ( !!form.allDay ? 1 : 0 ), 
    526526                                                                        schedulable: form.idEvent 
     
    673673                    return { 
    674674                              "class": form["class"], 
    675                                   startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd hh:mm:00'), 
    676                                   endTime:  Date.parseExact(form.endDate + ( !!form.allDay ? " 00:00": " "+$.trim(form.endHour)), formatString ).toString('yyyy-MM-dd hh:mm:00'),  //+ (!!form.allDay ? 86400000 : 0) , 
     675                                  startTime: Date.parseExact(form.startDate + (!!form.allDay ? " 00:00": " "+$.trim(form.startHour)) , formatString ).toString('yyyy-MM-dd HH:mm:00'), 
     676                                  endTime:  Date.parseExact(form.endDate + ( !!form.allDay ? " 00:00": " "+$.trim(form.endHour)), formatString ).toString('yyyy-MM-dd HH:mm:00'),  //+ (!!form.allDay ? 86400000 : 0) , 
    677677                                  allDay: ( !!form.allDay ? 1 : 0 ), 
    678678                              id: form.idEvent, 
  • trunk/prototype/modules/calendar/js/helpers.js

    r5615 r5636  
    6161function eventDetails( objEvent, decoded, path, isMail) 
    6262{ 
     63        attendees = {}; 
     64 
    6365        if(path == undefined) 
    6466                path = ""; 
     
    9395                'p': 'acl-participation-required' 
    9496        }; 
    95         /** 
    96         * callback de participantes generico 
    97         */ 
     97         
    9898        var callbackAttendee = function(){ 
    9999                //Cria qtip de permissões pelo click do checkbox 
     
    298298                                        if ($('dd.attendee-list li:last').data('qtip')) 
    299299                                                $('dd.attendee-list li:last').qtip('destroy'); 
     300                                                 
     301                                        attendees  = {}; 
    300302 
    301303                                }, 
     
    418420                                UI.dialogs.addEvent.find('.start-time, .end-time').addClass('hidden') : 
    419421                            UI.dialogs.addEvent.find('.start-time, .end-time').removeClass('hidden');  
     422                        updateMap(true); 
    420423            }); 
    421424 
     
    430433            UI.dialogs.addEvent.find(".input-group .h1").Watermark("Evento sem título"); 
    431434                if(User.preferences.hourFormat.length == 5) { 
    432                         UI.dialogs.addEvent.find(".end-time, .start-time").mask("99:99"); 
     435                        UI.dialogs.addEvent.find(".end-time, .start-time").mask("99:99", { 
     436                                completed: function(){ 
     437                                        updateMap(); 
     438                                } 
     439                        }); 
    433440                } else { 
    434441                        $.mask.definitions['{']='[ap]'; 
     
    439446                                        $(this).timepicker("refresh"); 
    440447                                        $(this).val($(this).val().replace(/[\.]/gi, "")); 
     448                                        updateMap(); 
    441449                                } 
    442450                        }); 
     
    444452                UI.dialogs.addEvent.find(".number").numeric(); 
    445453                User.preferences.dateFormat.indexOf('-') > 0 ?  
    446                         UI.dialogs.addEvent.find(".date").mask("99-99-9999") : 
    447                         UI.dialogs.addEvent.find(".date").mask("99/99/9999"); 
     454                        UI.dialogs.addEvent.find(".date").mask("99-99-9999", { 
     455                                completed:function(){ 
     456                                        updateMap(); 
     457                                } 
     458                        }) :  
     459                        UI.dialogs.addEvent.find(".date").mask("99/99/9999", { 
     460                                completed:function(){ 
     461                                        updateMap(); 
     462                                } 
     463                        }); 
    448464 
    449465            UI.dialogs.addEvent.find(".menu-addevent") 
     
    485501            }); 
    486502 
    487             UI.dialogs.addEvent.find('input.date').datepicker({dateFormat: 'dd/mm/yy'}); 
    488                 if(path == ""){ 
    489                         UI.dialogs.addEvent.find('input.time').timepicker({  
    490                                 closeText: 'Ok', 
    491                                 hourGrid: 4, 
    492                                 minuteGrid: 10, 
    493                                 ampm : ((User.preferences.hourFormat.length > 5) ? true: false), 
    494                                 timeFormat: "hh:mm tt", 
    495                                 onSelect: function (selectedDateTime){ 
    496                                         if(!(User.preferences.hourFormat.length == 5)) 
    497                                                 $(this).val(selectedDateTime.replace(/[\.]/gi, ""));                                                             
    498                                 }, 
    499                                 onClose : function (selectedDateTime){ 
    500                                         if(!(User.preferences.hourFormat.length == 5)) 
    501                                                 $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 
    502                                 } 
    503                         }); 
    504                 } 
     503                var dates = UI.dialogs.addEvent.find('input.date').datepicker({ 
     504                        dateFormat: 'dd/mm/yy', 
     505                        onSelect : function( selectedDate ){ 
     506                                updateMap(); 
     507                        } 
     508                }); 
     509                //if(path == ""){ 
     510                UI.dialogs.addEvent.find('input.time').timepicker({  
     511                        closeText: 'Ok', 
     512                        hourGrid: 4, 
     513                        minuteGrid: 10, 
     514                        ampm : ((User.preferences.hourFormat.length > 5) ? true: false), 
     515                        timeFormat: "hh:mm tt", 
     516                        onSelect: function (selectedDateTime){ 
     517                                if(!(User.preferences.hourFormat.length == 5)) 
     518                                        $(this).val(selectedDateTime.replace(/[\.]/gi, ""));                                                             
     519                                updateMap(); 
     520                        }, 
     521                        onClose : function (selectedDateTime){ 
     522                                if(!(User.preferences.hourFormat.length == 5)) 
     523                                        $(this).val(selectedDateTime.replace(/[\.]/gi, "")); 
     524                        } 
     525                }); 
     526                //} 
    505527 
    506528            UI.dialogs.addEvent.find('.button-add-alarms').click(function(){ 
     
    598620                                         */ 
    599621 
    600                                         var user = DataLayer.get('user', ["=", "mail", $(this).val()], true); 
    601                                          
     622                                        var user = DataLayer.get('user', ["=", "mail", $(this).val()]); 
     623                                        if(user[0].id) 
     624                                                attendees[user[0].id].name  = user[0].name; 
    602625                                         
    603626                                        /** 
     
    824847                                                        old_item = $(event.target).parents('li'); 
    825848                                                        newAttendeeId = DataLayer.put('participant', {user: old_item.find('.id').html(), isExternal: 0}); 
     849                                                         
     850                                                        attendees[old_item.find('.id').html()] = old_item.find('.name').html(); 
     851                                                         
    826852                                                        blkAddAtendee.find('dd.attendee-list ul.attendee-list') 
    827853                                                        .append(DataLayer.render(path+'templates/participants_add_itemlist.ejs', [{id: newAttendeeId, name: old_item.find('.name').html(), mail: old_item.find('.mail').html(), isExternal: 0, acl: objEvent.acl}])) 
     
    10341060                progressTimer = window.setInterval(intervalHandler, interval); 
    10351061        }); 
    1036                  
     1062         
     1063        if(objEvent.isShared){ 
     1064                 
     1065                var acls = Calendar.signatureOf[objEvent.calendar].permission.acl; 
     1066                 
     1067                if(!acls.write){ 
     1068                        UI.dialogs.addEvent.find(':input').attr('disabled', 'disabled'); 
     1069                        UI.dialogs.addEvent.find('.button').hide(); 
     1070                } 
     1071                 
     1072                if(acls.remove) 
     1073                        UI.dialogs.addEvent.find('.button.remove').show(); 
     1074                 
     1075                UI.dialogs.addEvent.find('.button.cancel').show(); 
     1076                 
     1077         
     1078        } 
     1079 
     1080        disponibily(objEvent, path, attendees); 
     1081          
    10371082        UI.dialogs.addEvent.find(':input').change(function(event){ 
    10381083                if (event.keyCode != '27' && event.keyCode != '13') 
     
    10421087                        canDiscardEventDialog = false; 
    10431088        });      
    1044          
    1045         if(objEvent.isShared){ 
    1046                  
    1047                 var acls = Calendar.signatureOf[objEvent.calendar].permission.acl; 
    1048                  
    1049                 if(!acls.write){ 
    1050                         UI.dialogs.addEvent.find(':input').attr('disabled', 'disabled'); 
    1051                         UI.dialogs.addEvent.find('.button').hide(); 
    1052                 } 
    1053                  
    1054                 if(acls.remove) 
    1055                         UI.dialogs.addEvent.find('.button.remove').show(); 
    1056                  
    1057                 UI.dialogs.addEvent.find('.button.cancel').show(); 
    1058                  
    1059          
    1060         } 
    1061          
    1062                  
     1089 
    10631090        UI.dialogs.addEvent.dialog('open'); 
     1091        //$('[href="#calendar_addevent_details7"]').trigger('click'); 
     1092        //$('[href="#calendar_addevent_details2"]').trigger('click'); 
    10641093} 
    10651094 
     
    13321361                                        refresh_calendars(); 
    13331362                                }); 
    1334                                  
    13351363                        }).end().filter('.cancel').click(function(evt){ 
    13361364                                $tabs.tabs( "remove", "#configure_tab"); 
     
    14281456                                if(idCalendar == User.preferences.defaultCalendar) 
    14291457                                        DataLayer.remove( 'modulePreference', User.preferenceIds['defaultCalendar']); 
    1430                                          
    1431                                          
     1458                         
    14321459                                DataLayer.commit( false, false, function( received ){ 
    14331460                                        delete Calendar.currentViewKey; 
     
    15401567                                        borderColor: colorsSuggestions[selected]['border'].substring(1) 
    15411568                                }); 
    1542                                  
    15431569                                DataLayer.commit( false, false, function( received ){ 
    15441570                                        delete Calendar.currentViewKey; 
     
    15461572                                        refresh_calendars(); 
    15471573                                }); 
    1548                                  
    15491574                                meu_container.find(".button.new").qtip('destroy'); 
    15501575                        }); 
     
    19792004                delete schedulable.repeat; 
    19802005         
     2006 
    19812007                schedulable.calendar = DataLayer.copy(calendar);         
    19822008         
     
    19852011                 
    19862012                var participants = DataLayer.copy(schedulable.participants); 
    1987                  
    19882013                delete schedulable.participants; 
    19892014                 
     
    19962021         
    19972022                        delete participant.id; 
    1998                         delete participant.schedulable; 
    1999                         delete participant.delegatedFrom; 
    20002023                         
    20012024                        return participant ; 
    20022025        }); 
    20032026         
    2004                 DataLayer.put('schedulable', newSchedulable);            
     2027         
     2028         
     2029                DataLayer.put('schedulable', newSchedulable); 
     2030 
    20052031        } 
    20062032         
  • trunk/prototype/modules/calendar/templates/event_add.ejs

    r5592 r5636  
    5353                <li><a href="#calendar_addevent_details5">Anexos</a></li> 
    5454                <li><a href="#calendar_addevent_details6">Participantes</a></li> 
     55                <li><a href="#calendar_addevent_details7">Disponibilidade</a></li> 
    5556        </ul> 
    5657        <fieldset id="calendar_addevent_details2" class="tab-level2"> 
     
    146147        </fieldset> 
    147148        <fieldset id="calendar_addevent_details6" class="tab-level2" title="Participantes"> 
    148         </fieldset> 
    149          
     149        </fieldset>      
     150         
     151        <fieldset id="calendar_addevent_details7" class="tab-level2" title="Disponibilidade"> 
     152        </fieldset> 
    150153         
    151154        <fieldset class="attachment-list hidden"> 
  • trunk/prototype/modules/calendar/templates/index.ejs

    r5592 r5636  
    8484<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.date.js'></script> 
    8585 
     86<script type='text/javascript' src='<?= MODULESURL ?>/js/map.disponibility.js'></script> 
    8687<script type='text/javascript' src='<?= MODULESURL ?>/js/helpers.js'></script> 
    8788<script type='text/javascript' src='<?= MODULESURL ?>/js/calendar.shared.js'></script> 
Note: See TracChangeset for help on using the changeset viewer.