Index: /trunk/expressoMail1_2/js/search.js
===================================================================
--- /trunk/expressoMail1_2/js/search.js	(revision 8153)
+++ /trunk/expressoMail1_2/js/search.js	(revision 8242)
@@ -560,142 +560,147 @@
 			if (j == 4)
 			{
-				if(border_id.split("local").length == 1){
-					td.setAttribute("width", colSizes[1][4]);
-					td.id = "td_message_followup_search_"+uid_msg;
-					td.setAttribute("class","search-result-item");
-					td1 = '<div class="flag-edited" style="width:8px;height:6px;"><img src="../prototype/modules/mail/img/flagEditor.png"></div>';
+				if (preferences['use_followupflags_and_labels'] == '1'){
+					if(border_id.split("local").length == 1){
+						td.setAttribute("width", colSizes[1][4]);
+						td.id = "td_message_followup_search_"+uid_msg;
+						td.setAttribute("class","search-result-item");
+						td1 = '<div class="flag-edited" style="width:8px;height:6px;"><img src="../prototype/modules/mail/img/flagEditor.png"></div>';
+								
+						$(td).click(function(event, ui){	
+							var messageClickedId = $(this).attr('id').match(/td_message_followup_search_([\d]+)/)[1];
+
+							var loading = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+	                    		.find('img[alt=Carregando]');
+
+	                    	//Verificar se está carregando a bandeira.
+	                    	//Caso esteja ele sai da função até que seja carregado. 
+	            			if( loading.length ) {
+	                			return false;
+	            			}
+
+	 						var followupColor = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css('backgroundColor');
+
 							
-					$(td).click(function(event, ui){	
-						var messageClickedId = $(this).attr('id').match(/td_message_followup_search_([\d]+)/)[1];
-
-						var loading = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-                    		.find('img[alt=Carregando]');
-
-                    	//Verificar se está carregando a bandeira.
-                    	//Caso esteja ele sai da função até que seja carregado. 
-            			if( loading.length ) {
-                			return false;
-            			}
-
- 						var followupColor = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css('backgroundColor');
-
+							var followupColor = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css('backgroundColor');
+							
+							$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+							.html('<img alt="Carregando" title="Carregando" style="margin-left:-3px; margin-top:-4px; width:13px; height:13px;" src="../prototype/modules/mail/img/ajax-loader.gif" />');	
+								
+							$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "transparent");
+				
+							/**TODO Alterar após melhorias no filtro da camada javascript*/
+							DataLayer.remove('followupflagged', false);
+							var flagged = DataLayer.get('followupflagged', {filter: [
+								'AND', 
+								['=', 'messageNumber', messageClickedId], 
+								['=', 'folderName', mailbox]
+							]});
+							if(flagged == '' || flagged == [] || flagged == 'undefined'){
+								/**
+								* Aplica followupflag de Acompanhamento
+								*/
+								aux.followupflagged = {
+									uid : User.me.id,
+									folderName : mailbox, 
+									messageNumber : messageClickedId, 
+									alarmTime : false, 
+									backgroundColor : '#FF2016',
+									followupflagId: '1'
+								};
 						
-						var followupColor = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css('backgroundColor');
-						
-						$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-						.html('<img alt="Carregando" title="Carregando" style="margin-left:-3px; margin-top:-4px; width:13px; height:13px;" src="../prototype/modules/mail/img/ajax-loader.gif" />');	
-							
-						$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "transparent");
-			
-						/**TODO Alterar após melhorias no filtro da camada javascript*/
-						DataLayer.remove('followupflagged', false);
-						var flagged = DataLayer.get('followupflagged', {filter: [
-							'AND', 
-							['=', 'messageNumber', messageClickedId], 
-							['=', 'folderName', mailbox]
-						]});
-						if(flagged == '' || flagged == [] || flagged == 'undefined'){
-							/**
-							* Aplica followupflag de Acompanhamento
-							*/
-							aux.followupflagged = {
-								uid : User.me.id,
-								folderName : mailbox, 
-								messageNumber : messageClickedId, 
-								alarmTime : false, 
-								backgroundColor : '#FF2016',
-								followupflagId: '1'
-							};
-					
-							aux.followupflagged.id = DataLayer.put('followupflagged', aux.followupflagged);
-							DataLayer.commit(false, false, function(data){
-								var fail = false;
-								$.each(data, function(index, value) {
-									fail = false;
-									if(typeof value === 'string'){
-										fail = value;
+								aux.followupflagged.id = DataLayer.put('followupflagged', aux.followupflagged);
+								DataLayer.commit(false, false, function(data){
+									var fail = false;
+									$.each(data, function(index, value) {
+										fail = false;
+										if(typeof value === 'string'){
+											fail = value;
+										}
+									});
+									
+									$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+									.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"})
+									.find('img').remove();;
+									
+									if (fail) {
+									    
+									    var isCurrentFolder = current_folder == mailbox ? '#td_message_followup_' + messageClickedId + ', ' : ''; 	
+									    $(isCurrentFolder + 'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC");
+									    
+									    $('#td_message_followup_search_' + messageClickedId).find(".flag-edited")
+									    .append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");
+
+									    MsgsCallbackFollowupflag[fail]();
+									    return false;
+									}
+									
+									if(current_folder == mailbox){
+										$('#td_message_followup_' + messageClickedId + ', ' + 
+										'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", aux.followupflagged.backgroundColor);
+
+										$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", aux.followupflagged.backgroundColor)
+										.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");	
+									}else{								
+										$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", aux.followupflagged.backgroundColor)
+										.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");			
+									}								
+									updateCacheFollowupflag(messageClickedId, mailbox, true);
+								});
+
+								
+							}else if(onceOpenedHeadersMessages[mailbox][messageClickedId]['followupflagged'].followupflag.name == 'Follow up'){
+								/**
+								* Remover followupflag de Acompanhamento (DFD0078:RI25)
+								*/
+								$(this).find(".flag-edited").css("background", "#cccccc");
+								DataLayer.remove('followupflagged', flagged[0].id );
+								DataLayer.commit(false, false, function(){
+									$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").html('<img src="../prototype/modules/mail/img/flagEditor.png">')
+									.css({"width":"8px","height":"6px"/*,"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"*/});
+									if(current_folder == mailbox){
+										updateCacheFollowupflag(messageClickedId, mailbox, false);
+									
+										$('#td_message_followup_' + messageClickedId + ', ' + 
+										  'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', '').find(".flag-edited").css("background", '#CCC');
+										
+										$('#td_message_followup_' + messageClickedId + ', ' + 
+											'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+											.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"});
+									}else{
+										updateCacheFollowupflag(messageClickedId, mailbox, false);
+										
+										$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', '').find(".flag-edited").css("background", '#CCC');
+										
+										$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+											.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"})
+											.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");
 									}
 								});
+
+							} else {
+								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+								.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"}).find('img').remove();
 								
-								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-								.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"})
-								.find('img').remove();;
+								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", followupColor)
+								.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");
+
+								//Pega id do checkbox
+								var id = $(this).parents('[role="'+messageClickedId+'_'+mailbox+'"]').attr('class', 'selected_msg').find(':checkbox').attr('id');
 								
-								if (fail) {
-								    
-								    var isCurrentFolder = current_folder == mailbox ? '#td_message_followup_' + messageClickedId + ', ' : ''; 	
-								    $(isCurrentFolder + 'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "#CCCCCC");
-								    
-								    $('#td_message_followup_search_' + messageClickedId).find(".flag-edited")
-								    .append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");
-
-								    MsgsCallbackFollowupflag[fail]();
-								    return false;
-								}
+								//verifica se o checkbox já está selecionada
+								if($('#' + id).attr('checked') != 'checked')
+									$(this).parents('[role="'+messageClickedId+'_'+mailbox+'"]').attr('class', 'selected_msg').find(':checkbox').trigger('click');
 								
-								if(current_folder == mailbox){
-									$('#td_message_followup_' + messageClickedId + ', ' + 
-									'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", aux.followupflagged.backgroundColor);
-
-									$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", aux.followupflagged.backgroundColor)
-									.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");	
-								}else{								
-									$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', get_lang('Follow up')).find(".flag-edited").css("background", aux.followupflagged.backgroundColor)
-									.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");			
-								}								
-								updateCacheFollowupflag(messageClickedId, mailbox, true);
-							});
-
-							
-						}else if(onceOpenedHeadersMessages[mailbox][messageClickedId]['followupflagged'].followupflag.name == 'Follow up'){
-							/**
-							* Remover followupflag de Acompanhamento (DFD0078:RI25)
-							*/
-							$(this).find(".flag-edited").css("background", "#cccccc");
-							DataLayer.remove('followupflagged', flagged[0].id );
-							DataLayer.commit(false, false, function(){
-								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").html('<img src="../prototype/modules/mail/img/flagEditor.png">')
-								.css({"width":"8px","height":"6px"/*,"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"*/});
-								if(current_folder == mailbox){
-									updateCacheFollowupflag(messageClickedId, mailbox, false);
-								
-									$('#td_message_followup_' + messageClickedId + ', ' + 
-									  'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', '').find(".flag-edited").css("background", '#CCC');
-									
-									$('#td_message_followup_' + messageClickedId + ', ' + 
-										'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-										.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"});
-								}else{
-									updateCacheFollowupflag(messageClickedId, mailbox, false);
-									
-									$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).attr('title', '').find(".flag-edited").css("background", '#CCC');
-									
-									$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-										.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"})
-										.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");
-								}
-							});
-
-						} else {
-							$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-							.css({"background-image":"url(../prototype/modules/mail/img/flagEditor.png)"}).find('img').remove();
-							
-							$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", followupColor)
-							.append("<img src='../prototype/modules/mail/img/flagEditor.png'/>");
-
-							//Pega id do checkbox
-							var id = $(this).parents('[role="'+messageClickedId+'_'+mailbox+'"]').attr('class', 'selected_msg').find(':checkbox').attr('id');
-							
-							//verifica se o checkbox já está selecionada
-							if($('#' + id).attr('checked') != 'checked')
-								$(this).parents('[role="'+messageClickedId+'_'+mailbox+'"]').attr('class', 'selected_msg').find(':checkbox').trigger('click');
-							
-							updateSelectedMsgs(true,messageClickedId);
-							configureFollowupflag();
-						}
-						//if(!){}
-
-					});		
-				}		
+								updateSelectedMsgs(true,messageClickedId);
+								configureFollowupflag();
+							}
+							//if(!){}
+
+						});		
+					}
+				}else{
+					td.setAttribute("width", colSizes[1][4]);
+					td.innerHTML = '<div></div>';
+				}			
 			}
 			if (j == 5)
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 8241)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 8242)
@@ -2098,27 +2098,27 @@
 		  $(td_element26).addClass("td-followup-flag");
 
-        if(get_current_folder().split("_")[0] != "local"){
+        if((get_current_folder().split("_")[0] != "local") && (preferences['use_followupflags_and_labels'] == '1')){
 		  td_element26.innerHTML = '<div class="flag-edited" style="width:8px;height:6px;"><img src="../prototype/modules/mail/img/flagEditor.png"></div>';
 	    } else {
             td_element26.innerHTML = "";
         }
-        
-		if (headers_msgs.followupflagged) {
-			if(headers_msgs.followupflagged.followupflag.id < 7){
-				var nameFollowupflag = get_lang(headers_msgs.followupflagged.followupflag.name);
-			}else{
-				var nameFollowupflag = headers_msgs.followupflagged.followupflag.name;
-			}
-			$(td_element26).attr('title', nameFollowupflag)
-			.find(".flag-edited").css("background",headers_msgs.followupflagged.backgroundColor);
-			if(headers_msgs.followupflagged.isDone == "1"){
-				$(td_element26).find(".flag-edited").find("img")
-				.attr("src", "../prototype/modules/mail/img/flagChecked.png")
-				.css("margin-left","-3px");
-			}
-		} else {
-			$(td_element26).find(".flag-edited").css("background","#cccccc");
-		}
-		
+        if (preferences['use_followupflags_and_labels'] == '1'){
+    		if (headers_msgs.followupflagged) {
+    			if(headers_msgs.followupflagged.followupflag.id < 7){
+    				var nameFollowupflag = get_lang(headers_msgs.followupflagged.followupflag.name);
+    			}else{
+    				var nameFollowupflag = headers_msgs.followupflagged.followupflag.name;
+    			}
+    			$(td_element26).attr('title', nameFollowupflag)
+    			.find(".flag-edited").css("background",headers_msgs.followupflagged.backgroundColor);
+    			if(headers_msgs.followupflagged.isDone == "1"){
+    				$(td_element26).find(".flag-edited").find("img")
+    				.attr("src", "../prototype/modules/mail/img/flagChecked.png")
+    				.css("margin-left","-3px");
+    			}
+    		} else {
+    			$(td_element26).find(".flag-edited").css("background","#cccccc");
+    		}
+		}
 		/**
 		 * Clique para aplicar sinalizador
@@ -2252,6 +2252,4 @@
 				configureFollowupflag();
 			}
-			
-			
 		});	
 		
Index: /trunk/expressoMail1_2/js/doiMenuData.js
===================================================================
--- /trunk/expressoMail1_2/js/doiMenuData.js	(revision 8167)
+++ /trunk/expressoMail1_2/js/doiMenuData.js	(revision 8242)
@@ -249,9 +249,9 @@
     		"i02": {"name": get_lang("Search"), "icon": "search-mail", callback: function(key, opt){ search_emails(""); }},
     		"103": {"name": get_lang("Edit filters"), "icon": "filter", callback: filterbox2 },
-    		"i05": {"name": get_lang("Share mailbox"), "icon": "share-mailbox", callback: sharebox },
-    		"i06": {"name": get_lang("Labels"), "icon": "tag", callback: configureLabels }, 
-    		"i08": {"name": get_lang("Empty trash"), "icon": "empty-trash", callback: function(key, opt){ empty_trash_imap(); }}
+    		"i05": {"name": get_lang("Share mailbox"), "icon": "share-mailbox", callback: sharebox } 
     	};
-    		
+        if ( preferences['use_followupflags_and_labels'] == "1" )
+            menuToolsItems["i06"] = {"name": get_lang("Labels"), "icon": "tag", callback: configureLabels };
+        menuToolsItems["i08"] = {"name": get_lang("Empty trash"), "icon": "empty-trash", callback: function(key, opt){ empty_trash_imap(); }};
     	if(use_local_messages==1) {
     		//if(expresso_mail_archive.enabled == true) {
