Index: /trunk/prototype/modules/mail/templates/listContacts.ejs
===================================================================
--- /trunk/prototype/modules/mail/templates/listContacts.ejs	(revision 7007)
+++ /trunk/prototype/modules/mail/templates/listContacts.ejs	(revision 7221)
@@ -6,23 +6,23 @@
 			text: 'Contato Recente'
 		},
-		'/contacts':{
+		'/personalContact':{
 			css: 'personal',
 			img: 'personal',
-			text: 'Contato pessoal',
+			text: 'Contato pessoal'
 		},
 		'/sharedcontact':{
 			css: 'personal',
 			img: 'sharedcontact',
-			text: 'Contato compartilhado',
+			text: 'Contato compartilhado'
 		},
 		'/groups':{
 			css: 'group',
 			img: 'group',
-			text: 'Grupo pessoal',
+			text: 'Grupo pessoal'
 		},
 		'/sharedgroup':{
 			css: 'group',
 			img: 'sharedgroup',
-			text: 'Grupo compartilhado',
+			text: 'Grupo compartilhado'
 		}
 	} 
Index: /trunk/prototype/rest/catalog/UserContactsResource.php
===================================================================
--- /trunk/prototype/rest/catalog/UserContactsResource.php	(revision 6783)
+++ /trunk/prototype/rest/catalog/UserContactsResource.php	(revision 7221)
@@ -282,5 +282,5 @@
 
 			$d = new Data();
-			$i = new Item($request->resources, (($value['user'] == Config::me("uidNumber")) ? 'ContactsResource' : 'SharedContactResource'), $value['id']);
+			$i = new Item($request->resources, (($value['user'] == Config::me("uidNumber")) ? 'PersonalContactResource' : 'SharedContactResource'), $value['id']);
 			$d->setName('id');
 			$d->setValue($value['id']);
Index: /trunk/prototype/rest/catalog/PersonalContactResource.php
===================================================================
--- /trunk/prototype/rest/catalog/PersonalContactResource.php	(revision 7221)
+++ /trunk/prototype/rest/catalog/PersonalContactResource.php	(revision 7221)
@@ -0,0 +1,176 @@
+<?php
+
+if( !defined( 'ROOTPATH' ) )
+    define( 'ROOTPATH', dirname(__FILE__).'/..' );
+
+require_once(ROOTPATH.'/rest/hypermedia/hypermedia.php');
+
+use prototype\api\Config as Config;
+
+class PersonalContactResource extends Resource {
+
+    /**
+     * Retorna uma lista de usuários
+     *
+     * @license    http://www.gnu.org/copyleft/gpl.html GPL
+     * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
+     * @sponsor    Caixa Econômica Federal
+     * @author     José Vicente Tezza Jr.
+     * @return     Retorna uma lista de usuários do LDAP
+     * @access     public
+     * */
+    function get($request, $id) {
+
+        $response = new Response($request);
+        $response->addHeader('Content-type', 'aplication/json');
+        $response->code = Response::OK;
+
+        $h = new Hypermedia();
+        $c = new Collection($request->resources, 'PersonalContactResource');
+
+        try {
+            $this->secured();
+
+            $contacts = !!$id ? Controller::find( array( 'concept' => 'contact' ), false, array( 'filter' => array( 'AND', array('=', 'user',  Config::me("uidNumber") ), array('=', 'id', $id) )  ) ) :
+                Controller::find( array( 'concept' => 'contact' ), false, array( 'filter' => array('=', 'user',  Config::me("uidNumber"))));
+
+            //Se nao foi encontrado contatos na consulta
+            if($contacts===false){
+                $error = new Error();
+                $error->setCode(Response::NOTFOUND);
+                $error->setTitle('Contacts not found');
+                $error->setDescription('Contacts not found.');
+
+                $c->setError($error);
+                $h->setCollection($c);
+
+                $response->code = Response::NOTFOUND;
+                $response->body = $h->getHypermedia($request->accept[10][0]);
+                return $response;
+            }
+
+            foreach($contacts as $value){
+
+                $i = new Item($request->resources, 'PersonalContactResource', $value['id']);
+
+                $d = new Data();
+                $d->setName('name');
+                $d->setValue($value['name']);
+                $d->setPrompt('Nome do Contato');
+                $d->setDataType('string');
+                $d->setMaxLength('100');
+                $d->setMinLength(null);
+                $d->setRequired(true);
+
+                $i->addData($d);
+
+                $d = new Data();
+                $d->setName('id');
+                $d->setValue($value['id']);
+                $d->setPrompt('Id do Contato');
+                $d->setDataType('string');
+                $d->setMaxLength('100');
+                $d->setMinLength(null);
+                $d->setRequired(true);
+
+                $i->addData($d);
+
+                $d = new Data();
+                $d->setName('email');
+                $d->setValue($value['email']);
+                $d->setPrompt('Email do Contato');
+                $d->setDataType('string');
+                $d->setMaxLength('100');
+                $d->setMinLength(null);
+                $d->setRequired(true);
+
+                $i->addData($d);
+
+                $l = new Link();
+
+                $l->setHref('');
+                $l->setRel('delete');
+                $l->setAlt('Remover');
+                $l->setPrompt('Remover');
+                $l->setRender('link');
+
+                $i->addLink($l);
+
+                $l = new Link();
+                $l->setHref('');
+                $l->setRel('put');
+                $l->setAlt('Atualizar');
+                $l->setPrompt('Atualizar');
+                $l->setRender('link');
+
+                $i->addLink($l);
+
+                $l = new Link();
+                $l->setHref('/contact/'.$value['id']);
+                $l->setRel('get');
+                $l->setAlt('Buscar');
+                $l->setPrompt('Buscar');
+                $l->setRender('link');
+
+                $i->addLink($l);
+                $c->addItem($i);
+            }
+
+            $t = new Template();
+            $d = new Data();
+
+            $d->setName('name');
+            $d->setValue(null);
+            $d->setPrompt('Nome do Contato');
+            $d->setDataType('string');
+            $d->setMaxLength(100);
+            $d->setMinLength(null);
+            $d->setRequired(true);
+
+            $t->addData($d);
+
+            $d = new Data();
+            $d->setName('email');
+            $d->setValue(null);
+            $d->setPrompt('Email do Contato');
+            $d->setDataType('string');
+            $d->setMaxLength(100);
+            $d->setMinLength(null);
+            $d->setRequired(true);
+
+            $t->addData($d);
+
+            $d = new Data();
+            $d->setName('telefone');
+            $d->setValue(null);
+            $d->setPrompt('Telefone do Contato');
+            $d->setDataType('string');
+            $d->setMaxLength(100);
+            $d->setMinLength(null);
+            $d->setRequired(true);
+
+            $t->addData($d);
+
+            $c->setTemplate($t);
+
+            $h->setCollection($c);
+
+        }catch (Exception $ex){
+            $error = new Error();
+            $error->setCode(Response::INTERNALSERVERERROR);
+            $error->setTitle('Internal Server Error');
+            $error->setDescription($ex);
+
+            $c->setError($error);
+            $h->setCollection($c);
+
+            $response->code = Response::INTERNALSERVERERROR;
+            $response->body = $h->getHypermedia($request->accept[10][0]);
+            return $response;
+        }
+
+        $response->body = $h->getHypermedia($request->accept[10][0]);
+        return $response;
+    }
+}
+?>
Index: unk/prototype/rest/catalog/ContactResource.php
===================================================================
--- /trunk/prototype/rest/catalog/ContactResource.php	(revision 6528)
+++ 	(revision )
@@ -1,168 +1,0 @@
-<?php
-
-if( !defined( 'ROOTPATH' ) )
-    define( 'ROOTPATH', dirname(__FILE__).'/..' );
-
-require_once(ROOTPATH.'/rest/hypermedia/hypermedia.php');
-
-use prototype\api\Config as Config;
-
-class ContactResource extends Resource {
-
-    /**
-     * Retorna uma lista de usuários
-     *
-     * @license    http://www.gnu.org/copyleft/gpl.html GPL
-     * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-     * @sponsor    Caixa Econômica Federal
-     * @author     José Vicente Tezza Jr. 
-     * @return     Retorna uma lista de usuários do LDAP
-     * @access     public
-     * */
-    function get($request, $id) {
-
-	$response = new Response($request);
-	$response->addHeader('Content-type', 'aplication/json');
-	$response->code = Response::OK;
-
-	$h = new Hypermedia();
-	$c = new Collection($request->resources, 'ContactResource');
-
-	try {
-	    $this->secured();
-
-            $contact = Controller::find( array( 'concept' => 'contact' ), false, array( 'filter' => array( 'AND', array('=', 'user',  Config::me("uidNumber") ), array('=', 'id', $id) )  ) );
-
-	    //Se nao foi encontrado contatos na consulta
-	    if($contact===false){
-		$error = new Error();
-		$error->setCode(Response::NOTFOUND);
-		$error->setTitle('Contact not found');
-		$error->setDescription('Contact not found.');
-
-		$c->setError($error);
-		$h->setCollection($c);
-
-		$response->code = Response::NOTFOUND;
-		$response->body = $h->getHypermedia($request->accept[10][0]);
-		return $response;
-	    }
-			
-		$t = new Template();
-		$d = new Data();
-
-		$d->setName('name');
-		$d->setValue(null);
-		$d->setPrompt('Nome do Contato');
-		$d->setDataType('string');
-		$d->setMaxLength(100);
-		$d->setMinLength(null);
-		$d->setRequired(true);
-
-		$t->addData($d);
-
-		$d = new Data();
-		$d->setName('email');
-		$d->setValue(null);
-		$d->setPrompt('Email do Contato');
-		$d->setDataType('string');
-		$d->setMaxLength(100);
-		$d->setMinLength(null);
-		$d->setRequired(true);
-
-		$t->addData($d);
-
-		$d = new Data();
-		$d->setName('telefone');
-		$d->setValue(null);
-		$d->setPrompt('Telefone do Contato');
-		$d->setDataType('string');
-		$d->setMaxLength(100);
-		$d->setMinLength(null);
-		$d->setRequired(true);
-
-		$t->addData($d);
-
-		$c->setTemplate($t);
-		
-		$d = new Data();
-		$d->setName('name');
-		$d->setValue($contact[0]['name']);
-		$d->setPrompt('Nome do Contato');
-		$d->setDataType('string');
-		$d->setMaxLength('100');
-		$d->setMinLength(null);
-		$d->setRequired(true);
-
-		$c->addData($d);
-		
-		$d = new Data();
-		$d->setName('email');
-		$d->setValue($contact[0]['email']);
-		$d->setPrompt('Email do Contato');
-		$d->setDataType('string');
-		$d->setMaxLength('100');
-		$d->setMinLength(null);
-		$d->setRequired(true);
-
-		$c->addData($d);
-		
-		$d = new Data();
-		$d->setName('telephone');
-		$d->setValue($contact[0]['telephone']);
-		$d->setPrompt('Telefone do Contato');
-		$d->setDataType('string');
-		$d->setMaxLength('100');
-		$d->setMinLength(null);
-		$d->setRequired(true);
-
-		$c->addData($d);
-		
-		$l = new Link();
-		$l->setHref('');
-		$l->setRel('delete');
-		$l->setAlt('Remover');
-		$l->setPrompt('Remover');
-		$l->setRender('link');
-		
-		$c->addLink($l);
-		
-		$l = new Link();
-		$l->setHref('');
-		$l->setRel('put');
-		$l->setAlt('Atualizar');
-		$l->setPrompt('Atualizar');
-		$l->setRender('link');
-		
-		$c->addLink($l);
-		
-		$l = new Link();
-		$l->setHref('/contact/'.$value['id']);
-		$l->setRel('get');
-		$l->setAlt('Buscar');
-		$l->setPrompt('Buscar');
-		$l->setRender('link');
-
-		$c->addLink($l);
-			
-		$h->setCollection($c);
-
-	}catch (Exception $ex){
-		$error = new Error();
-		$error->setCode(Response::INTERNALSERVERERROR);
-		$error->setTitle('Internal Server Error');
-		$error->setDescription($ex);
-
-		$c->setError($error);
-		$h->setCollection($c);
-
-		$response->code = Response::INTERNALSERVERERROR;
-		$response->body = $h->getHypermedia($request->accept[10][0]);
-		return $response;
-	}
-
-	$response->body = $h->getHypermedia($request->accept[10][0]);
-	return $response;
-  }
-}
-?>
Index: unk/prototype/rest/catalog/ContactsResource.php
===================================================================
--- /trunk/prototype/rest/catalog/ContactsResource.php	(revision 6528)
+++ 	(revision )
@@ -1,184 +1,0 @@
-<?php
-
-if( !defined( 'ROOTPATH' ) )
-    define( 'ROOTPATH', dirname(__FILE__).'/..' );
-
-require_once(ROOTPATH.'/rest/hypermedia/hypermedia.php');
-
-use prototype\api\Config as Config;
-
-class ContactsResource extends Resource {
-
-    /**
-     * Retorna uma lista de usuários
-     *
-     * @license    http://www.gnu.org/copyleft/gpl.html GPL
-     * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br)
-     * @sponsor    Caixa Econômica Federal
-     * @author     José Vicente Tezza Jr. 
-     * @return     Retorna uma lista de usuários do LDAP
-     * @access     public
-     * */
-    function get($request) {
-
-	$response = new Response($request);
-	$response->addHeader('Content-type', 'aplication/json');
-	$response->code = Response::OK;
-
-	$h = new Hypermedia();
-	$c = new Collection($request->resources, 'ContactsResource');
-
-	try {
-	    $this->secured();
-
-            $contacts = Controller::find( array( 'concept' => 'contact' ), false, array( 'filter' => array( '=', 'user',  Config::me("uidNumber") ) ) );
-
-	    //Se nao foi encontrado contatos na consulta
-	    if($contacts===false){
-		$error = new Error();
-		$error->setCode(Response::NOTFOUND);
-		$error->setTitle('Contacts not found');
-		$error->setDescription('Contacts not found.');
-
-		$c->setError($error);
-		$h->setCollection($c);
-
-		$response->code = Response::NOTFOUND;
-		$response->body = $h->getHypermedia($request->accept[10][0]);
-		return $response;
-	    }
-
-            foreach($contacts as $value){
-		$d = new Data();
-                $i = new Item($request->resources, 'ContactsResource', $value['id']);
-		$d->setName('id');
-                $d->setValue($value['id']);
-                $d->setPrompt('Id do Contato');
-                $d->setDataType('string');
-                $d->setMaxLength('100');
-                $d->setMinLength(null);
-                $d->setRequired(true);
-
-                $i->addData($d);
-		
-		$d = new Data();		
-		$d->setName('name');
-                $d->setValue($value['name']);
-                $d->setPrompt('Nome do Contato');
-                $d->setDataType('string');
-                $d->setMaxLength('100');
-                $d->setMinLength(null);
-                $d->setRequired(true);
-
-                $i->addData($d);
-
-		$d = new Data();
-                $d->setName('email');
-                $d->setValue($value['email']);
-                $d->setPrompt('Email do Contato');
-                $d->setDataType('string');
-                $d->setMaxLength('100');
-                $d->setMinLength(null);
-                $d->setRequired(true);
-
-                $i->addData($d);
-
-		$d = new Data();
-                $d->setName('telephone');
-                $d->setValue($value['telephone']);
-                $d->setPrompt('Telefone do Contato');
-                $d->setDataType('string');
-                $d->setMaxLength('100');
-                $d->setMinLength(null);
-                $d->setRequired(true);
-
-                $i->addData($d);
-
-                $l = new Link();
-
-                $l->setHref('');
-                $l->setRel('delete');
-                $l->setAlt('Remover');
-                $l->setPrompt('Remover');
-                $l->setRender('link');
-
-                $i->addLink($l);
-
-                $l = new Link();
-                $l->setHref('');
-                $l->setRel('put');
-                $l->setAlt('Atualizar');
-                $l->setPrompt('Atualizar');
-                $l->setRender('link');
-
-                $i->addLink($l);
-
-                $l = new Link();
-                $l->setHref('/contact/'.$value['id']);
-                $l->setRel('get');
-                $l->setAlt('Buscar');
-                $l->setPrompt('Buscar');
-                $l->setRender('link');
-
-                $i->addLink($l);
-                $c->addItem($i);
-	    }
-
-            $t = new Template();
-            $d = new Data();
-
-            $d->setName('name');
-            $d->setValue(null);
-            $d->setPrompt('Nome do Contato');
-            $d->setDataType('string');
-            $d->setMaxLength(100);
-            $d->setMinLength(null);
-            $d->setRequired(true);
-
-            $t->addData($d);
-
-            $d = new Data();
-            $d->setName('email');
-            $d->setValue(null);
-            $d->setPrompt('Email do Contato');
-            $d->setDataType('string');
-            $d->setMaxLength(100);
-            $d->setMinLength(null);
-            $d->setRequired(true);
-
-            $t->addData($d);
-
-            $d = new Data();
-            $d->setName('telefone');
-            $d->setValue(null);
-            $d->setPrompt('Telefone do Contato');
-            $d->setDataType('string');
-            $d->setMaxLength(100);
-            $d->setMinLength(null);
-            $d->setRequired(true);
-
-            $t->addData($d);
-
-            $c->setTemplate($t);
-
-            $h->setCollection($c);
-
-	}catch (Exception $ex){
-		$error = new Error();
-		$error->setCode(Response::INTERNALSERVERERROR);
-		$error->setTitle('Internal Server Error');
-		$error->setDescription($ex);
-
-		$c->setError($error);
-		$h->setCollection($c);
-
-		$response->code = Response::INTERNALSERVERERROR;
-		$response->body = $h->getHypermedia($request->accept[10][0]);
-		return $response;
-	}
-
-	$response->body = $h->getHypermedia($request->accept[10][0]);
-	return $response;
-  }
-}
-?>
Index: /trunk/calendar/templates/default/listContacts.ejs
===================================================================
--- /trunk/calendar/templates/default/listContacts.ejs	(revision 7147)
+++ /trunk/calendar/templates/default/listContacts.ejs	(revision 7221)
@@ -6,23 +6,23 @@
 			text: 'Contato dinÃ¢mico'
 		},
-		'/contacts':{
+		'/personalContact':{
 			css: 'personal',
 			img: 'personal',
-			text: 'Contato pessoal',
+			text: 'Contato pessoal'
 		},
 		'/sharedcontact':{
 			css: 'personal',
 			img: 'sharedcontact',
-			text: 'Contato compartilhado',
+			text: 'Contato compartilhado'
 		},
 		'/groups':{
 			css: 'group',
 			img: 'group',
-			text: 'Grupo pessoal',
+			text: 'Grupo pessoal'
 		},
 		'/sharedgroup':{
 			css: 'group',
 			img: 'sharedgroup',
-			text: 'Grupo compartilhado',
+			text: 'Grupo compartilhado'
 		}
 	} 
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 7200)
+++ /trunk/expressoMail1_2/js/main.js	(revision 7221)
@@ -55,12 +55,12 @@
 function updateDynamicPersonalContacts(){
 	dynamicPersonalContacts = new Array();
-	var contactsData = REST.get("/contacts").collection.itens;
+	var contactsData = normalizeContacts(REST.get("/personalContact").collection.itens);
 	if(contactsData){
 		$.each(contactsData, function(index, value){
 			var contact = {
-				id : parseInt(value.data[0].value),
-				name : value.data[1].value,
-				email : value.data[2].value,
-				value: value.data[1].value + " - " + value.data[2].value,
+                id : parseInt(value.id),
+                name : value.name,
+                email: value.email,
+				value: value.name+ " - " + value.email,
 				type: "P"
 			};
@@ -73,12 +73,12 @@
 function updateDynamicPersonalGroups(){
 	dynamicPersonalGroups = new Array();
-	var contactsData = REST.get("/groups").collection.itens;
+	var contactsData = normalizeContacts(REST.get("/groups").collection.itens);
 	if(contactsData){
 		$.each(contactsData, function(index, value){
 			var contact = {
-				id : parseInt(value.data[0].value),
-				owner : value.data[1].value,
-				name : value.data[2].value,
-				email: value.data[3].value,
+				id : parseInt(value.id),
+				owner : value.owner,
+				name : value.name,
+				email: value.email,
 				type: "G"
 			};
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 7198)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 7221)
@@ -4132,5 +4132,5 @@
 					box.find(".box-loading").remove();
 				else{
-					box.find(".box-loading").removeClass("box-loading").addClass("box-info");
+                    box.find(".box-loading").removeClass("box-loading").addClass("box-info");
 					box.addClass("box-"+value).removeClass("invalid-email-box");
 					loadGroupBox(data.collection, ".box-"+value);
@@ -4153,12 +4153,13 @@
 	
 	if(personal){
-		REST.get("/"+ (shared ? "shared" : "") +"contact/"+value, {}, function(data){
+		REST.get("/"+ (shared ? "shared" : "") +"personalContact/"+value, {}, function(data){
 			if(!data.error){
 				if(data.collection.error)
 					box.find(".box-loading").remove();
 				else{
+                    var item = normalizeContact(data.collection.itens[0].data);
 					box.find(".box-loading").removeClass("box-loading").addClass("box-info");
 					box.addClass("box-"+value).removeClass("invalid-email-box");
-					loadExtraLDAPBox(data.collection.data, ".box-"+value);
+					loadExtraLDAPBox(item, ".box-"+value);
 					box.unbind("dblclick").bind("dblclick", function(e){
 						new $.Zebra_Dialog(get_lang("Impossible editing this contact, but it's possible to remove it"), {
@@ -4168,9 +4169,7 @@
 							'auto_close': 3000
 						});
-					}).find(".box-input").val("\""+data.collection.data[0].value+"\" <"+data.collection.data[1].value+">");
-					var emailBoxValue = data.collection.data[0].value.length > 18 ? data.collection.data[0].value.substring(0, 15)+"...": data.collection.data[0].value;
-					emailBoxValue = emailBoxValue.length > 2 ? emailBoxValue : data.collection.data[1].value.substr(0,data.collection.data[1].value.indexOf('@'));
-					emailBoxValue = emailBoxValue > 18 ? emailBoxValue.substr(0,15) + "..." : emailBoxValue;
-					box.find(".email-box-value").html(emailBoxValue);
+					}).find(".box-input").val("\""+item.name+"\" <"+item.email+">");
+
+					box.find(".email-box-value").html(normalizeBoxName(item.name, item.value));
 				}
 			}else{
@@ -4186,7 +4185,8 @@
 				box.find(".box-loading").remove();
 			else{
+                var item = normalizeContact(data.collection.itens[0].data);
 				box.find(".box-loading").removeClass("box-loading").addClass("box-info");
 				box.addClass("box-"+value).removeClass("invalid-email-box");
-				loadExtraLDAPBox(data.collection.itens[0].data, ".box-"+value);
+				loadExtraLDAPBox(item, ".box-"+value);
 				box.unbind("dblclick").bind("dblclick", function(e){
 					new $.Zebra_Dialog(get_lang("Impossible editing this contact, but it's possible to remove it"), {
@@ -4196,11 +4196,9 @@
 						'auto_close': 3000
 					});
-				}).find(".box-input").val("\""+data.collection.itens[0].data[0].value+"\" <"+data.collection.itens[0].data[1].value+">");
-				var emailBoxValue = data.collection.itens[0].data[0].value.length > 18 ? data.collection.itens[0].data[0].value.substring(0, 15)+"...": data.collection.itens[0].data[0].value;
-				emailBoxValue = emailBoxValue.length > 2 ? emailBoxValue : data.collection.itens[0].data[1].value.substr(0,data.collection.itens[0].data[1].indexOf('@'));
-				emailBoxValue = emailBoxValue > 18 ? emailBoxValue.substr(0,15) + "..." : emailBoxValue;
-				box.find(".email-box-value").html(emailBoxValue);
-				if(data.collection.itens[0].data[3].value == "TRUE"){
-					box.removeClass("invalid-email-box").addClass("out-office-box");
+				}).find(".box-input").val("\""+item.name+"\" <"+item.email+">");
+
+                box.find(".email-box-value").html(normalizeBoxName(item.name, item.value));
+				if(item.vacationActive == "TRUE"){
+					box.addClass("out-office-box");
 				}
 			}
@@ -4210,4 +4208,37 @@
 	});
 }
+
+function normalizeBoxName(name, mail){
+    var emailBoxValue = name.length > 18 ? name.substring(0, 15)+"...": name;
+    emailBoxValue = emailBoxValue.length > 2 ? emailBoxValue : email.substr(0,email.indexOf('@'));
+    emailBoxValue = emailBoxValue > 18 ? emailBoxValue.substr(0,15) + "..." : emailBoxValue;
+
+    return emailBoxValue;
+}
+
+function normalizeContact(data){
+    var item = {};
+    $.each(data, function(j, e){
+       item[e.name] = e.value;
+    });
+
+    return item;
+}
+
+function normalizeContacts(data){
+    var decoded = [];
+
+    if(!$.isArray(data)){data = [data];}
+
+    for(var i = 0; i < data.length; i++){
+        var item = {};
+        $.each(data[i].data, function(j, e){
+            item[e.name] = e.value;
+        });
+        decoded.push(item);
+    }
+    return decoded;
+}
+
 
 //FUNÇÃO QUE "SETA" OS BINDS DOS CAMPOS PARA - CC - CCO
@@ -4265,5 +4296,5 @@
 						if(item.typel == "/groups" && $(ul).find(".dynamic-recent").length)
 							self._renderItem( ul, {name:"", value:"", type:"linha"} );
-						if(item.typel == "/contacts" && ($(ul).find(".dynamic-group").length || $(ul).find(".dynamic-recent").length))
+						if(item.typel == "/personalContact" && ($(ul).find(".dynamic-group").length || $(ul).find(".dynamic-recent").length))
 							self._renderItem( ul, {name:"", value:"", type:"linha"} );	
 						currentType = item.typel;
@@ -4325,5 +4356,5 @@
 				event.preventDefault();
 				$(this).val("");
-				if(ui.item.typel == "/contacts")
+				if(ui.item.typel == "/personalContact")
 					draw_email_box(""+ui.item.id, $(this), true, (ui.item.type.substring(0,7) == "/shared" ? true : false));
 				else if(ui.item.typel == "/groups")
Index: /trunk/expressoMail1_2/js/doiMenuData.js
===================================================================
--- /trunk/expressoMail1_2/js/doiMenuData.js	(revision 7053)
+++ /trunk/expressoMail1_2/js/doiMenuData.js	(revision 7221)
@@ -304,15 +304,29 @@
 
 function loadExtraLDAPBox(data, element){
+
+    if(!!data[0]){
+        var decoded = {};
+
+        $.each(data, function(i, e){
+            decoded[e.name] = e.value;
+        });
+
+        data = decoded;
+
+        console.log('Entrei nao encodado');
+        console.log(data);
+    }
+
 	menuItensLabel = {};
-	menuItensLabel["Name"] = {name: "<b>"+data[0].value+"</b>", disabled: true};		
-	menuItensLabel["Email"] = {name: data[1].value, disabled: true};	
-	if(data[2].value){
+	menuItensLabel["Name"] = {name: "<b>"+data.name+"</b>", disabled: true};
+	menuItensLabel["Email"] = {name: data.email, disabled: true};
+	if(!!data.telephone){
 		menuItensLabel["TelefoneLabel"] = {name: "<b>"+get_lang("Telephone")+"</b>", disabled: true};
-		menuItensLabel["TelefoneValue"] = {name: data[2].value, disabled: true};
-	}
-	if(data[3]){
-		if(data[3].value == "TRUE"){
+		menuItensLabel["TelefoneValue"] = {name: data.telephone, disabled: true};
+	}
+	if(data.vacationActive){
+		if(data.vacationActive == "TRUE"){
 			menuItensLabel["outOffice"] = {name: "<b>"+get_lang("Out of office")+"</b>", disabled: true};
-			menuItensLabel["outOfficeValue"] = {name: data[4].value.substring(0, 20), disabled: true};
+			menuItensLabel["outOfficeValue"] = {name: data.vacationInfo.substring(0, 20), disabled: true};
 		}
 	}
