Index: /sandbox/2.4.3-expresso-rest/contactcenter/js/cc.js
===================================================================
--- /sandbox/2.4.3-expresso-rest/contactcenter/js/cc.js	(revision 7107)
+++ /sandbox/2.4.3-expresso-rest/contactcenter/js/cc.js	(revision 7273)
@@ -1829,5 +1829,5 @@
 
 function emailTolower(obj){
-	document.getElementById(obj).value = document.getElementById(obj).value.toLowerCase();
+	document.getElementById(obj).value = $.trim(document.getElementById(obj).value.toLowerCase());
 
 }
Index: /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/js/activity.helpers.js
===================================================================
--- /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/js/activity.helpers.js	(revision 7075)
+++ /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/js/activity.helpers.js	(revision 7273)
@@ -138,7 +138,6 @@
 
 UI.dialogs.addActivity.find('.button-add-alarms').click(function(){
-            DataLayer.render( 'templates/alarms_add_itemlist.ejs', {type: 0}, function( template ){                     
+            DataLayer.render( 'templates/alarms_add_itemlist.ejs', {type: 2}, function( template ){
             jQuery('.activity-alarms-list').append(template)
-            .find('li:last label:eq(0)').remove().end()
             .find('.number').numeric().end()
             .find('.button.remove').button({
Index: /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/js/helpers.js
===================================================================
--- /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/js/helpers.js	(revision 7106)
+++ /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/js/helpers.js	(revision 7273)
@@ -1813,5 +1813,5 @@
 DataLayer.render( 'templates/configure_calendars.ejs', {
     user:User, 
-	type: 0,
+	type: type,
     calendars:calendars, 
     signatures:signatures
Index: /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/templates/alarms_add_itemlist.ejs
===================================================================
--- /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/templates/alarms_add_itemlist.ejs	(revision 6996)
+++ /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/templates/alarms_add_itemlist.ejs	(revision 7273)
@@ -39,9 +39,11 @@
 		</select>
 		<input type="hidden" name="alarmId[]" value="" />
-		<%if(!!!parseInt(data.type)){%>
+		<%if(parseInt(data.type) == 0){%>
 			<label>antes de cada evento.</label>
+		<%}else if (parseInt(data.type) == 1){%>
+			<label>antes de cada tarefa.</label>
 		<%}else{%>
-			<label>antes de cada tarefa.</label>
-		<%}%>
+            <label>antes de cada atividade.</label>
+        <%}%>
 		<a class="button remove tiny"></a>
 	</li>
Index: /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/templates/activity_add.ejs
===================================================================
--- /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/templates/activity_add.ejs	(revision 7068)
+++ /sandbox/2.4.3-expresso-rest/prototype/modules/calendar/templates/activity_add.ejs	(revision 7273)
@@ -144,5 +144,5 @@
 					    <input type="hidden" name="alarmId[]" value="<%=data.activity.useAlarmDefault ? '' : alarms[i].id%>" />
 					    <input type="hidden" name="isDefaultAlarm[]" value="<%=data.activity.useAlarmDefault ? 1 : 0%>" />
-					    <label> antes de cada activityo.</label>
+					    <label> antes de cada atividade.</label>
 					    <a class="button remove tiny"></a>
 					</li>
Index: /sandbox/2.4.3-expresso-rest/workflow/inc/local/classes/class.wf_orgchart.php
===================================================================
--- /sandbox/2.4.3-expresso-rest/workflow/inc/local/classes/class.wf_orgchart.php	(revision 7177)
+++ /sandbox/2.4.3-expresso-rest/workflow/inc/local/classes/class.wf_orgchart.php	(revision 7273)
@@ -121,5 +121,5 @@
 	 * @param int $organizationID O ID da organização.
 	 * @param boolean $searchLdap True, caso seja necessário buscar no LDAP os dados dos usuários. Ou false, caso contrário.
-	 * @param int $employeeStatusID O ID do status dos funcionários a serem listados.
+	 * @param boolean $onlyActiveUsers true para retornar somente usuários ativos e false caso contrário
 	 * @return array Uma array seqüencial contendo os funcionários de uma organização. Cada linha do array conterá:
 	 * - organizacao_id
@@ -135,7 +135,8 @@
 	 * - email: email do funcionário (quando busca no Ldap)
 	 * - telefone: telefone do funcionário (quando busca no Ldap)
-	 * @access public
-	 */
-	function getOrganizationEmployees($organizationID, $searchLdap = false, $employeeStatusID = null)
+	 * - uid: uid do funcionário (quando busca no Ldap)
+	 * @access public
+	 */
+	function getOrganizationEmployees($organizationID, $searchLdap = false, $onlyActiveUsers = false)
 	{
 		$query = "SELECT f.organizacao_id, " .
@@ -149,4 +150,6 @@
 				 "       c.descricao AS centro_custo_descricao " .
 				 " FROM funcionario f " .
+				 "  INNER JOIN funcionario_status fs " .
+				 "  ON (f.funcionario_status_id = fs.funcionario_status_id) " .
 				 "  INNER JOIN area a " .
 				 "  ON (f.area_id = a.area_id) " .
@@ -160,8 +163,7 @@
 		$bindValues = array($organizationID);
 
-		// Se desejar somente retornar as áreas que estão ativas
-		if(!empty($employeeStatusID)){
-			$query .=" AND f.funcionario_status_id = ? ";
-			$bindValues[] = $employeeStatusID;
+		// Se desejar somente retornar usuários que estão ativos
+		if($onlyActiveUsers){
+			$query .=" AND fs.exibir = 'S' ";
 		}
 
@@ -1277,4 +1279,5 @@
 					$output[$k]['email']    = $user_data['mail'];
 					$output[$k]['telefone'] = $user_data['telephonenumber'];
+					$output[$k]['uid']      = $user_data['uid'];
 				}
 			}
Index: /sandbox/2.4.3-expresso-rest/expressoMail1_2/templates/default/main.css
===================================================================
--- /sandbox/2.4.3-expresso-rest/expressoMail1_2/templates/default/main.css	(revision 7113)
+++ /sandbox/2.4.3-expresso-rest/expressoMail1_2/templates/default/main.css	(revision 7273)
@@ -803,5 +803,4 @@
 .em_div_sidebox_menu {
 	position: relative;
-	left: 17px;
 	cursor: pointer;
 }
Index: /sandbox/2.4.3-expresso-rest/expressoMail1_2/setup/phpgw_pt-br.lang
===================================================================
--- /sandbox/2.4.3-expresso-rest/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 7100)
+++ /sandbox/2.4.3-expresso-rest/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 7273)
@@ -648,5 +648,5 @@
 with some	expressoMail1_2	pt-br	com algumas
 With the following message	expressoMail1_2	pt-br	Com a seguinte mensagem
-Would you like to have a read receipt option to read messages?	expressoMail1_2	pt-br	Deseja apresentar opção de confirmação de leitura ao ler mensagem?	
+Would you like to have a read receipt option to read messages?	expressoMail1_2	pt-br	Deseja apresentar opção de confirmação de leitura ao ler mensagem?
 Would you like to keep archived messages?	expressoMail1_2	pt-br	Você gostaria de manter as mensagens arquivadas?
 Would you like to use local messages?	expressoMail1_2	pt-br	Você gostaria de usar mensagens locais?
@@ -935,2 +935,4 @@
 The contact was moved from recent contacts to personal contacts successful.	expressoMail1_2	pt-br	O Contato foi movido dos contatos recentes para os contatos pessoais com sucesso.
 You can not remove the message with the preference 'Send to Trash' enabled. There is no permission to move messages to the trash folder.	expressoMail1_2	pt-br	Não é possível remover a mensagem com a preferencia 'Enviar para lixeira' ativada. Não existe permissão para mover mensagens para a pasta lixeira.
+One of his messages can not be marked as read, because it contains a read confirmation.	expressoMail1_2	pt-br	Uma de suas mensagens não pode ser marcada como lida, pois contém uma confirmação de leitura.
+ of its messages could not be marked as read, because it contains a read confirmation.	expressoMail1_2	pt-br	 de suas mensagens não puderam ser marcadas como lida, pois contém uma confirmação de leitura.
Index: /sandbox/2.4.3-expresso-rest/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- /sandbox/2.4.3-expresso-rest/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7235)
+++ /sandbox/2.4.3-expresso-rest/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7273)
@@ -2834,9 +2834,13 @@
             } else {
                 //Compatibilização com Outlook, ao encaminhar a mensagem
-                $body = mb_ereg_replace('<!--\[', '<!-- [', $params['body']);
+                $body = mb_ereg_replace('<!--\[', '<!-- [', $params['body']);				
+				$body = str_replace("&lt;","&yzwkx;",$body); //Alterar as Entities padrão das tags < > para compatibilizar com o Expresso
+				$body = str_replace("&gt;","&xzwky;",$body);
                 $body = str_replace("%nbsp;","&nbsp;",$body);
                 //$body = preg_replace("/\n/"," ",$body);
                 //$body = preg_replace("/\r/","" ,$body);
                 $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' );	
+				$body = str_replace("&yzwkx;","&lt;",$body);
+				$body = str_replace("&xzwky;","&gt;",$body);
             }
 
@@ -3641,4 +3645,13 @@
 	return $returns;
 }
+    function verify_disposition_notification($msg){
+        $header = imap_fetchheader($this->mbox, $msg, FT_UID);
+        $pattern = '/^[ \t]*Disposition-Notification-To:.*/mi';
+        if (preg_match($pattern, $header, $fields))
+            return true;
+        else
+            return false;
+    }
+
 	function set_messages_flag($params)
 	{		
@@ -3667,8 +3680,17 @@
 			$msgs = explode(",",$msgs_to_set);
 			foreach($msgs as $men){
-				if (imap_setflag_full($this->mbox, $men, "\\Seen", ST_UID))
-					$return["msgs_to_set"] .= $men.",";
-				else
-					$return["msgs_not_to_set"] .= $men.",";
+
+                if($this->verify_disposition_notification($men)){
+
+                    if(!array_key_exists('disposition_notification_to', $return))
+                        $return['disposition_notification_to'] = array();
+
+                    $return["disposition_notification_to"][] = $men;
+                }else{
+                    if (imap_setflag_full($this->mbox, $men, "\\Seen", ST_UID))
+                        $return["msgs_to_set"] .= $men.",";
+                    else
+                        $return["msgs_not_to_set"] .= $men.",";
+                }
 			}
 			$return["status"] = true;
Index: /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/main.js
===================================================================
--- /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/main.js	(revision 7245)
+++ /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/main.js	(revision 7273)
@@ -33,17 +33,21 @@
 function updateDynamicContact(){
 	dynamicContacts = new Array();
-	var dynamicData = REST.get("/dynamiccontacts").collection.itens;
-	if(dynamicData){
-		$.each(dynamicData, function(index, value){
+
+    var dynamicUsers = REST.get("/dynamiccontacts");
+
+    if(dynamicUsers.collection && !dynamicUsers.collection.error){
+        var dynamicData = normalizeContacts(dynamicUsers.collection.itens)
+
+        $.each(dynamicData, function(index, value){
 			if(index ==0){
-				topContact = parseInt(value.data[2].value);
+				topContact = parseInt(value['number_of_messages']);
 			}
 			var dynamic = {
-				name : value.data[0].value,
-				mail : value.data[1].value,
-				value: value.data[0].value + " - " + value.data[1].value,
+				name : value.name,
+				mail : value.mail,
+				value: value.name + " - " + value.mail,
 				type: "",
-				id: parseInt(value.data[3].value),
-				qtd : parseInt(value.data[2].value)
+				id: value.id,
+				qtd : value['number_of_messages']
 			};
 			dynamicContacts.push(dynamic);
@@ -55,17 +59,22 @@
 function updateDynamicPersonalContacts(){
 	dynamicPersonalContacts = new Array();
-	var contactsData = normalizeContacts(REST.get("/personalContact").collection.itens);
-	if(contactsData){
-		$.each(contactsData, function(index, value){
-			var contact = {
-                id : parseInt(value.id),
-                name : value.name,
-                email: value.email,
-				value: value.name+ " - " + value.email,
-				type: "P"
-			};
-			dynamicPersonalContacts.push(contact);
-		});
-	}
+
+    var personalContacts = REST.get("/personalContact");
+
+    if(personalContacts.collection && !personalContacts.collection.error){
+        var contactsData = normalizeContacts(personalContacts.collection.itens);
+        if(contactsData){
+            $.each(contactsData, function(index, value){
+                var contact = {
+                    id : parseInt(value.id),
+                    name : value.name,
+                    email: value.email,
+                    value: value.name+ " - " + value.email,
+                    type: "P"
+                };
+                dynamicPersonalContacts.push(contact);
+            });
+        }
+    }
 }
 
@@ -73,17 +82,22 @@
 function updateDynamicPersonalGroups(){
 	dynamicPersonalGroups = new Array();
-	var contactsData = normalizeContacts(REST.get("/groups").collection.itens);
-	if(contactsData){
-		$.each(contactsData, function(index, value){
-			var contact = {
-				id : parseInt(value.id),
-				owner : value.owner,
-				name : value.name,
-				email: value.email,
-				type: "G"
-			};
-			dynamicPersonalGroups.push(contact);
-		});
-	}
+
+    var groups = REST.get("/groups");
+
+    if(groups.collection && !groups.collection.error){
+        var contactsData = normalizeContacts(groups.collection.itens);
+        if(contactsData.collecion && !contactsData.collecion.error){
+            $.each(contactsData, function(index, value){
+                var contact = {
+                    id : parseInt(value.id),
+                    owner : value.owner,
+                    name : value.name,
+                    email: value.email,
+                    type: "G"
+                };
+                dynamicPersonalGroups.push(contact);
+            });
+        }
+    }
 }
 
@@ -3267,4 +3281,13 @@
 			return;
 		var msgs_to_set = data.msgs_to_set.split(",");
+
+
+        if(data.disposition_notification_to){
+            $.Zebra_Dialog(data.disposition_notification_to.length == 1 ? get_lang('One of his messages can not be marked as read, because it contains a read confirmation.') : data.disposition_notification_to.length + get_lang(' of its messages could not be marked as read, because it contains a read confirmation.'), {
+                'type':     'warning',
+                'overlay_opacity': '0.5',
+                'buttons':  ['Fechar']
+            });
+        }
 
 		if(!data.status) {
Index: /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/draw_api.js
===================================================================
--- /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/draw_api.js	(revision 7240)
+++ /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/draw_api.js	(revision 7273)
@@ -1322,5 +1322,11 @@
 		td_element3 = createTDElement(0,8,"th_resizable","left","message_header_SORTFROM_"+numBox);
 		td_element3.onclick = function () {sort_box(search_box_type,'SORTFROM');};
-		td_element3.innerHTML = get_lang("From");
+		folder_ = special_folders['Sent'];
+		current_ = get_current_folder();
+		if ((preferences.from_to_sent == "1") && (current_.substr(current_.length - folder_.length, folder_.length) == folder_)) {
+        	td_element3.innerHTML = get_lang("To");
+    	}else{
+			td_element3.innerHTML = get_lang("From");
+    	}
 
 		td_element4 = createTDElement(0,9,"th_resizable","left","message_header_SORTSUBJECT_"+numBox);
@@ -2170,4 +2176,6 @@
 	if ((preferences.from_to_sent == "1") && (current.substr(current.length - folder.length, folder.length) == folder)) {
         document.getElementById("message_header_SORTFROM_"+numBox).innerHTML    = get_lang("To");
+        if (sort_box_type == "SORTFROM")
+        	type_name = get_lang("To");
     }else{
 	document.getElementById("message_header_SORTFROM_"+numBox).innerHTML 	= get_lang("From");
@@ -4138,5 +4146,5 @@
 							'auto_close': 3000
 						});
-					}).find(".box-input").val("\""+data.collection.data[1].value+"\" <"+data.collection.data[2].value+">");
+					}).find(".box-input").val("\""+data.collection.data[1].value+"\" <"+$.trim(data.collection.data[2].value)+">");
 					box.find(".email-box-value").html( (data.collection.data[1].value.length > 18 ? data.collection.data[1].value.substring(0, 15)+"...": data.collection.data[1].value))
 				}
@@ -4165,5 +4173,5 @@
 							'auto_close': 3000
 						});
-					}).find(".box-input").val("\""+item.name+"\" <"+item.email+">");
+					}).find(".box-input").val("\""+item.name+"\" <"+$.trim(item.email)+">");
 
 					box.find(".email-box-value").html(normalizeBoxName(item.name, item.value));
@@ -4192,5 +4200,5 @@
 						'auto_close': 3000
 					});
-				}).find(".box-input").val("\""+item.name+"\" <"+item.email+">");
+				}).find(".box-input").val("\""+item.name+"\" <"+$.trim(item.email)+">");
 
                 box.find(".email-box-value").html(normalizeBoxName(item.name, item.value));
Index: /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/QuickCatalogSearch.js
===================================================================
--- /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/QuickCatalogSearch.js	(revision 7225)
+++ /sandbox/2.4.3-expresso-rest/expressoMail1_2/js/QuickCatalogSearch.js	(revision 7273)
@@ -54,4 +54,5 @@
 						e.preventDefault();
 						$("#dialog-modal").dialog("close");
+						$('.to').blur().focus();
 					}
 					if (is_webkit){
