Index: /trunk/prototype/plugins/widgets/combobox.js
===================================================================
--- /trunk/prototype/plugins/widgets/combobox.js	(revision 7720)
+++ /trunk/prototype/plugins/widgets/combobox.js	(revision 7720)
@@ -0,0 +1,118 @@
+	/**
+	 * Implementação do widget de input-combobox
+	 */
+ 
+	(function( $ ) {
+		$.widget( "ui.combobox", {
+			_create: function() {
+				var self = this,
+					select = this.element.hide(),
+					selected = select.children( ":selected" ),
+					value = selected.val() ? selected.text() : "";
+				var input = this.input = $( "<input>" )
+					.insertAfter( select )
+					.val( value )
+					.autocomplete({
+						delay: 0,
+						minLength: 0,
+						source: function( request, response ) {
+							var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
+							response( select.children( "option" ).map(function() {
+								var text = $( this ).text();
+								if ( this.value && ( !request.term || matcher.test(text) ) )
+									return {
+										label: text.replace(
+											new RegExp(
+												"(?![^&;]+;)(?!<[^<>]*)(" +
+												$.ui.autocomplete.escapeRegex(request.term) +
+												")(?![^<>]*>)(?![^&;]+;)", "gi"
+											), "<strong>$1</strong>" ),
+										value: text,
+										option: this
+									};
+							}) );
+						},
+						select: function( event, ui ) {
+							ui.item.option.selected = true;
+							self._trigger( "selected", event, {
+								item: ui.item.option
+							});
+						},
+						change: function( event, ui ) {
+							if ( !ui.item ) {
+								var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
+									valid = false;
+								select.children( "option" ).each(function() {
+									if ( $( this ).text().match( matcher ) ) {
+										this.selected = valid = true;
+										return false;
+									}
+								});
+								/*
+								if ( !valid ) {
+									// remove invalid value, as it didn't match anything
+									$( this ).val( "" );
+									select.val( "" );
+									input.data( "autocomplete" ).term = "";
+									return false;
+								}
+								*/
+								if ( !valid ) {
+									if(select.has('option[value="custom"]').length > 0) {
+										select.find('option:last').val('custom').html($(this).val()).attr('selected', 'selected');
+									} else {
+										select.append(select.find('option:last').clone().val('custom').html($(this).val()));
+										select.find('option[value="custom"]').attr('selected', 'selected');
+									}
+								}
+							}
+						}
+					})
+					.addClass( "ui-widget ui-widget-content ui-corner-left" );
+
+				input.data( "autocomplete" )._renderItem = function( ul, item ) {
+					return $( "<li></li>" )
+						.data( "item.autocomplete", item )
+						.append( "<a>" + item.label + "</a>" )
+						.appendTo( ul );
+				};
+
+				this.button = $( "<button type='button'>&nbsp;</button>" )
+					.attr( "tabIndex", -1 )
+					.attr( "title", "Show All Items" )
+					.insertAfter( input )
+					.button({
+						icons: {
+							primary: "ui-icon-triangle-1-s"
+						},
+						text: false
+					})
+					.removeClass( "ui-corner-all" )
+					.addClass( "ui-corner-right ui-button-icon" )
+					.click(function() {
+						// close if already visible
+						if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
+							input.autocomplete( "close" );
+							return;
+						}
+
+						// work around a bug (likely same cause as #5265)
+						$( this ).blur();
+
+						// pass empty string as value to search for, displaying all results
+						input.autocomplete( "search", "" );
+						input.focus();
+					});
+			},
+
+			destroy: function() {
+				this.input.remove();
+				this.button.remove();
+				this.element.show();
+				$.Widget.prototype.destroy.call( this );
+			}
+		});
+	})( jQuery );
+	/**
+	 * #END: Implementação do widget de input-combobox
+	 */
Index: /trunk/prototype/modules/mail/interceptors/Helpers.php
===================================================================
--- /trunk/prototype/modules/mail/interceptors/Helpers.php	(revision 7551)
+++ /trunk/prototype/modules/mail/interceptors/Helpers.php	(revision 7720)
@@ -146,4 +146,11 @@
 	//followupflag:before.find 
 	public function addDefaultElementsFilter (&$uri , &$params , &$criteria , $original ){ 
+		$log = fopen('/tmp/adriano.log', 'a') or die('Nao foi possivel abrir o arquivo /tmp/1.log\n');
+        fwrite($log, "uri = " . var_export($uri, true) . "\n");
+        fwrite($log, "params = " . var_export($params, true) . "\n");
+        fwrite($log, "criteria = " . var_export($criteria, true) . "\n");
+        fwrite($log, "original = " . var_export($original, true) . "\n");
+        fclose($log);	
+	
 		//if (!self::in_arrayr('id', $criteria['filter'])) { 
 			$defaultsFilter = array( 'IN' , 'id' , array('1','2','3','4','5','6') ); 
@@ -289,4 +296,9 @@
 		$imap_result = Controller::find($imap_uri, false, $imap_criteria);
 
+		$log = fopen('/tmp/adriano.log', 'a') or die('Nao foi possivel abrir o arquivo /tmp/1.log\n');
+        fwrite($log, "\n\n INTERCEPTORS ");
+		fwrite($log, "\n\n imap_result = " . var_export($imap_result, true) . "\n\n");
+        fclose($log);	
+		
 		/**
 		 * Mescla os dados vindos do PostgreSQL com os dados vindos do Imap
@@ -337,4 +349,12 @@
 		}
 
+		$log = fopen('/tmp/adriano.log', 'a') or die('Nao foi possivel abrir o arquivo /tmp/1.log\n');
+        fwrite($log, "uri = " . var_export($uri, true) . "\n\n");
+        fwrite($log, "result = " . var_export($result, true) . "\n\n");
+        //fwrite($log, "criteria = " . var_export($criteria, true) . "\n\n");
+        //fwrite($log, "original = " . var_export($original, true) . "\n\n");
+        fwrite($log, "merge_result = " . var_export($merge_result, true) . "\n\n");
+        fclose($log);	
+		
 		return $merge_result;
 	}
Index: /trunk/prototype/modules/mail/js/followupflag.js
===================================================================
--- /trunk/prototype/modules/mail/js/followupflag.js	(revision 7612)
+++ /trunk/prototype/modules/mail/js/followupflag.js	(revision 7720)
@@ -60,122 +60,4 @@
 	folder = current_folder;
 
-	/**
-	 * Implementação do widget de input-combobox
-	 */
- 
-	(function( $ ) {
-		$.widget( "ui.combobox", {
-			_create: function() {
-				var self = this,
-					select = this.element.hide(),
-					selected = select.children( ":selected" ),
-					value = selected.val() ? selected.text() : "";
-				var input = this.input = $( "<input>" )
-					.insertAfter( select )
-					.val( value )
-					.autocomplete({
-						delay: 0,
-						minLength: 0,
-						source: function( request, response ) {
-							var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
-							response( select.children( "option" ).map(function() {
-								var text = $( this ).text();
-								if ( this.value && ( !request.term || matcher.test(text) ) )
-									return {
-										label: text.replace(
-											new RegExp(
-												"(?![^&;]+;)(?!<[^<>]*)(" +
-												$.ui.autocomplete.escapeRegex(request.term) +
-												")(?![^<>]*>)(?![^&;]+;)", "gi"
-											), "<strong>$1</strong>" ),
-										value: text,
-										option: this
-									};
-							}) );
-						},
-						select: function( event, ui ) {
-							ui.item.option.selected = true;
-							self._trigger( "selected", event, {
-								item: ui.item.option
-							});
-						},
-						change: function( event, ui ) {
-							if ( !ui.item ) {
-								var matcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" ),
-									valid = false;
-								select.children( "option" ).each(function() {
-									if ( $( this ).text().match( matcher ) ) {
-										this.selected = valid = true;
-										return false;
-									}
-								});
-								/*
-								if ( !valid ) {
-									// remove invalid value, as it didn't match anything
-									$( this ).val( "" );
-									select.val( "" );
-									input.data( "autocomplete" ).term = "";
-									return false;
-								}
-								*/
-								if ( !valid ) {
-									if(select.has('option[value="custom"]').length > 0) {
-										select.find('option:last').val('custom').html($(this).val()).attr('selected', 'selected');
-									} else {
-										select.append(select.find('option:last').clone().val('custom').html($(this).val()));
-										select.find('option[value="custom"]').attr('selected', 'selected');
-									}
-								}
-							}
-						}
-					})
-					.addClass( "ui-widget ui-widget-content ui-corner-left" );
-
-				input.data( "autocomplete" )._renderItem = function( ul, item ) {
-					return $( "<li></li>" )
-						.data( "item.autocomplete", item )
-						.append( "<a>" + item.label + "</a>" )
-						.appendTo( ul );
-				};
-
-				this.button = $( "<button type='button'>&nbsp;</button>" )
-					.attr( "tabIndex", -1 )
-					.attr( "title", "Show All Items" )
-					.insertAfter( input )
-					.button({
-						icons: {
-							primary: "ui-icon-triangle-1-s"
-						},
-						text: false
-					})
-					.removeClass( "ui-corner-all" )
-					.addClass( "ui-corner-right ui-button-icon" )
-					.click(function() {
-						// close if already visible
-						if ( input.autocomplete( "widget" ).is( ":visible" ) ) {
-							input.autocomplete( "close" );
-							return;
-						}
-
-						// work around a bug (likely same cause as #5265)
-						$( this ).blur();
-
-						// pass empty string as value to search for, displaying all results
-						input.autocomplete( "search", "" );
-						input.focus();
-					});
-			},
-
-			destroy: function() {
-				this.input.remove();
-				this.button.remove();
-				this.element.show();
-				$.Widget.prototype.destroy.call( this );
-			}
-		});
-	})( jQuery );
-	/**
-	 * #END: Implementação do widget de input-combobox
-	 */
 	 winElement.find('input[name="alarmDate"]').change(function(event){
 	 	winElement.find('input[name="alarmTime"]').attr('disabled', ( $(this).val() == "" ? 'disabled' : false));
Index: /trunk/expressoMail1_2/assetic.php
===================================================================
--- /trunk/expressoMail1_2/assetic.php	(revision 7664)
+++ /trunk/expressoMail1_2/assetic.php	(revision 7720)
@@ -59,5 +59,6 @@
         new FileAsset('../prototype/plugins/zebradialog/javascript/zebra_dialog.js'),
         new FileAsset('../prototype/plugins/alphanumeric/jquery.alphanumeric.js'),
-        new FileAsset('../prototype/plugins/freeow/jquery.freeow.js')
+        new FileAsset('../prototype/plugins/freeow/jquery.freeow.js'),
+        new FileAsset('../prototype/plugins/widgets/combobox.js')
     )
 );
