Changeset 5442


Ignore:
Timestamp:
01/27/12 19:25:06 (12 years ago)
Author:
acoutinho
Message:

Ticket #2434 - Correção de bugs e melhorias

Location:
trunk/prototype/modules/calendar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/prototype/modules/calendar/css/style.css

    r5427 r5442  
    187187/* fc custumize */ 
    188188 
    189 .blocked-event div{ 
     189.blocked-event div, .blocked-event-permision div{ 
    190190background: -moz-linear-gradient(-45deg,  rgba(0,0,0,0) 0%, rgba(0,0,0,0) 1%, rgba(0,0,0,0.1) 5%, rgba(0,0,0,0) 9%, rgba(0,0,0,0) 13%, rgba(0,0,0,0.1) 17%, rgba(0,0,0,0) 21%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.1) 29%, rgba(0,0,0,0) 33%, rgba(0,0,0,0) 37%, rgba(0,0,0,0.1) 41%, rgba(0,0,0,0) 45%, rgba(0,0,0,0) 49%, rgba(0,0,0,0.1) 53%, rgba(0,0,0,0) 57%, rgba(0,0,0,0) 61%, rgba(0,0,0,0.1) 65%, rgba(0,0,0,0) 69%, rgba(0,0,0,0) 73%, rgba(0,0,0,0.1) 77%, rgba(0,0,0,0.01) 81%, rgba(0,0,0,0) 85%, rgba(0,0,0,0.1) 89%, rgba(0,0,0,0) 93%, rgba(0,0,0,0) 97%, rgba(0,0,0,0) 100%); /* FF3.6+ */ 
    191191background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(1%,rgba(0,0,0,0)), color-stop(5%,rgba(0,0,0,0.1)), color-stop(9%,rgba(0,0,0,0)), color-stop(13%,rgba(0,0,0,0)), color-stop(17%,rgba(0,0,0,0.1)), color-stop(21%,rgba(0,0,0,0)), color-stop(25%,rgba(0,0,0,0)), color-stop(29%,rgba(0,0,0,0.1)), color-stop(33%,rgba(0,0,0,0)), color-stop(37%,rgba(0,0,0,0)), color-stop(41%,rgba(0,0,0,0.1)), color-stop(45%,rgba(0,0,0,0)), color-stop(49%,rgba(0,0,0,0)), color-stop(53%,rgba(0,0,0,0.1)), color-stop(57%,rgba(0,0,0,0)), color-stop(61%,rgba(0,0,0,0)), color-stop(65%,rgba(0,0,0,0.1)), color-stop(69%,rgba(0,0,0,0)), color-stop(73%,rgba(0,0,0,0)), color-stop(77%,rgba(0,0,0,0.1)), color-stop(81%,rgba(0,0,0,0.01)), color-stop(85%,rgba(0,0,0,0)), color-stop(89%,rgba(0,0,0,0.1)), color-stop(93%,rgba(0,0,0,0)), color-stop(97%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0))); /* Chrome,Safari4+ */ 
     
    196196filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#00000000',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ 
    197197} 
     198 
     199.blocked-event-permision {cursor: hand} 
    198200 
    199201.fc-state-default .fc-button-effect span { 
  • trunk/prototype/modules/calendar/js/calendar.codecs.js

    r5437 r5442  
    714714                         
    715715                var calendar = DataLayer.get('calendar', evt.calendar); 
     716                 
     717                var eventEditable = function(){ 
     718                        var attendee = {}; 
     719                        for(var i = 0; i < evt.participants.length; i++){ 
     720                                attendee = DataLayer.get('participant', evt.participants[i]); 
     721                                if(!!parseInt(attendee.isOrganizer)) 
     722                                        if(attendee.user == User.me.id) 
     723                                                return true; 
     724                                        else 
     725                                                return false; 
     726                        } 
     727                } 
    716728                   
    717                 grouped[ evt.calendar ].push( { id: evt.URI || evt.id, 
     729                grouped[ evt.calendar ].push( DataLayer.merge({ id: evt.URI || evt.id, 
    718730                                                title: Encoder.htmlDecode(evt.summary), 
    719731                                                start: Timezone.getDateTimezone(new Date(parseInt( evt.startTime )), calendar.timezone, false), 
    720732                                                end:   Timezone.getDateTimezone(new Date(parseInt( evt.endTime ) - (!!parseInt(evt.allDay) ? 86400000 : 0)), calendar.timezone, false ), 
    721                                                 allDay: parseInt( evt.allDay ) } ); 
     733                                                allDay: parseInt( evt.allDay ) }, eventEditable() ? {} : {editable: false, className: 'blocked-event-permision'}) ); 
    722734        }); 
    723735 
  • trunk/prototype/modules/calendar/js/helpers.js

    r5437 r5442  
    552552                        blkAddAtendee.find('.add-attendee-search input').keydown(function(event) { 
    553553 
    554                                 if(event.keyCode == '13') { 
    555                                         Encoder.EncodeType = "entity"; 
    556                                         $(this).val(Encoder.htmlEncode($(this).val())); 
    557                          
     554                                if(event.keyCode == '13') {                      
    558555                                        var result = DataLayer.get('user', ["*", "name", $(this).val()], true); 
    559556 
  • trunk/prototype/modules/calendar/js/init.js

    r5427 r5442  
    5656                        {        
    5757                                $tabs.tabs("select", "#calendar"); 
    58                                 $('#calendar').fullCalendar('gotoDate',$(this).siblings('span').html(), Date.getMonthNumberFromName($(this).html() == 'Março' ? 'Mar' : $(this).html()),'01'); 
     58                                var toDate = $('.block-vertical-toolbox .mini-calendar').datepicker("getDate").toString('yyyy-MM-dd').split('-'); 
     59                                $('#calendar').fullCalendar('gotoDate', toDate[0], parseInt(toDate[1]-1), toDate[2] ); 
    5960                                $('#calendar').fullCalendar( 'changeView', 'agendaDay' ); 
    6061                        }                        
     
    6667                $('.ui-datepicker-title .ui-datepicker-month').live('click',function(){ 
    6768                        $tabs.tabs("select", "#calendar"); 
    68                         $('#calendar').fullCalendar('gotoDate',$(this).html(), '0', '01'); 
     69                        $('#calendar').fullCalendar('gotoDate',$(this).siblings('span').html(), Date.getMonthNumberFromName($(this).html() == 'Março' ? 'Mar' : $(this).html()),'01'); 
    6970                        $('#calendar').fullCalendar( 'changeView', 'month'); 
    7071                }); 
     
    7273                $('.ui-datepicker-title .ui-datepicker-year').live('click',function(){ 
    7374                        $tabs.tabs("select", "#calendar"); 
    74                         var currentDate = $.fullCalendar.formatDate($('#calendar').fullCalendar('getDate'), "yyyy-MM-dd").split('-'); 
    75                         $('#calendar').fullCalendar('gotoDate',$('.ui-datepicker-title .ui-datepicker-year').html(), Date.getMonthNumberFromName($('.ui-datepicker-title .ui-datepicker-month').html()), currentDate[2]); 
     75                        $('#calendar').fullCalendar('gotoDate',$(this).html(), '0', '01'); 
    7676                        $('.fc-button-year').click(); 
    7777                }); 
Note: See TracChangeset for help on using the changeset viewer.