Index: sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js
===================================================================
--- sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js	(revision 6768)
+++ sandbox/2.4.2-expresso1/prototype/modules/calendar/js/init.js	(revision 6797)
@@ -1,4 +1,3 @@
 $(document).ready(function() {
-
 	//Remove o icone de configuraçõe padrão antigo do expresso
 	$('#sideboxdragarea').addClass('hidden');
@@ -148,4 +147,113 @@
 			}, true );
 		});
+		/* Quick add task
+      	-----------------------------------------------------------------*/
+		$(".button.add.add-task").click(function(event){
+			var componente = $(this);
+
+			$(componente).qtip({
+			    show: {
+			    	ready: true, 
+		    		solo: true, 
+		    		when: {
+			    		event: 'click'
+			    	}
+				},
+				hide: false,
+				content: {
+					text: $('<div></div>').html( DataLayer.render( 'templates/task_quick_add.ejs', {} ) ),
+					title: {
+						text:'Nova tarefa', 
+						button: '<a class="button close" href="#">close</a>'
+					}
+				},
+				style: {
+					name: 'blue', 
+			    	tip: {
+						corner: 'leftMiddle'
+					}, 
+		    		border: {
+						width: 4, 
+					    radius: 8
+					}, 
+			    	width: {
+						min: 225, 
+					    max:225
+					}
+		   		},
+		    	position: {
+		    		corner: {
+					    target: 'rightMiddle',
+					    tooltip: 'leftMiddle'
+		    		},
+		    		adjust: {
+					    x:0, 
+					    y:0
+		    		}
+		    	}
+		    })
+	    	.qtip("api").onShow = function(arg0) {
+
+	    		/*------------------------------------------------------------------------*/
+	    		/*               Seta os valores padrões nos inputs do qtip               */
+	    		$('div.qtip div.add-simple-task input.task').Watermark("Tarefa sem título");
+				$('div.qtip div.add-simple-task textarea').Watermark("Descrição");
+				/*------------------------------------------------------------------------*/
+
+			    $('.qtip-active .button.close').button({
+				icons: {
+				    primary: "ui-icon-close"
+				},
+				text: false
+			    })
+			    .click(function(){
+					$(componente).qtip('destroy');
+			    });
+							
+			    $('.qtip-active .button.save').button().click(function(){
+			    	
+			    	var title = $('div.qtip div.add-simple-task input.task').val();
+					var description = $('div.qtip div.add-simple-task textarea').val();
+
+					var calendar, timezone = '';
+
+					for (var i = 0; i < Calendar.signatures.length; i++){
+						if(Calendar.signatures[i].type == 1 && Calendar.signatures[i].calendar.type == 1){
+							calendar = Calendar.signatures[i].calendar.id;
+							timezone = Calendar.signatures[i].calendar.timezone;
+							break;
+						}
+					}
+
+
+			    	DataLayer.put('schedulable', 
+		    		{
+		    			summary: title, 
+		    			description: description, 
+		    			type: '2', 
+		    			calendar: calendar, 
+		    			timezone: timezone,
+		    			startTime: new Date().toString('yyyy-MM-dd 00:00:00'),
+		    			endTime: new Date().toString('yyyy-MM-dd 00:00:00'),
+		    			allDay: '1'
+		    		});
+			    	//DataLayer.commit();
+
+			    	$(componente).qtip('destroy');
+			    });
+
+			    $('.qtip-active .button.advanced').button().click(function(){
+			    	$(componente).qtip('destroy');
+			    	alert('Nova Tela de criação tarefas');
+			    });
+								
+				$('.qtip-active .button.cancel').button().click(function(){
+					$(componente).qtip('destroy');
+			    });					
+							
+			    $('.button').button();
+							
+			};
+		});
 
 	var calendar = $('#calendar').fullCalendar(DataLayer.merge({ 
@@ -190,9 +298,12 @@
 			year: 'ano'
 		},
+		
+		eventRender: function( event, element, view ){
 		/*
-		eventRender: function( event, element, view ){
-			$(element).attr( 'event-id', event.id );
-		},
-		*/
+			 * TODO - Encontrar icones mais filé
+			 */
+    	    element.find(".fc-event-inner.fc-event-skin").prepend($('<img class="" src="../prototype/modules/calendar/img/' + ( (event.type == 1) ? "event" : "task" ) + '.png"></img>'));
+		},
+		
 		select: function( start, end, allDay, event, view ){
 			if (view.name == "month") {
@@ -286,4 +397,7 @@
 		eventClick: function( evt, event, view ){
 			evt.id = evt.id.split('-')[0];
+            
+			if(evt.type == 1){
+
                         if(evt.selectable){
                             if(evt.isRepeat){
@@ -309,13 +423,12 @@
                                         }
                                 });
-                                
                             }else{
 				var schedulable = DataLayer.get( "schedulable", evt.id);
 				schedulable.calendar = evt.calendar;
 				eventDetails( schedulable, true);
-				
 			    }
-                                
                         }
+            }else
+				alert('Editar Tarefa');
 		},
 		
