diff --git a/apps/maarch_entreprise/js/functions.js b/apps/maarch_entreprise/js/functions.js
index a74ffbbf67adf6a4a201beef05648a11d3afce75..1166237693709b9aee6c20a8e877aace62acfdf3 100755
--- a/apps/maarch_entreprise/js/functions.js
+++ b/apps/maarch_entreprise/js/functions.js
@@ -2985,7 +2985,7 @@ function loadDiffList(id)
                 onSuccess: function (answer) {
                     eval("response = " + answer.responseText);
                     if (!response.toShow.match(/<div style="font-style:italic;text-align:center;color:#ea0000;margin:10px;">/)) {
-                        $('divDiffList_' + id).innerHTML += '<fieldset style="border: 1px dashed rgb(0, 157, 197);width:100%;"><legend>Circuit de visa:</legend>' + response.toShow + '</fieldset>';
+                        $('divDiffList_' + id).innerHTML += '<fieldset id="visa_fieldset" style="border: 1px dashed rgb(0, 157, 197);width:100%;"><legend>Circuit de visa:</legend>' + response.toShow + '</fieldset>';
                         $j('#divDiffList_' + id).css({"width": "97%", "display": "table"});
                         $j('#divDiffList_' + id).children().css({"width": "48%", "display": "table-cell", "vertical-align": "top", "padding": "5px", "margin": "5px"});
                     }
@@ -2999,7 +2999,12 @@ function loadDiffList(id)
                                     if (!response.toShow.match(/<div style="font-style:italic;text-align:center;color:#ea0000;margin:10px;">/)) {
                                         $('divDiffList_' + id).innerHTML += '<fieldset style="border: 1px dashed rgb(0, 157, 197);width:100%;"><legend>Circuit d\'avis:</legend>' + response.toShow + '</fieldset>';
                                         $j('#divDiffList_' + id).css({"width": "97%", "display": "table", "white-space": "nowrap"});
-                                        $j('#divDiffList_' + id).children().css({"width": "32%", "display": "table-cell", "vertical-align": "top", "padding": "5px", "margin": "5px"});
+                                        $j('#divDiffList_' + id+" fieldset").css({"white-space": "normal"});
+                                        if($j('#visa_fieldset').length){
+                                            $j('#divDiffList_' + id).children().css({"width": "32%", "display": "table-cell", "vertical-align": "top", "padding": "5px", "margin": "5px"});
+                                        }else{
+                                            $j('#divDiffList_' + id).children().css({"width": "48%", "display": "table-cell", "vertical-align": "top", "padding": "5px", "margin": "5px"});
+                                        }
                                     }
 
                                 }
diff --git a/core/class/class_core_tools.php b/core/class/class_core_tools.php
index 4380ef27c9ad3900602499efeefcde29cb3cf439..6e7d98c9eeb149a3c313b7a2de1aca534a454ab5 100755
--- a/core/class/class_core_tools.php
+++ b/core/class/class_core_tools.php
@@ -2360,6 +2360,10 @@ class core_tools extends functions
         }
         $linkToApps = false;
             $arr = explode('/', $_SERVER['SCRIPT_NAME']);
+        if($key = array_search('rest',$arr)){
+            unset($arr[$key]);
+        }
+        $arr = array_values($arr);
         for($cptArr=0;$cptArr<count($arr);$cptArr++) {
             if($arr[$cptArr] == "apps") {
                 $linkToApps = true;
diff --git a/modules/sendmail/batch/process_emails.php b/modules/sendmail/batch/process_emails.php
old mode 100644
new mode 100755
index 618bdbdb2beb8526430dbc59b727b05671ee8b8a..0c8c9b987782102f1e852ee51df57fdb3af11c60
--- a/modules/sendmail/batch/process_emails.php
+++ b/modules/sendmail/batch/process_emails.php
@@ -63,7 +63,6 @@ while ($state <> 'END') {
 			if ($userInfo['mail'] == $email->sender_email) {
 				if (!empty($mailfrom_generic)) {
 
-
 					$GLOBALS['logger']->write('process e-mail '.($currentEmail+1)."/".$totalEmailsToProcess.' (FROM => '.$userInfo['firstname'].' '.$userInfo['lastname'].' <'.$mailfrom_generic.'>'.', TO => '.$email->to_list.', SUBJECT => '.$email->email_object.', CC =>'.$email->cc_list.', CCI => '.$email->cci_list.') ...', 'INFO');
 
 		            $GLOBALS['mailer']->setFrom($userInfo['firstname'].' '
@@ -102,11 +101,14 @@ while ($state <> 'END') {
 			if (!empty($email->cci_list))$GLOBALS['logger']->write("Copy invisible e-mail to : " . $email->cci_list, 'INFO');
 			
 			//--> Set the return path
-			$GLOBALS['mailer']->setReturnPath($userInfo['mail']);
-			/*$GLOBALS['mailer']->setReturnPath(
-				$userInfo['firstname'] . ' ' .  $userInfo['lastname'] . ' <' . $mailfrom_generic . '> '
-			);*/
-			
+			if (!empty($mailfrom_generic)) {
+				$GLOBALS['mailer']->setReturnPath(
+					$userInfo['firstname'] . ' ' .  $userInfo['lastname'] . ' <' . $mailfrom_generic . '> '
+				);
+			} else {
+				$GLOBALS['mailer']->setReturnPath($userInfo['mail']);
+			}
+
 			//--> To
 			$to = array();
 			$to = explode(',', $email->to_list);
diff --git a/rest/.htaccess b/rest/.htaccess
new file mode 100644
index 0000000000000000000000000000000000000000..8ece6f24b0d8631d11313b2d4293aecee84d7547
--- /dev/null
+++ b/rest/.htaccess
@@ -0,0 +1,7 @@
+Order allow,deny
+Allow from all
+RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteCond %{REQUEST_FILENAME} !-d
+RewriteRule ^ index.php [QSA,L]
+