Ignore:
Timestamp:
07/17/12 16:07:52 (12 years ago)
Author:
acoutinho
Message:

Ticket #2966 - primeiras implementacoes de tarefas aninhamento de equipo

Location:
sandbox/2.4.2-expresso1/prototype/modules/calendar/js
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/calendar.codecs.js

    r6768 r6797  
    728728                id: form.idEvent, 
    729729                location: form.location, 
     730                type: 1, 
    730731                category: form.category, 
    731732                summary: form.summary, 
     
    953954                        attendee = DataLayer.get('participant', evt.participants[i]); 
    954955                        if(attendee.user == User.me.id) 
    955                             return (attendee.acl.indexOf('w') >= 0 || attendee.acl.indexOf('o') >= 0 ) ? { 
     956                                            return (attendee.acl.indexOf('w') >= 0 || attendee.acl.indexOf('o') >= 0 ) ?  
     957                                                { 
    956958                                selectable: true,  
    957959                                className: 'fullcalendar-context-menu  event-id-'+idEvent+' calendar-id-'+calendar.id+ (isRecurrence ? ' isRecurrence Recurrence-id-'+Recurrence : '') 
     
    979981                        return returns; 
    980982                    }                            
    981                     return DataLayer.merge({ 
     983                    return DataLayer.merge( 
     984                        { 
    982985                        editable: aclSignature.acl['write'] && !isRecurrence, 
    983986                        disableResizing : (((aclSignature.acl['busy'] && !aclSignature.acl['write']) || (!aclSignature.acl['write'] && aclSignature.acl['read'])) ? true : false), 
    984987                        disableDragging  : (((aclSignature.acl['busy'] && !aclSignature.acl['write']) || (!aclSignature.acl['write'] && aclSignature.acl['read'])) ? true: false), 
    985988                        className: mountClass(aclSignature.acl) 
    986                     }, aclSignature.acl['busy'] ? { 
    987                         title: 'Ocupado',  
    988                         selectable: false 
    989                     } : { 
    990                         selectable: true 
    991                     }); 
     989                        }, aclSignature.acl['busy'] ?  
     990                        { 
     991                            title: 'Ocupado',  
     992                            selectable: false 
     993                        } : { 
     994                            selectable: true 
     995                        });      
    992996                } 
    993                          
    994997            } 
    995998                 
     
    10081011                   
    10091012            for( var i = 0; i < occurrences.length; i++ ) 
    1010                 grouped[ evt.calendar ].push( DataLayer.merge({ 
     1013                grouped[ evt.calendar ].push( DataLayer.merge( 
     1014                { 
    10111015                    id: evt.URI || evt.id+ '-' + i, 
    10121016                    title: Encoder.htmlDecode(evt.summary), 
     
    10161020                    isRepeat: isRepeat, 
    10171021                    occurrence: i, 
     1022                    type: evt.type, 
    10181023                    calendar: evt.calendar 
    10191024                    }, eventEditable(evt.id, isRepeat, i ) ) ); 
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/helpers.js

    r6718 r6797  
    20912091                }); 
    20922092        } 
     2093         
    20932094        doMenu(); 
     2095         
    20942096        $('#divAppbox').on('scroll',function(){ 
    20952097                if ($('.cal-list-options-btn.fg-menu-open.ui-state-active')){                    
     
    20992101                } 
    21002102        }); 
     2103         
    21012104        $('ul.list-calendars .cal-list-options-btn').on('click',function(){doMenu();});          
    21022105         
     
    22042207                         
    22052208            $('.qtip-active').keydown(function(event) { 
    2206                 if (event.keyCode == '27') { 
     2209                                        if (event.keyCode == '27')  
    22072210                    meu_container.find(".button.new").qtip('destroy'); 
    2208                 } 
    22092211            }); 
    22102212                         
  • sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js

    r6768 r6797  
    11$(document).ready(function() { 
    2  
    32        //Remove o icone de configuraçõe padrão antigo do expresso 
    43        $('#sideboxdragarea').addClass('hidden'); 
     
    148147                        }, true ); 
    149148                }); 
     149                /* Quick add task 
     150        -----------------------------------------------------------------*/ 
     151                $(".button.add.add-task").click(function(event){ 
     152                        var componente = $(this); 
     153 
     154                        $(componente).qtip({ 
     155                            show: { 
     156                                ready: true,  
     157                                solo: true,  
     158                                when: { 
     159                                        event: 'click' 
     160                                } 
     161                                }, 
     162                                hide: false, 
     163                                content: { 
     164                                        text: $('<div></div>').html( DataLayer.render( 'templates/task_quick_add.ejs', {} ) ), 
     165                                        title: { 
     166                                                text:'Nova tarefa',  
     167                                                button: '<a class="button close" href="#">close</a>' 
     168                                        } 
     169                                }, 
     170                                style: { 
     171                                        name: 'blue',  
     172                                tip: { 
     173                                                corner: 'leftMiddle' 
     174                                        },  
     175                                border: { 
     176                                                width: 4,  
     177                                            radius: 8 
     178                                        },  
     179                                width: { 
     180                                                min: 225,  
     181                                            max:225 
     182                                        } 
     183                                }, 
     184                        position: { 
     185                                corner: { 
     186                                            target: 'rightMiddle', 
     187                                            tooltip: 'leftMiddle' 
     188                                }, 
     189                                adjust: { 
     190                                            x:0,  
     191                                            y:0 
     192                                } 
     193                        } 
     194                    }) 
     195                .qtip("api").onShow = function(arg0) { 
     196 
     197                        /*------------------------------------------------------------------------*/ 
     198                        /*               Seta os valores padrões nos inputs do qtip               */ 
     199                        $('div.qtip div.add-simple-task input.task').Watermark("Tarefa sem título"); 
     200                                $('div.qtip div.add-simple-task textarea').Watermark("Descrição"); 
     201                                /*------------------------------------------------------------------------*/ 
     202 
     203                            $('.qtip-active .button.close').button({ 
     204                                icons: { 
     205                                    primary: "ui-icon-close" 
     206                                }, 
     207                                text: false 
     208                            }) 
     209                            .click(function(){ 
     210                                        $(componente).qtip('destroy'); 
     211                            }); 
     212                                                         
     213                            $('.qtip-active .button.save').button().click(function(){ 
     214                                 
     215                                var title = $('div.qtip div.add-simple-task input.task').val(); 
     216                                        var description = $('div.qtip div.add-simple-task textarea').val(); 
     217 
     218                                        var calendar, timezone = ''; 
     219 
     220                                        for (var i = 0; i < Calendar.signatures.length; i++){ 
     221                                                if(Calendar.signatures[i].type == 1 && Calendar.signatures[i].calendar.type == 1){ 
     222                                                        calendar = Calendar.signatures[i].calendar.id; 
     223                                                        timezone = Calendar.signatures[i].calendar.timezone; 
     224                                                        break; 
     225                                                } 
     226                                        } 
     227 
     228 
     229                                DataLayer.put('schedulable',  
     230                                { 
     231                                        summary: title,  
     232                                        description: description,  
     233                                        type: '2',  
     234                                        calendar: calendar,  
     235                                        timezone: timezone, 
     236                                        startTime: new Date().toString('yyyy-MM-dd 00:00:00'), 
     237                                        endTime: new Date().toString('yyyy-MM-dd 00:00:00'), 
     238                                        allDay: '1' 
     239                                }); 
     240                                //DataLayer.commit(); 
     241 
     242                                $(componente).qtip('destroy'); 
     243                            }); 
     244 
     245                            $('.qtip-active .button.advanced').button().click(function(){ 
     246                                $(componente).qtip('destroy'); 
     247                                alert('Nova Tela de criação tarefas'); 
     248                            }); 
     249                                                                 
     250                                $('.qtip-active .button.cancel').button().click(function(){ 
     251                                        $(componente).qtip('destroy'); 
     252                            });                                  
     253                                                         
     254                            $('.button').button(); 
     255                                                         
     256                        }; 
     257                }); 
    150258 
    151259        var calendar = $('#calendar').fullCalendar(DataLayer.merge({  
     
    190298                        year: 'ano' 
    191299                }, 
     300                 
     301                eventRender: function( event, element, view ){ 
    192302                /* 
    193                 eventRender: function( event, element, view ){ 
    194                         $(element).attr( 'event-id', event.id ); 
    195                 }, 
    196                 */ 
     303                         * TODO - Encontrar icones mais filé 
     304                         */ 
     305            element.find(".fc-event-inner.fc-event-skin").prepend($('<img class="" src="../prototype/modules/calendar/img/' + ( (event.type == 1) ? "event" : "task" ) + '.png"></img>')); 
     306                }, 
     307                 
    197308                select: function( start, end, allDay, event, view ){ 
    198309                        if (view.name == "month") { 
     
    286397                eventClick: function( evt, event, view ){ 
    287398                        evt.id = evt.id.split('-')[0]; 
     399             
     400                        if(evt.type == 1){ 
     401 
    288402                        if(evt.selectable){ 
    289403                            if(evt.isRepeat){ 
     
    309423                                        } 
    310424                                }); 
    311                                  
    312425                            }else{ 
    313426                                var schedulable = DataLayer.get( "schedulable", evt.id); 
    314427                                schedulable.calendar = evt.calendar; 
    315428                                eventDetails( schedulable, true); 
    316                                  
    317429                            } 
    318                                  
    319430                        } 
     431            }else 
     432                                alert('Editar Tarefa'); 
    320433                }, 
    321434                 
Note: See TracChangeset for help on using the changeset viewer.