Index: branches/2.5/expressoCalendar/setup/tables_current.inc.php
===================================================================
--- branches/2.5/expressoCalendar/setup/tables_current.inc.php	(revision 7922)
+++ branches/2.5/expressoCalendar/setup/tables_current.inc.php	(revision 7938)
@@ -313,5 +313,6 @@
                 'background_color' => array(  'type' => 'varchar','precision' => '6', 'nullable' => True),
                 'border_color' => array(  'type' => 'varchar','precision' => '6', 'nullable' => True),
-                'type' => array('type' => 'int', 'precision' => '2' ,'nullable' => false, 'default' => 0)
+                'type' => array('type' => 'int', 'precision' => '2' ,'nullable' => false, 'default' => 0), 
+                'hidden' => array('type' => 'int', 'precision' => '2' ,'nullable' => false, 'default' => 0) 
             ),
             'pk' => array('id'),
Index: branches/2.5/expressoCalendar/setup/tables_update.inc.php
===================================================================
--- branches/2.5/expressoCalendar/setup/tables_update.inc.php	(revision 7579)
+++ branches/2.5/expressoCalendar/setup/tables_update.inc.php	(revision 7938)
@@ -234,4 +234,14 @@
         return $GLOBALS['setup_info']['expressoCalendar']['currentver'];
     };
+ 
+    $test[] = '1.011'; 
+    function expressoCalendar_upgrade1_011() { 
+        $oProc = $GLOBALS['phpgw_setup']->oProc; 
+ 
+        $oProc->query("ALTER TABLE calendar_signature ADD COLUMN hidden integer"); 
+ 
+        $GLOBALS['setup_info']['expressoCalendar']['currentver'] = '1.012'; 
+        return $GLOBALS['setup_info']['expressoCalendar']['currentver']; 
+    }; 
         
 ?>
Index: branches/2.5/expressoCalendar/setup/setup.inc.php
===================================================================
--- branches/2.5/expressoCalendar/setup/setup.inc.php	(revision 7645)
+++ branches/2.5/expressoCalendar/setup/setup.inc.php	(revision 7938)
@@ -13,5 +13,5 @@
 	$setup_info['expressoCalendar']['title']     	= 'Expresso Calendar';
 	/* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/
-	$setup_info['expressoCalendar']['version']   	= '1.011';
+	$setup_info['expressoCalendar']['version']   	= '1.012';
 	$setup_info['expressoCalendar']['app_order']	= 10;
 
Index: branches/2.5/prototype/config/calendarSignature.ini
===================================================================
--- branches/2.5/prototype/config/calendarSignature.ini	(revision 6996)
+++ branches/2.5/prototype/config/calendarSignature.ini	(revision 7938)
@@ -33,2 +33,3 @@
 backgroundColor = background_color
 borderColor = border_color
+hidden = hidden
Index: branches/2.5/prototype/modules/calendar/js/calendar.codecs.js
===================================================================
--- branches/2.5/prototype/modules/calendar/js/calendar.codecs.js	(revision 7798)
+++ branches/2.5/prototype/modules/calendar/js/calendar.codecs.js	(revision 7938)
@@ -75,5 +75,15 @@
 			Calendar.currentView =  DataLayer.encode('schedulable:calendar', DataLayer.dispatch('modules/calendar/schedules', DataLayer.criteria('schedulable:calendar', {start: start,end: end}))  );   //DataLayer.get( 'schedulable:calendar', {start: start,end: end} );
 		    }
+             if( !!Calendar.currentView[ signature.calendar.id ]) 
+            { 
+                if(signature.hidden == true  ) 
+                    Calendar.currentView[ signature.calendar.id ].hidden = true; 
+                else 
+                    Calendar.currentView[ signature.calendar.id ].hidden = false; 
+            } 
+ 
 		    var view = Calendar.currentView[ signature.calendar.id ];
+ 
+ 
 		    callback( view && !view.hidden ? view : [] );
 		},
@@ -201,6 +211,10 @@
 
             Calendar.rerenderView(true);
-            if(updateActivity)
+            if(updateActivity){ 
+ 
+                DataLayer.remove('taskToActivity', false); 
                 refreshTaskActivity();
+            } 
+ 
         });
     }
Index: branches/2.5/prototype/modules/calendar/js/helpers.js
===================================================================
--- branches/2.5/prototype/modules/calendar/js/helpers.js	(revision 7864)
+++ branches/2.5/prototype/modules/calendar/js/helpers.js	(revision 7938)
@@ -2102,6 +2102,6 @@
 		
 	});
-	
-	$('ul.list-calendars .cal-list-options-btn').on('click',function(){doMenu();});         
+ 
+     $('ul.list-calendars .cal-list-options-btn').on('click',function(){doMenu();});         
 	
 
@@ -2275,7 +2275,6 @@
 	show_modal_search_shared();
     });
-		
-		
-    //TODO Implementar ocultar agendas.
+	
+ 	
     meu_container.find('.title-signed-calendars').click(function(evt){
 	var status = $(this).parent().find('.status-list-shared');
@@ -2295,4 +2294,17 @@
 	    var checkBox = $(this);
 	    if(!!Calendar.currentView[ checkBox.val() ]){
+ 
+        $.each(Calendar.signatures , function(index, value) { 
+ 
+            if(value.calendar.id == checkBox.val()) 
+            { 
+                value.hidden = checkBox.is(':checked') ? 0 : 1  ; 
+ 
+                DataLayer.put('calendarSignature', {id: ''+value.id , hidden: value.hidden }  ); 
+                DataLayer.commit(); 
+            } 
+ 
+        }); 
+ 
 		Calendar.currentView[ checkBox.val() ].hidden = !checkBox.is(':checked');
 		$('#calendar').fullCalendar( 'refetchEvents' );
Index: branches/2.5/prototype/modules/calendar/templates/calendar_list.ejs
===================================================================
--- branches/2.5/prototype/modules/calendar/templates/calendar_list.ejs	(revision 7097)
+++ branches/2.5/prototype/modules/calendar/templates/calendar_list.ejs	(revision 7938)
@@ -22,5 +22,5 @@
 
                 <div>
-                    <input class="calendar-view" type="checkbox" name="" value="<%= signatures['taskGroup'][i].calendar.id %>" checked="checked"/>
+                    <input class="calendar-view" type="checkbox" name="" value="<%= signatures['taskGroup'][i].calendar.id %>" <% if( signatures['taskGroup'][i].hidden != '1' ) { %> checked="checked" <% } %> />
                     <label><%= signatures['taskGroup'][i].calendar.name %></label>
 
@@ -57,5 +57,5 @@
 
                 <div>
-                    <input class="calendar-view" type="checkbox" name="" value="<%= signatures['calendar'][i].calendar.id %>" checked="checked"/>
+                    <input class="calendar-view" type="checkbox" name="" value="<%= signatures['calendar'][i].calendar.id %>" <% if( signatures['calendar'][i].hidden != '1') { %> checked="checked" <% } %> />
                     <label><%= signatures['calendar'][i].calendar.name %></label>
 
@@ -91,5 +91,5 @@
                 <li class="list-calendars-item list-calendars-item-<%= signatures['sharedCalendar'][i].calendar.id %>" title="<%= signatures['sharedCalendar'][i].calendar.name %>">
                  <div>
-        		    <input class="calendar-view" type="checkbox" name="" value="<%= signatures['sharedCalendar'][i].calendar.id %>" checked="checked"/>
+        		    <input class="calendar-view" type="checkbox" name="" value="<%= signatures['sharedCalendar'][i].calendar.id %>" <% if( signatures['sharedCalendar'][i].hidden  != '1') { %> checked="checked" <% } %> />
         		    <label><%= signatures['sharedCalendar'][i].calendar.name %></label>
         		 </div>
