diff --git a/ChangeLog b/ChangeLog
index 4618529b00941449d0eaa76824fde5a6c1418c81..504bd8b5e521ddebcd2d4e993efc1f4a6eb337d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -46,7 +46,8 @@ For developers:
 - Add hook getFormMail.
 - Function plimit of databases drivers accept -1 as value (it means default value set
   into conf->liste_limit).
-- New: Add option dol_hide_topmenu and dol_hide_leftmenu onto login page.
+- New: Add option dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen,
+  dol_no_mouse_hover and dol_use_jmobile onto login page (to support different terminal).
 - New: dol_syslog method accept a suffix to use different log files for log. 
 - New: Type of fields are received by export format handlers.
 - New: when adding an action, we can define a free code to tag it for a specific need.
diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php
index 75b17a6776efcca48617461b938b8b7953b100cd..9b83acc0bbd5fcc98a6da5d6a32bde37dbfe70e7 100644
--- a/htdocs/admin/system/dolibarr.php
+++ b/htdocs/admin/system/dolibarr.php
@@ -88,8 +88,7 @@ $var=!$var;
 print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("CurrentTheme").'</td><td colspan="2">'.$conf->theme.'</td></tr>'."\n";
 $var=!$var;
 print '<tr '.$bc[$var].'><td width="300">'.$langs->trans("CurrentMenuHandler").'</td><td colspan="2">';
-if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone)) print $conf->smart_menu;
-else print $conf->standard_menu;
+print $conf->standard_menu;
 print '</td></tr>'."\n";
 print '</table>';
 print '<br>';
diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index fcecbf0a552d50747e41f6c68e42c4c184323edd..76e0068fbd439f7a368f5d28140db8832121177a 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -196,7 +196,7 @@ if ($id > 0)
 	$object->next_prev_filter="te.client in (1,3)";
 	print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
 	print '</td></tr>';
-	
+
 	// Prospect/Customer
 	print '<tr><td width="30%">'.$langs->trans('ProspectCustomer').'</td><td width="70%" colspan="3">';
 	print $object->getLibCustProspStatut();
@@ -384,7 +384,7 @@ if ($id > 0)
 		print '</td><td colspan="3">'.$object->price_level."</td>";
 		print '</tr>';
 	}
-	
+
 	// Level of prospect
 	if ($object->client == 2 || $object->client == 3)
 	{
@@ -401,7 +401,7 @@ if ($id > 0)
 			print $object->getLibProspLevel();
 		print "</td>";
 		print '</tr>';
-		
+
 		// Status
 		print '<tr><td>'.$langs->trans("StatusProsp").'</td><td colspan="2">'.$object->getLibProspCommStatut(4).'</td>';
 		print '<td>';
@@ -500,8 +500,8 @@ if ($id > 0)
 			while ($i < $num && $i < $MAXLIST)
 			{
 				$objp = $db->fetch_object($resql);
-				print "<tr $bc[$var]>";
-				print '<td nowrap><a href="propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a>'."\n";
+				print "<tr ".$bc[$var].">";
+				print '<td nowrap="nowrap"><a href="propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' '.$objp->ref.'</a>'."\n";
 				if ( ($db->jdate($objp->dp) < ($now - $conf->propal->cloture->warning_delay)) && $objp->fk_statut == 1 )
 				{
 					print " ".img_warning();
@@ -751,7 +751,7 @@ if ($id > 0)
 				$objp = $db->fetch_object($resql);
 				$var=!$var;
 				print "<tr $bc[$var]>";
-				print '<td>';
+				print '<td nowrap="nowrap">';
 				$facturestatic->id=$objp->facid;
 				$facturestatic->ref=$objp->facnumber;
 				$facturestatic->type=$objp->type;
@@ -790,30 +790,30 @@ if ($id > 0)
 	/*
 	 * Barre d'actions
 	 */
-	print '<div class="tabsAction">';
+	print '<div class="tabsAction" style="clear: both;">';
 
 	if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
 	{
 		$langs->load("propal");
-		print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
+		print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a></div>';
 	}
 
 	if (! empty($conf->commande->enabled) && $user->rights->commande->creer)
 	{
 		$langs->load("orders");
-		print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a>';
+		print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddOrder").'</a></div>';
 	}
 
 	if ($user->rights->contrat->creer)
 	{
 		$langs->load("contracts");
-		print '<a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a>';
+		print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/contrat/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddContract").'</a></div>';
 	}
 
 	if (! empty($conf->ficheinter->enabled) && $user->rights->ficheinter->creer)
 	{
 		$langs->load("fichinter");
-		print '<a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a>';
+		print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/fichinter/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddIntervention").'</a></div>';
 	}
 
 	// Add invoice
@@ -822,7 +822,7 @@ if ($id > 0)
 		if (! empty($conf->deplacement->enabled))
 		{
 			$langs->load("trips");
-			print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a>';
+			print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/deplacement/fiche.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddTrip").'</a></div>';
 		}
 
 		if (! empty($conf->facture->enabled))
@@ -834,17 +834,17 @@ if ($id > 0)
 
 				if (! empty($conf->commande->enabled))
 				{
-					if($orders2invoice > 0) print '<a class="butAction" href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a>';
-					else print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a>';
+					if($orders2invoice > 0) print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
+					else print '<div class="floatright divbutaction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NoOrdersToInvoice")).'" href="#">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';
 				}
 
-				if ($object->client != 0) print '<a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
-				else print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a>';
+				if ($object->client != 0) print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a></div>';
+				else print '<div class="floatright divbutaction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("ThirdPartyMustBeEditAsCustomer")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
 
 			}
 			else
 			{
-				print '<a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a>';
+				print '<div class="floatright divbutaction"><a class="butActionRefused" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddBill").'</a></div>';
 			}
 		}
 	}
@@ -854,11 +854,11 @@ if ($id > 0)
 	{
 		if ($user->rights->agenda->myactions->create)
 		{
-			print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a>';
+			print '<div class="floatright divbutaction"><a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&socid='.$object->id.'">'.$langs->trans("AddAction").'</a></div>';
 		}
 		else
 		{
-			print '<a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a>';
+			print '<div class="floatright divbutaction"><a class="butAction" title="'.dol_escape_js($langs->trans("NotAllowed")).'" href="#">'.$langs->trans("AddAction").'</a></div>';
 		}
 	}
 
diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php
index 7ca1b1dd4a254dfc264e23fb283cba8def3036fe..2bd51b87f98cabccee8e2071aa515f6bcc9cc644 100644
--- a/htdocs/core/boxes/modules_boxes.php
+++ b/htdocs/core/boxes/modules_boxes.php
@@ -164,7 +164,7 @@ class ModeleBoxes    // Can't be abtract as it is instanciated to build "empty"
 			{
 				print '</td><td class="nocellnopadd boxclose" nowrap="nowrap">';
 				// The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object
-				print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle" style="cursor:move;"');
+				print img_picto($langs->trans("MoveBox",$this->box_id),'grip','class="boxhandle hideonsmartphone" style="cursor:move;"');
 				print img_picto($langs->trans("Close",$this->box_id),'close','class="boxclose" style="cursor:pointer;" id="imgclose'.$this->box_id.'"');
 				print '</td></tr></table>';
 			}
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 2ea053062b022bb8de9d947578ae62783673752f..764438a273c63cf8c008ef1c7d2dda075ee53e52 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -47,9 +47,8 @@ class Conf
 	//! Used to store current css (from theme)
 	public $theme;        // Contains current theme ("eldy", "auguria", ...)
 	public $css;          // Contains full path of css page ("/theme/eldy/style.css.php", ...)
-    //! Used to store current menu handlers
+    //! Used to store current menu handler
 	public $standard_menu;
-	public $smart_menu;
 
 	public $modules					= array();	// List of activated modules
 	public $modules_parts			= array('css'=>array(),'js'=>array(),'tabs'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'sms'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'societe'=>array(),'hooks'=>array(),'dir'=>array());
@@ -64,6 +63,11 @@ class Conf
 	//! Used to store list of entities to use for each element
 	public $entities				= array();
 
+	public $dol_hide_topmenu;			// Set if we force param dol_hide_topmenu into login url
+	public $dol_hide_leftmenu;			// Set if we force param dol_hide_leftmenu into login url
+	public $dol_optimize_smallscreen;	// Set if we force param dol_optimize_smallscreen into login url or if browser is smartphone
+	public $dol_no_mouse_hover;			// Set if we force param dol_no_mouse_hover into login url or if browser is smartphone
+	public $dol_use_jmobile;			// Set if we force param dol_use_jmobile into login url
 
 
 	/**
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 7d7713b297c8b2b9a265c5626bdb2a80f5e9b164..f251df08cb78de7197763c85f83a5ef8cd2d2380 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -422,8 +422,9 @@ class Form
                 $htmltext = '';
             }
         }
-        // If info or help with smartphone, show only text
-        if (! empty($conf->browser->phone))
+
+        // If info or help with smartphone, show only text (tooltip can't works)
+        if (! empty($conf->dol_no_mouse_hover))
         {
             if ($type == 'info' || $type == 'help') return $text;
         }
diff --git a/htdocs/core/getmenu_jmobile.php b/htdocs/core/get_menudiv.php
similarity index 77%
rename from htdocs/core/getmenu_jmobile.php
rename to htdocs/core/get_menudiv.php
index 988dec4339a7549057a64cfec0e2f87c09fb0a56..0d9e3c0a54bccb5fbc25de4875a5fd90982e9404 100644
--- a/htdocs/core/getmenu_jmobile.php
+++ b/htdocs/core/get_menudiv.php
@@ -19,8 +19,8 @@
  */
 
 /**
- *       \file       htdocs/core/getmenu_jmobile.php
- *       \brief      File to return menu
+ *       \file       htdocs/core/get_menudiv.php
+ *       \brief      File to return menu into a div tree
  */
 
 //if (! defined('NOREQUIREUSER'))   define('NOREQUIREUSER','1');	// Not disabled cause need to load personalized language
@@ -50,26 +50,24 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
  * View
  */
 
-// URL http://mydolibarr/core/getmenu_jmobile?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
-$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
-$arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css');
+// URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests
+$arrayofjs=array();
+$arrayofcss=array();
 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
 
 print '<body>'."\n";
 
-if (empty($user->societe_id))    // If internal user or not defined
+if (empty($user->societe_id))	// If internal user or not defined
 {
 	$conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
-	$conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
 }
-else                        // If external user
+else                        	// If external user
 {
 	$conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
-	$conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
 }
 
 // Load the menu manager (only if not already done)
-$file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu;
+$file_menu=$conf->standard_menu;
 if (GETPOST('menu')) $file_menu=GETPOST('menu');     // example: menu=eldy_menu.php
 if (! class_exists('MenuManager'))
 {
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 0ade0a627a34c382bd4f3894f2e7d2069bc021eb..91636c795a8d515ee514c62fe51719ea616680f9 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -321,14 +321,14 @@ function dol_clone($object)
  *
  * 	@param	int		$size		Size we want
  * 	@param	string	$type		Type of optimizing:
- * 										'' = function used to define a size for truncation
- * 										'width' = function is used to define a width
+ * 								'' = function used to define a size for truncation
+ * 								'width' = function is used to define a width
  *	@return int					New size after optimizing
  */
 function dol_size($size,$type='')
 {
 	global $conf;
-	if (empty($conf->browser->phone)) return $size;
+	if (empty($conf->dol_optimize_smallscreen)) return $size;
 	if ($type == 'width' && $size > 250) return 250;
 	else return 10;
 }
@@ -594,7 +594,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
 
 	// Show title
 	$showtitle=1;
-	if (! empty($conf->browser->phone)) $showtitle=0;
+	if (! empty($conf->dol_optimize_smallscreen)) $showtitle=0;
 	if (! empty($title) && $showtitle)
 	{
 		$limittitle=30;
@@ -767,6 +767,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
 {
 	global $conf,$langs;
 
+	// Clean parameters
 	$to_gmt=false;
 	$offsettz=$offsetdst=0;
 	if ($tzoutput)
@@ -792,36 +793,32 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
 			}
 		}
 	}
-
 	if (! is_object($outputlangs)) $outputlangs=$langs;
-
-	// Si format non defini, on prend $conf->format_date_text_short sinon %Y-%m-%d %H:%M:%S
-	if (! $format) $format=(isset($conf->format_date_text_short) ? $conf->format_date_text_short : '%Y-%m-%d %H:%M:%S');
+	if (! $format) $format='daytextshort';
 
 	// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
-	if ($format == 'day')					$format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
-	else if ($format == 'hour')				$format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
-	else if ($format == 'hourduration')		$format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
-	else if ($format == 'daytext')			$format=($outputlangs->trans("FormatDateText")!="FormatDateText"?$outputlangs->trans("FormatDateText"):$conf->format_date_text);
-	else if ($format == 'daytextshort')		$format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short);
-	else if ($format == 'dayhour')			$format=($outputlangs->trans("FormatDateHourShort")!="FormatDateHourShort"?$outputlangs->trans("FormatDateHourShort"):$conf->format_date_hour_short);
-	else if ($format == 'dayhoursec')		$format=($outputlangs->trans("FormatDateHourSecShort")!="FormatDateHourSecShort"?$outputlangs->trans("FormatDateHourSecShort"):$conf->format_date_hour_sec_short);
-	else if ($format == 'dayhourtext')		$format=($outputlangs->trans("FormatDateHourText")!="FormatDateHourText"?$outputlangs->trans("FormatDateHourText"):$conf->format_date_hour_text);
-	else if ($format == 'dayhourtextshort')	$format=($outputlangs->trans("FormatDateHourTextShort")!="FormatDateHourTextShort"?$outputlangs->trans("FormatDateHourTextShort"):$conf->format_date_hour_text_short);
-
+	if ($format == 'day')					 $format=($outputlangs->trans("FormatDateShort")!="FormatDateShort"?$outputlangs->trans("FormatDateShort"):$conf->format_date_short);
+	else if ($format == 'hour')			 $format=($outputlangs->trans("FormatHourShort")!="FormatHourShort"?$outputlangs->trans("FormatHourShort"):$conf->format_hour_short);
+	else if ($format == 'hourduration')	 $format=($outputlangs->trans("FormatHourShortDuration")!="FormatHourShortDuration"?$outputlangs->trans("FormatHourShortDuration"):$conf->format_hour_short_duration);
+	else if ($format == 'daytext')			 $format=($outputlangs->trans("FormatDateText")!="FormatDateText"?$outputlangs->trans("FormatDateText"):$conf->format_date_text);
+	else if ($format == 'daytextshort')	 $format=($outputlangs->trans("FormatDateTextShort")!="FormatDateTextShort"?$outputlangs->trans("FormatDateTextShort"):$conf->format_date_text_short);
+	else if ($format == 'dayhour')			 $format=($outputlangs->trans("FormatDateHourShort")!="FormatDateHourShort"?$outputlangs->trans("FormatDateHourShort"):$conf->format_date_hour_short);
+	else if ($format == 'dayhoursec')		 $format=($outputlangs->trans("FormatDateHourSecShort")!="FormatDateHourSecShort"?$outputlangs->trans("FormatDateHourSecShort"):$conf->format_date_hour_sec_short);
+	else if ($format == 'dayhourtext')		 $format=($outputlangs->trans("FormatDateHourText")!="FormatDateHourText"?$outputlangs->trans("FormatDateHourText"):$conf->format_date_hour_text);
+	else if ($format == 'dayhourtextshort') $format=($outputlangs->trans("FormatDateHourTextShort")!="FormatDateHourTextShort"?$outputlangs->trans("FormatDateHourTextShort"):$conf->format_date_hour_text_short);
 	// Format not sensitive to language
-	else if ($format == 'dayhourlog')		$format='%Y%m%d%H%M%S';
-	else if ($format == 'dayhourldap')		$format='%Y%m%d%H%M%SZ';
-	else if ($format == 'dayhourxcard')		$format='%Y%m%dT%H%M%SZ';
-	else if ($format == 'dayxcard')			$format='%Y%m%d';
-	else if ($format == 'dayrfc')			$format='%Y-%m-%d';             // DATE_RFC3339
-	else if ($format == 'dayhourrfc')		$format='%Y-%m-%dT%H:%M:%SZ';   // DATETIME RFC3339
+	else if ($format == 'dayhourlog')		 $format='%Y%m%d%H%M%S';
+	else if ($format == 'dayhourldap')		 $format='%Y%m%d%H%M%SZ';
+	else if ($format == 'dayhourxcard')	 $format='%Y%m%dT%H%M%SZ';
+	else if ($format == 'dayxcard')	 	 $format='%Y%m%d';
+	else if ($format == 'dayrfc')			 $format='%Y-%m-%d';             // DATE_RFC3339
+	else if ($format == 'dayhourrfc')		 $format='%Y-%m-%dT%H:%M:%SZ';   // DATETIME RFC3339
+	else if ($format == 'standard')		 $format='%Y-%m-%d %H:%M:%S';
 
 	// If date undefined or "", we return ""
 	if (dol_strlen($time) == 0) return '';		// $time=0 allowed (it means 01/01/1970 00:00:00)
 
-	//print 'x'.$time;
-
+	// Clean format
 	if (preg_match('/%b/i',$format))		// There is some text to translate
 	{
 		// We inhibate translation to text made by strftime functions. We will use trans instead later.
@@ -2477,7 +2474,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
 		}
 		else
 		{
-			if (empty($conf->browser->phone) && $picto && $titre) print '<td class="nobordernopadding" width="40" align="left" valign="middle">'.img_picto('',$picto, '', $pictoisfullpath).'</td>';
+			if (empty($conf->dol_optimize_smallscreen) && $picto && $titre) print '<td class="nobordernopadding" width="40" align="left" valign="middle">'.img_picto('',$picto, '', $pictoisfullpath).'</td>';
 			print '<td class="nobordernopadding">';
 			print '<div class="titre">'.$titre.'</div>';
 			$pagelist.= $langs->trans('Page').' '.($page+1);
@@ -2486,7 +2483,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
 	}
 	else
 	{
-		if (empty($conf->browser->phone) && $picto && $titre) print '<td class="nobordernopadding" width="40" align="left" valign="middle">'.img_picto('',$picto, '', $pictoisfullpath).'</td>';
+		if (empty($conf->dol_optimize_smallscreen) && $picto && $titre) print '<td class="nobordernopadding" width="40" align="left" valign="middle">'.img_picto('',$picto, '', $pictoisfullpath).'</td>';
 		print '<td class="nobordernopadding"><div class="titre">'.$titre.'</div></td>';
 	}
 
diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php
index 3a71a1939b2130ac73a88b9a5be438994ac23cd6..dcb94bd084af8573f11b75a514807a2eb09952e1 100644
--- a/htdocs/core/lib/security2.lib.php
+++ b/htdocs/core/lib/security2.lib.php
@@ -168,25 +168,18 @@ function dol_loginfunction($langs,$conf,$mysoc)
 	$conf_css = $themepath."?lang=".$langs->defaultlang;
 
 	// Select templates
-	if (! empty($conf->browser->phone) && preg_match('/^smartphone/',$conf->smart_menu))
+	if (! empty($conf->modules_parts['tpl']))	// Using this feature slow down application
 	{
-		$template_dir = DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/';
+		$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/'));
+		foreach($dirtpls as $reldir)
+		{
+			$tmp=dol_buildpath($reldir.'login.tpl.php');
+			if (file_exists($tmp)) { $template_dir=preg_replace('/login\.tpl\.php$/','',$tmp); break; }
+		}
 	}
 	else
 	{
-		if (! empty($conf->modules_parts['tpl']))	// Using this feature slow down application
-		{
-			$dirtpls=array_merge($conf->modules_parts['tpl'],array('/core/tpl/'));
-			foreach($dirtpls as $reldir)
-			{
-				$tmp=dol_buildpath($reldir.'login.tpl.php');
-				if (file_exists($tmp)) { $template_dir=preg_replace('/login\.tpl\.php$/','',$tmp); break; }
-			}
-		}
-		else
-		{
-			$template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
-		}
+		$template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
 	}
 
 	// Set cookie for timeout management
@@ -295,9 +288,12 @@ function dol_loginfunction($langs,$conf,$mysoc)
 	$jquerytheme = 'smoothness';
 	if (! empty($conf->global->MAIN_USE_JQUERY_THEME)) $jquerytheme = $conf->global->MAIN_USE_JQUERY_THEME;
 
-	// Set dol_hide_topmenu and dol_hide_leftmenu
+	// Set dol_hide_topmenu, dol_hide_leftmenu, dol_optimize_smallscreen, dol_nomousehover
 	$dol_hide_topmenu=GETPOST('dol_hide_topmenu');
 	$dol_hide_leftmenu=GETPOST('dol_hide_leftmenu');
+	$dol_optimize_smallscreen=GETPOST('dol_optimize_smallscreen');
+	$dol_no_mouse_hover=GETPOST('dol_no_mouse_hover');
+	$dol_use_jmobile=GETPOST('dol_use_jmobile');
 
 	// Include login page template
 	include $template_dir.'login.tpl.php';
diff --git a/htdocs/core/search_jmobile.php b/htdocs/core/search_page.php
similarity index 96%
rename from htdocs/core/search_jmobile.php
rename to htdocs/core/search_page.php
index e5604ddcc7586f16a16dab488bec2040b2822b89..cf8be7ddb12eab1459e4d1c830ebbcd5872357df 100644
--- a/htdocs/core/search_jmobile.php
+++ b/htdocs/core/search_page.php
@@ -19,7 +19,7 @@
  */
 
 /**
- *       \file       htdocs/core/search_jmobile.php
+ *       \file       htdocs/core/search_page.php
  *       \brief      File to return search box
  */
 
@@ -50,7 +50,7 @@ $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
  * View
  */
 
-// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
+// URL http://mydolibarr/core/search_page?dol_use_jmobile=1 can be used for tests
 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
 
 
diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index b8b297b775dc2f0e9f3bd7c1e5eb52bffc75e192..6ec50bb1d23d91124eeeaceb2270b511ba360504 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -89,6 +89,9 @@ $(document).ready(function () {
 <input type="hidden" name="screenheight" id="screenheight" value="" />
 <input type="hidden" name="dol_hide_topmenu" id="dol_hide_topmenu" value="<?php echo $dol_hide_topmenu; ?>" />
 <input type="hidden" name="dol_hide_leftmenu" id="dol_hide_leftmenu" value="<?php echo $dol_hide_leftmenu; ?>" />
+<input type="hidden" name="dol_optimize_smallscreen" id="dol_optimize_smallscreen" value="<?php echo $dol_optimize_smallscreen; ?>" />
+<input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_hover" value="<?php echo $dol_no_mouse_hover; ?>" />
+<input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
 
 <table class="login_table_title" summary="<?php echo dol_escape_htmltag($title); ?>" cellpadding="0" cellspacing="0" border="0" align="center">
 <tr class="vmenu"><td align="center"><?php echo $title; ?></td></tr>
diff --git a/htdocs/index.php b/htdocs/index.php
index 294443adff13c3386073e3e918c32b83ff7be92b..8c2f009cb4aaeef0efeaeb5b1ee96727d0b5adb7 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -52,13 +52,6 @@ if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_IN
  * View
  */
 
-// If smartphone mode, we do not show main page, we show only menu. TODO Remove this
-if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
-{
-    include_once DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/menu.tpl.php';
-    exit;
-}
-
 llxHeader('',$langs->trans("HomeArea"));
 
 print_fiche_titre($langs->trans("HomeArea"));
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 99a60857e3d445b0689c682a188ea0c07731dd2d..28de6467cbb16243a5a98d6bdc4ada107c0932bf 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -571,7 +571,7 @@ ThisLimitIsDefinedInSetup=Dolibarr limit (Menu home-setup-security): %s Kb, PHP
 NoFileFound=No documents saved in this directory
 CurrentUserLanguage=Current language
 CurrentTheme=Current theme
-CurrentMenuManager=current menu manager
+CurrentMenuManager=Current menu manager
 DisabledModules=Disabled modules
 For=For
 ForCustomer=For customer
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index bae7f0de7f24878d265aacd9dc8f55d9c6da66c2..f772df7420b583c1e20233ddcc78e80888b8e2fd 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -418,6 +418,11 @@ if (! defined('NOLOGIN'))
                 $dol_dst_second=$_POST["dst_second"];
                 $dol_screenwidth=$_POST["screenwidth"];
                 $dol_screenheight=$_POST["screenheight"];
+                $dol_hide_topmenu=$_POST['dol_hide_topmenu'];
+                $dol_hide_leftmenu=$_POST['dol_hide_leftmenu'];
+                $dol_optimize_smallscreen=$_POST['dol_optimize_smallscreen'];
+                $dol_no_mouse_hover=$_POST['dol_no_mouse_hover'];
+                $dol_use_jmobile=$_POST['dol_use_jmobile'];
             }
 
             if (! $login)
@@ -526,8 +531,8 @@ if (! defined('NOLOGIN'))
             exit;
         }
         else
-        {
-            if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER))	// We do not execute such trigger at each page load by default
+       {
+            if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER))	// We do not execute such trigger at each page load by default (triggers are time consuming)
             {
                 // Call triggers
                 include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
@@ -545,9 +550,10 @@ if (! defined('NOLOGIN'))
     // If we are here, this means authentication was successfull.
     if (! isset($_SESSION["dol_login"]))
     {
-        $error=0;
+        // New session for this login.
+    	$error=0;
 
-        // New session for this login
+    	// Store value into session (values always stored)
         $_SESSION["dol_login"]=$user->login;
         $_SESSION["dol_authmode"]=isset($dol_authmode)?$dol_authmode:'';
         $_SESSION["dol_tz"]=isset($dol_tz)?$dol_tz:'';
@@ -560,8 +566,13 @@ if (! defined('NOLOGIN'))
         $_SESSION["dol_screenheight"]=isset($dol_screenheight)?$dol_screenheight:'';
         $_SESSION["dol_company"]=$conf->global->MAIN_INFO_SOCIETE_NOM;
         $_SESSION["dol_entity"]=$conf->entity;
-        if (GETPOST('dol_hide_topmenu')) $_SESSION['dol_hide_topmenu']=1;
-        if (GETPOST('dol_hide_leftmenu')) $_SESSION['dol_hide_leftmenu']=1;
+    	// Store value into session (values stored only if defined)
+        if (! empty($dol_hide_topmenu))         $_SESSION['dol_hide_topmenu']=$dol_hide_topmenu;
+        if (! empty($dol_hide_leftmenu))        $_SESSION['dol_hide_leftmenu']=$dol_hide_leftmenu;
+        if (! empty($dol_optimize_smallscreen)) $_SESSION['dol_optimize_smallscreen']=$dol_optimize_smallscreen;
+        if (! empty($dol_no_mouse_hover))       $_SESSION['dol_no_mouse_hover']=$dol_no_mouse_hover;
+        if (! empty($dol_use_jmobile))          $_SESSION['dol_use_jmobile']=$dol_use_jmobile;
+
         dol_syslog("This is a new started user session. _SESSION['dol_login']=".$_SESSION["dol_login"].' Session id='.session_id());
 
         $db->begin();
@@ -630,32 +641,47 @@ if (! defined('NOLOGIN'))
 
     /*
      * Overwrite configs global by personal configs
-    */
+     */
+
     // Set liste_limit
-    if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT))	// Can be 0
-    {
-        $conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT;
-    }
-    if (isset($user->conf->PRODUIT_LIMIT_SIZE))		// Can be 0
-    {
-        $conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE;
-    }
+    if (isset($user->conf->MAIN_SIZE_LISTE_LIMIT))	$conf->liste_limit = $user->conf->MAIN_SIZE_LISTE_LIMIT;		// Can be 0
+    if (isset($user->conf->PRODUIT_LIMIT_SIZE))	$conf->product->limit_size = $user->conf->PRODUIT_LIMIT_SIZE;	// Can be 0
+
     // Replace conf->css by personalized value
     if (isset($user->conf->MAIN_THEME) && $user->conf->MAIN_THEME)
     {
         $conf->theme=$user->conf->MAIN_THEME;
         $conf->css  = "/theme/".$conf->theme."/style.css.php";
     }
+}
 
-    // Set javascript option
-    if (! GETPOST('nojs'))   // If javascript was not disabled on URL
-    {
-        if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
-        {
-            $conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
-        }
-    }
-    else $conf->use_javascript_ajax=0;
+// Case forcing style from url
+if (GETPOST('theme'))
+{
+	$conf->theme=GETPOST('theme','alpha',1);
+	$conf->css  = "/theme/".$conf->theme."/style.css.php";
+}
+
+// Set javascript option
+if (! GETPOST('nojs'))   // If javascript was not disabled on URL
+{
+	if (! empty($user->conf->MAIN_DISABLE_JAVASCRIPT))
+	{
+		$conf->use_javascript_ajax=! $user->conf->MAIN_DISABLE_JAVASCRIPT;
+	}
+}
+else $conf->use_javascript_ajax=0;
+
+// Set terminal output option
+if (GETPOST('dol_hide_leftmenu') || ! empty($_SESSION['dol_hide_leftmenu']))               $conf->dol_hide_leftmenu=1;
+if (GETPOST('dol_hide_topmenu') || ! empty($_SESSION['dol_hide_topmenu']))                 $conf->dol_hide_topmenu=1;
+if (GETPOST('dol_optimize_smallscreen') || ! empty($_SESSION['dol_optimize_smallscreen'])) $conf->dol_optimize_smallscreen=1;
+if (GETPOST('dol_no_mouse_hover') || ! empty($_SESSION['dol_no_mouse_hover']))             $conf->dol_no_mouse_hover=1;
+if (GETPOST('dol_use_jmobile') || ! empty($_SESSION['dol_use_jmobile']))                   $conf->dol_use_jmobile=1;
+if (! empty($conf->browser->phone))
+{
+	$conf->dol_optimize_smallscreen=1;
+	$conf->dol_no_mouse_hover=1;
 }
 
 if (! defined('NOREQUIRETRAN'))
@@ -673,20 +699,8 @@ if (! defined('NOREQUIRETRAN'))
             }
         }
     }
-/*    else	// If language was forced on URL
-    {
-        $langs->setDefaultLang(GETPOST('lang','alpha',1));
-    }*/
 }
 
-// Case forcing style from url
-if (GETPOST('theme'))
-{
-    $conf->theme=GETPOST('theme','alpha',1);
-    $conf->css  = "/theme/".$conf->theme."/style.css.php";
-}
-
-
 if (! defined('NOLOGIN'))
 {
     // If the login is not recovered, it is identified with an account that does not exist.
@@ -775,16 +789,14 @@ if (! defined('NOREQUIREMENU'))
 	if (empty($user->societe_id))    // If internal user or not defined
 	{
 		$conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
-		$conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
 	}
 	else                        // If external user
 	{
 		$conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
-		$conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
 	}
 
 	// Load the menu manager (only if not already done)
-	$file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu;
+	$file_menu=$conf->standard_menu;
 	if (GETPOST('menu')) $file_menu=GETPOST('menu');     // example: menu=eldy_menu.php
 	if (! class_exists('MenuManager'))
 	{
@@ -947,7 +959,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
             	print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/timepicker/jquery-ui-timepicker-addon.css" />'."\n";
             }
             // jQuery jMobile
-            if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('jmobile'))
+            if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))
             {
             	print '<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css" />'."\n";
             }
@@ -971,8 +983,11 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
         }
         $themeparam='?lang='.$langs->defaultlang.'&amp;theme='.$conf->theme.(GETPOST('optioncss')?'&amp;optioncss='.GETPOST('optioncss','alpha',1):'').'&amp;userid='.$user->id.'&amp;entity='.$conf->entity;
         if (! empty($_SESSION['dol_resetcache'])) $themeparam.='&amp;dol_resetcache='.$_SESSION['dol_resetcache'];
-        if (GETPOST('dol_hide_topmenu'))  $themeparam.='&amp;dol_hide_topmenu=1';
-        if (GETPOST('dol_hide_leftmenu')) $themeparam.='&amp;dol_hide_leftmenu=1';
+        if (GETPOST('dol_hide_topmenu'))           $themeparam.='&amp;dol_hide_topmenu=1';
+        if (GETPOST('dol_hide_leftmenu'))          $themeparam.='&amp;dol_hide_leftmenu=1';
+        if (GETPOST('dol_optimize_smallscreen'))   $themeparam.='&amp;dol_optimize_smallscreen=1';
+        if (GETPOST('dol_no_mouse_hover'))         $themeparam.='&amp;dol_no_mouse_hover=1';
+        if (GETPOST('dol_use_jmobile'))            $themeparam.='&amp;dol_use_jmobile=1';
         //print 'themepath='.$themepath.' themeparam='.$themeparam;exit;
         print '<link rel="stylesheet" type="text/css" title="default" href="'.$themepath.$themeparam.'">'."\n";
 
@@ -1112,7 +1127,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
             	print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/core/js/timepicker.js.php?lang='.$langs->defaultlang.'"></script>'."\n";
             }
             // jQuery jMobile
-            if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || GETPOST('jmobile'))
+            if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile))
             {
             	print '<script type="text/javascript" src="'.DOL_URL_ROOT.'/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js"></script>'."\n";
             }
@@ -1247,7 +1262,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a
 						//togglerLength_open: 0,
 						//	effect defaults - overridden on some panes
 						//slideTrigger_open:	"mouseover",
-						initClosed:	'.(empty($conf->browser->phone)?'false':'true').',
+						initClosed:	'.(empty($conf->dol_optimize_smallscreen)?'false':'true').',
 						fxName:	"drop",
 						fxSpeed: "fast",
 						fxSettings: { easing: "" }
@@ -1630,21 +1645,6 @@ function main_area($title='')
     print "\n";
 
     print '<div class="fiche"> <!-- begin div class="fiche" -->'."\n";
-    if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
-    {
-        print '<div data-role="page"> <!-- begin div data-role="page" -->';
-
-        print '<div data-role="header" data-nobackbtn="false" data-theme="b">';
-        print '<div id="dol-homeheader">'."\n";
-        $appli='Dolibarr';
-        if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $appli=$conf->global->MAIN_APPLICATION_TITLE;
-        print $appli;
-        print '</div>'."\n";
-        print '</div>'."\n";
-        print "\n";
-
-        print '<div data-role="content"> <!-- begin div data-role="content" -->'."\n";
-    }
     if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) print info_admin($langs->trans("WarningYouAreInMaintenanceMode",$conf->global->MAIN_ONLY_LOGIN_ALLOWED));
 }
 
@@ -1762,11 +1762,6 @@ if (! function_exists("llxFooter"))
         }
 
         print "\n\n";
-        if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
-        {
-            print '</div> <!-- end div data-role="content" -->'."\n";
-            print '</div> <!-- end div data-role="page" -->'."\n";
-        }
         print '</div> <!-- end div class="fiche" -->'."\n";
 
 
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 17892d4631d4ee42bf268d13ab7cc92abc142495..cb4ade0e46e3a433ffa224d4a4f53d012a134f61 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -171,7 +171,7 @@ if (empty($reshook))
 
         // Fill array 'array_options' with data from add form
         $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
-        
+
         if (GETPOST('deletephoto')) $object->logo = '';
         else if (! empty($_FILES['photo']['name'])) $object->logo = dol_sanitizeFileName($_FILES['photo']['name']);
 
@@ -223,7 +223,7 @@ if (empty($reshook))
 				}
 
 				$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
-	
+
 				if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
 				{
 					$langs->load("errors");
@@ -1309,12 +1309,12 @@ else
                     print "}\n";
                     print '</script>';
                     print "\n";
-                    $s.='<a href="#" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
+                    $s.='<a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT(document.formsoc.tva_intra.value);">'.$langs->trans("VATIntraCheck").'</a>';
                     $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
                 }
                 else
                 {
-                    $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
+                    $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$object->country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
                 }
             }
             print $s;
@@ -1368,7 +1368,7 @@ else
             print '</td></tr>';
 
             // Capital
-            print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$object->capital.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
+            print '<tr><td>'.$langs->trans("Capital").'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$object->capital.'"> <font class="hideonsmartphone">'.$langs->trans("Currency".$conf->currency).'</font></td></tr>';
 
             // Default language
             if (! empty($conf->global->MAIN_MULTILANGS))
@@ -1378,6 +1378,7 @@ else
                 print '</td>';
                 print '</tr>';
             }
+
             // Other attributes
             $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
             $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);    // Note that $action and $object may have been modified by hook
@@ -1385,8 +1386,9 @@ else
             {
             	print $object->showOptionals($extrafields,'edit');
             }
+
             // Logo
-            print '<tr>';
+            print '<tr class="hideonsmartphone">';
             print '<td>'.$langs->trans("Logo").'</td>';
             print '<td colspan="3">';
             if ($object->logo) print $form->showphoto('societe',$object,50);
@@ -1618,12 +1620,12 @@ else
                     print "}\n";
                     print '</script>';
                     print "\n";
-                    $s.='<a href="#" onclick="javascript: CheckVAT( $(\'#tva_intra\').val() );">'.$langs->trans("VATIntraCheck").'</a>';
+                    $s.='<a href="#" class="hideonsmartphone" onclick="javascript: CheckVAT( $(\'#tva_intra\').val() );">'.$langs->trans("VATIntraCheck").'</a>';
                     $s = $form->textwithpicto($s,$langs->trans("VATIntraCheckDesc",$langs->trans("VATIntraCheck")),1);
                 }
                 else
                 {
-                    $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$object->country_id).'" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
+                    $s.='<a href="'.$langs->transcountry("VATIntraCheckURL",$object->country_id).'" class="hideonsmartphone" target="_blank">'.img_picto($langs->trans("VATIntraCheckableOnEUSite"),'help').'</a>';
                 }
             }
             print $s;
diff --git a/htdocs/theme/amarok/style.css.php b/htdocs/theme/amarok/style.css.php
index 48fa2c8f5a3c0409e66ca5b2f233bee7eb185a48..9b3ac0f4f15c5da065fda9410b032b7a165c24dc 100755
--- a/htdocs/theme/amarok/style.css.php
+++ b/htdocs/theme/amarok/style.css.php
@@ -56,8 +56,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme');  // If theme was forced on
 $langs->load("main",0,1);
 $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
 $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
-$fontsize=empty($conf->browser->phone)?'12':'12';
-$fontsizesmaller=empty($conf->browser->phone)?'11':'11';
+$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12';
+$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11';
 
 $path='';    		// This value may be used in future for external module to overwrite theme
 $theme='amarok';	// Value of theme
@@ -180,6 +180,14 @@ form {
     padding:0px;
     margin:0px;
 }
+div.float
+{
+    float:<?php print $left; ?>;
+}
+div.floatright
+{
+    float:<?php print $right; ?>;
+}
 
 .valignmiddle {
 	vertical-align: middle;
@@ -584,7 +592,7 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print
  *  RESIZER-BARS
  */
 .ui-layout-resizer  { /* all 'resizer-bars' */
-	width: <?php echo (empty($conf->browser->phone)?'8':'24'); ?>px !important;
+	width: <?php echo (empty($conf->dol_optimize_smallscreen)?'8':'24'); ?>px !important;
 }
 .ui-layout-resizer-hover    {   /* affects both open and closed states */
 }
@@ -593,7 +601,7 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print
 /*.ui-layout-resizer-open-hover ,*/ /* hover-color to 'resize' */
 .ui-layout-resizer-dragging {   /* resizer beging 'dragging' */
     background: #DDD;
-    width: <?php echo (empty($conf->browser->phone)?'8':'24'); ?>px;
+    width: <?php echo (empty($conf->dol_optimize_smallscreen)?'8':'24'); ?>px;
 }
 .ui-layout-resizer-dragging {   /* CLONED resizer being dragged */
     border-left:  1px solid #BBB;
@@ -629,7 +637,7 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print
  *  TOGGLER-BUTTONS
  */
 .ui-layout-toggler {
-    <?php if (empty($conf->browser->phone)) { ?>
+    <?php if (empty($conf->dol_optimize_smallscreen)) { ?>
     border-top: 1px solid #AAA; /* match pane-border */
     border-right: 1px solid #AAA; /* match pane-border */
     border-bottom: 1px solid #AAA; /* match pane-border */
@@ -641,14 +649,14 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print
 }
 .ui-layout-toggler-open {
 	height: 54px !important;
-	width: <?php echo (empty($conf->browser->phone)?'7':'22'); ?>px !important;
+	width: <?php echo (empty($conf->dol_optimize_smallscreen)?'7':'22'); ?>px !important;
     -moz-border-radius:0px 10px 10px 0px;
 	-webkit-border-radius:0px 10px 10px 0px;
 	border-radius:0px 10px 10px 0px;
 }
 .ui-layout-toggler-closed {
-	height: <?php echo (empty($conf->browser->phone)?'54':'2'); ?>px !important;
-	width: <?php echo (empty($conf->browser->phone)?'7':'22'); ?>px !important;
+	height: <?php echo (empty($conf->dol_optimize_smallscreen)?'54':'2'); ?>px !important;
+	width: <?php echo (empty($conf->dol_optimize_smallscreen)?'7':'22'); ?>px !important;
     -moz-border-radius:0px 10px 10px 0px;
 	-webkit-border-radius:0px 10px 10px 0px;
 	border-radius:0px 10px 10px 0px;
@@ -667,7 +675,7 @@ a.help:link, a.help:visited, a.help:hover, a.help:active { font-size:<?php print
 }
 
 .ui-layout-north {
-	height: <?php print (empty($conf->browser->phone)?'54':'21'); ?>px !important;
+	height: <?php print (empty($conf->dol_optimize_smallscreen)?'54':'21'); ?>px !important;
 }
 
 
@@ -816,8 +824,8 @@ td.vmenu {
 
 div.fiche {
 	padding:8px 6px 10px;
-	margin-<?php print $left; ?>: <?php print (empty($conf->browser->phone) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'16':'24'; ?>px;
-	margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'12':'6'; ?>px;
+	margin-<?php print $left; ?>: <?php print (empty($conf->dol_optimize_smallscreen) || empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?'16':'24'; ?>px;
+	margin-<?php print $right; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'12':'6'; ?>px;
 }
 
 div.fichecenter {
@@ -825,25 +833,25 @@ div.fichecenter {
 	clear: both;	/* This is to have div fichecenter that are true rectangles */
 }
 div.fichethirdleft {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 35%;\n"; } ?>
-	<?php if (! empty($conf->browser->phone)) { print "padding-bottom: 6px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 35%;\n"; } ?>
+	<?php if (! empty($conf->dol_optimize_smallscreen)) { print "padding-bottom: 6px;\n"; } ?>
 }
 div.fichetwothirdright {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 65%;\n"; } ?>
-	<?php if (! empty($conf->browser->phone)) { print "padding-bottom: 6px\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 65%;\n"; } ?>
+	<?php if (! empty($conf->dol_optimize_smallscreen)) { print "padding-bottom: 6px\n"; } ?>
 }
 div.fichehalfleft {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 50%;\n"; } ?>
 }
 div.fichehalfright {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 50%;\n"; } ?>
 }
 div.ficheaddleft {
-	<?php if (empty($conf->browser->phone))   { print "padding-left: 16px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "padding-left: 16px;\n"; } ?>
 }
 
 
@@ -852,7 +860,8 @@ div.ficheaddleft {
 /* Boutons actions                                                                */
 /* ============================================================================== */
 
-/* boutons : */
+div.divbutaction { margin-bottom: 1.4em; }
+
 .button, .butAction {background: #999; border: solid 1px #888; font-weight: normal; }
 .butActionRefused {background: #eaeaea; color:rgba(0,0,0,0.6); font-weight: normal;}
 .butActionDelete {background: #b33c37; border:solid 1px #8d2f2b; font-weight: normal;}
diff --git a/htdocs/theme/auguria/style.css.php b/htdocs/theme/auguria/style.css.php
index 52bf676fca6d4a81a26fb636f6ecdef1180e3e82..59eef2450a8934ed51cbc0a4c7aaff06e2db805e 100644
--- a/htdocs/theme/auguria/style.css.php
+++ b/htdocs/theme/auguria/style.css.php
@@ -53,8 +53,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme');  // If theme was forced on
 $langs->load("main",0,1);
 $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
 $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
-$fontsize=empty($conf->browser->phone)?'12':'12';
-$fontsizesmaller=empty($conf->browser->phone)?'11':'11';
+$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12';
+$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11';
 
 $path='';    		// This value may be used in future for external module to overwrite theme
 $theme='auguria';	// Value of theme
@@ -165,6 +165,10 @@ div.float
 {
     float:<?php print $left; ?>;
 }
+div.floatright
+{
+    float:<?php print $right; ?>;
+}
 
 .valignmiddle {
 	vertical-align: middle;
@@ -188,7 +192,7 @@ div.float
 /* ============================================================================== */
 
 .hideobject { display: none; }
-<?php if (! empty($conf->browser->phone)) { ?>
+<?php if (! empty($conf->dol_optimize_smallscreen)) { ?>
 .hideonsmartphone { display: none; }
 <?php } ?>
 .linkobject { cursor: pointer; }
@@ -213,8 +217,8 @@ td.showDragHandle {
 /* ============================================================================== */
 
 div.fiche {
-	margin-<?php print $left; ?>: <?php print empty($conf->browser->phone)?'10':'2'; ?>px;
-	margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'8':''; ?>px;
+	margin-<?php print $left; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'10':'2'; ?>px;
+	margin-<?php print $right; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'8':''; ?>px;
 }
 
 div.fichecenter {
@@ -222,23 +226,23 @@ div.fichecenter {
 	clear: both;	/* This is to have div fichecenter that are true rectangles */
 }
 div.fichethirdleft {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 35%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 35%;\n"; } ?>
 }
 div.fichetwothirdright {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 65%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 65%;\n"; } ?>
 }
 div.fichehalfleft {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
 }
 div.fichehalfright {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
 }
 div.ficheaddleft {
-	<?php if (empty($conf->browser->phone)) { print "padding-left: 10px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "padding-left: 10px;\n"; } ?>
 }
 
 
@@ -247,7 +251,7 @@ div.ficheaddleft {
 /* ============================================================================== */
 
 <?php
-if (! empty($conf->browser->phone))
+if (! empty($conf->dol_optimize_smallscreen))
 {
 	$minwidthtmenu=70;
 	$heightmenu=39;
@@ -295,7 +299,7 @@ div.mainmenu {
 }
 */
 
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 
 /*
 div.mainmenu.home{
@@ -552,7 +556,7 @@ div#login_left, div#login_right {
 
 div.login {
 	white-space:nowrap;
-    padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+    padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
 	margin: 0px 0px 0px 8px;
 	font-weight: bold;
 }
@@ -565,7 +569,7 @@ div.login a:hover {
 }
 
 img.login, img.printer, img.entity {
-	padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+	padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
 	margin: 0px 0px 0px 8px;
 	text-decoration: none;
 	color: white;
@@ -675,7 +679,7 @@ div.blockvmenubookmarks
 
 div.blockvmenuhelp
 {
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 	text-align: center;
 	border-spacing: 0px;
     width: 162px;
@@ -894,7 +898,7 @@ img.toolbarbutton {
 }
 
 .ui-layout-north {
-	height: <?php print (empty($conf->browser->phone)?'42':'42'); ?>px !important;
+	height: <?php print (empty($conf->dol_optimize_smallscreen)?'42':'42'); ?>px !important;
 }
 
 /* ECM */
@@ -1105,6 +1109,8 @@ span.tabspan {
 /* Boutons actions                                                                */
 /* ============================================================================== */
 
+div.divbutaction { margin-bottom: 1.4em; }
+
 .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
 	font-family: <?php print $fontlist ?>;
 	font-weight: bold;
diff --git a/htdocs/theme/bureau2crea/style.css.php b/htdocs/theme/bureau2crea/style.css.php
index 9927b0d757a9b6951efe4c4fc5b516bcd4c173e0..546b1365e611687b3436688f3745092bacec01ee 100644
--- a/htdocs/theme/bureau2crea/style.css.php
+++ b/htdocs/theme/bureau2crea/style.css.php
@@ -54,8 +54,8 @@ if (GETPOST('theme')) $conf->theme=GETPOST('theme');  // If theme was forced on
 $langs->load("main",0,1);
 $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
 $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
-$fontsize=empty($conf->browser->phone)?'12':'12';
-$fontsizesmaller=empty($conf->browser->phone)?'11':'11';
+$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12';
+$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11';
 
 $fontlist='arial,tahoma,verdana,helvetica';
 //$fontlist='Verdana,Helvetica,Arial,sans-serif';
@@ -190,6 +190,14 @@ form {
     padding: 0em 0em 0em 0em;
     margin: 0em 0em 0em 0em;
 }
+div.float
+{
+    float:<?php print $left; ?>;
+}
+div.floatright
+{
+    float:<?php print $right; ?>;
+}
 
 .valignmiddle {
 	vertical-align: middle;
@@ -213,7 +221,7 @@ form {
 /* ============================================================================== */
 
 .hideobject { display: none; }
-<?php if (! empty($conf->browser->phone)) { ?>
+<?php if (! empty($conf->dol_optimize_smallscreen)) { ?>
 .hideonsmartphone { display: none; }
 <?php } ?>
 .linkobject { cursor: pointer; }
@@ -251,8 +259,8 @@ div.vmenu {
 }
 
 div.fiche {
-	margin-<?php print $left; ?>: <?php print empty($conf->browser->phone)?'10':'2'; ?>px;
-	margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'10':''; ?>px;
+	margin-<?php print $left; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'10':'2'; ?>px;
+	margin-<?php print $right; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'10':''; ?>px;
     padding: 0px;
     position: relative;
     height: auto;
@@ -263,23 +271,23 @@ div.fichecenter {
 	clear: both;	/* This is to have div fichecenter that are true rectangles */
 }
 div.fichethirdleft {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 35%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 35%;\n"; } ?>
 }
 div.fichetwothirdright {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 65%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 65%;\n"; } ?>
 }
 div.fichehalfleft {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
 }
 div.fichehalfright {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
 }
 div.ficheaddleft {
-	<?php if (empty($conf->browser->phone)) { print "padding-left: 6px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "padding-left: 6px;\n"; } ?>
 }
 
 
@@ -297,7 +305,7 @@ div.ficheaddleft {
 /* ============================================================================== */
 
 <?php
-if (! empty($conf->browser->phone))
+if (! empty($conf->dol_optimize_smallscreen))
 {
 	$minwidthtmenu=70;
 	$heightmenu=39;
@@ -341,7 +349,7 @@ div.mainmenu {
 }
 */
 
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 
 /*
 div.mainmenu.home{
@@ -600,7 +608,7 @@ div#login_left, div#login_right {
 
 div.login {
 	white-space:nowrap;
-	padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+	padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
 	margin: 0px 0px 0px 8px;
 	font-weight: bold;
 }
@@ -613,7 +621,7 @@ div.login a:hover {
 }
 
 img.login, img.printer, img.entity {
-	padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+	padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
 	margin: 0px 0px 0px 8px;
 	text-decoration: none;
 	color: white;
@@ -759,7 +767,7 @@ div.blockvmenubookmarks
 
 div.blockvmenuhelp
 {
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 	text-align: center;
 	border-spacing: 0px;
     width: 162px;
@@ -980,7 +988,7 @@ img.toolbarbutton {
 }
 
 .ui-layout-north {
-	height: <?php print (empty($conf->browser->phone)?'40':'40'); ?>px !important;
+	height: <?php print (empty($conf->dol_optimize_smallscreen)?'40':'40'); ?>px !important;
 }
 
 /* ECM */
@@ -1244,7 +1252,7 @@ span.tabspan {
 /* Boutons actions                                                                */
 /* ============================================================================== */
 
-/* Nouvelle syntaxe a utiliser */
+div.divbutaction { margin-bottom: 1.4em; }
 
 .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
 	font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;
diff --git a/htdocs/theme/bureau2crea/tpl/login.tpl.php b/htdocs/theme/bureau2crea/tpl/login.tpl.php
index 250c17fedc1b00fb71f289da77584e80a1b797af..05c6aab3cdbe1c2ce0320e52696c70c9fa368815 100644
--- a/htdocs/theme/bureau2crea/tpl/login.tpl.php
+++ b/htdocs/theme/bureau2crea/tpl/login.tpl.php
@@ -99,6 +99,9 @@ $(document).ready(function () {
 <input type="hidden" name="screenheight" id="screenheight" value="" />
 <input type="hidden" name="dol_hide_topmenu" id="dol_hide_topmenu" value="" />
 <input type="hidden" name="dol_hide_leftmenu" id="dol_hide_leftmenu" value="" />
+<input type="hidden" name="dol_optimize_smallscreen" id="dol_optimize_smallscreen" value="<?php echo $dol_optimize_smallscreen; ?>" />
+<input type="hidden" name="dol_no_mouse_hover" id="dol_no_mouse_over" value="<?php echo $dol_no_mouse_hover; ?>" />
+<input type="hidden" name="dol_use_jmobile" id="dol_use_jmobile" value="<?php echo $dol_use_jmobile; ?>" />
 
 <div id="infoVersion"><?php echo $title; ?></div>
 
diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php
index 876debfb9f2c0b9d82ee292c5e47f69feced8ae5..5f0956321d9b6bf8707e7f5566fd3b672f9ee986 100644
--- a/htdocs/theme/cameleo/style.css.php
+++ b/htdocs/theme/cameleo/style.css.php
@@ -54,8 +54,8 @@ if (! empty($_GET["theme"])) $conf->theme=$_GET["theme"];  // If theme was force
 $langs->load("main",0,1);
 $right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
 $left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
-$fontsize=empty($conf->browser->phone)?'12':'12';
-$fontsizesmaller=empty($conf->browser->phone)?'11':'11';
+$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'12';
+$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'11';
 
 $fontlist='arial,tahoma,verdana,helvetica';
 //$fontlist='Verdana,Helvetica,Arial,sans-serif';
@@ -170,6 +170,10 @@ div.float
 {
     float:<?php print $left; ?>;
 }
+div.floatright
+{
+    float:<?php print $right; ?>;
+}
 
 .valignmiddle {
 	vertical-align: middle;
@@ -193,7 +197,7 @@ div.float
 /* ============================================================================== */
 
 .hideobject { display: none; }
-<?php if (! empty($conf->browser->phone)) { ?>
+<?php if (! empty($conf->dol_optimize_smallscreen)) { ?>
 .hideonsmartphone { display: none; }
 <?php } ?>
 .linkobject { cursor: pointer; }
@@ -223,8 +227,8 @@ div.leftContent {
 }
 
 div.fiche {
-	margin-<?php print $left; ?>: <?php print empty($conf->browser->phone)?'5':'2'; ?>px;
-	margin-<?php print $right; ?>: <?php print empty($conf->browser->phone)?'5':''; ?>px;
+	margin-<?php print $left; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'5':'2'; ?>px;
+	margin-<?php print $right; ?>: <?php print empty($conf->dol_optimize_smallscreen)?'5':''; ?>px;
 }
 
 div.fichecenter {
@@ -232,23 +236,23 @@ div.fichecenter {
 	clear: both;	/* This is to have div fichecenter that are true rectangles */
 }
 div.fichethirdleft {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 35%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 35%;\n"; } ?>
 }
 div.fichetwothirdright {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 65%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 65%;\n"; } ?>
 }
 div.fichehalfleft {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
 }
 div.fichehalfright {
-	<?php if (empty($conf->browser->phone)) { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone)) { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "width: 50%;\n"; } ?>
 }
 div.ficheaddleft {
-	<?php if (empty($conf->browser->phone)) { print "padding-left: 6px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen)) { print "padding-left: 6px;\n"; } ?>
 }
 
 
@@ -257,7 +261,7 @@ div.ficheaddleft {
 /* ============================================================================== */
 
 <?php
-if (! empty($conf->browser->phone))
+if (! empty($conf->dol_optimize_smallscreen))
 {
 	$minwidthtmenu=0;
 	$heightmenu=19;
@@ -404,7 +408,7 @@ div.mainmenu {
 	margin-left: 0px;
 }
 
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 
 div.mainmenu.agenda {
 	background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/agenda.png',1); ?>);
@@ -608,7 +612,7 @@ div#login_left, div#login_right {
 
 div.login {
 	white-space:nowrap;
-    padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+    padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
     margin: 0px 0px 0px 8px;
 	font-weight: bold;
 }
@@ -621,7 +625,7 @@ div.login a:hover {
 }
 
 img.login, img.printer, img.entity {
-	padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+	padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
 	margin: 0px 0px 0px 8px;
 	text-decoration: none;
 	color: white;
@@ -781,7 +785,7 @@ div.blockvmenubookmarks
 
 div.blockvmenuhelp
 {
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 	text-align: center;
 	border-spacing: 0px;
     width: 162px;
@@ -1010,7 +1014,7 @@ img.toolbarbutton {
 }
 
 .ui-layout-north {
-	height: <?php print (empty($conf->browser->phone)?'54':'21'); ?>px !important;
+	height: <?php print (empty($conf->dol_optimize_smallscreen)?'54':'21'); ?>px !important;
 }
 
 /* ECM */
@@ -1213,7 +1217,7 @@ span.tabspan {
 /* Boutons actions                                                                */
 /* ============================================================================== */
 
-/* Nouvelle syntaxe a utiliser */
+div.divbutaction { margin-bottom: 1.4em; }
 
 .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionRefused, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
 	font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 91aaee2b1325b62aa6b71cc964fc23280488d923..7112399d3da0906e82b4da3d359ce4ec7e34c5de 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -67,8 +67,12 @@ if (! empty($conf->global->MAIN_OVERWRITE_THEME_RES)) { $path='/'.$conf->global-
 $fontlist='arial,tahoma,verdana,helvetica';    //$fontlist='Verdana,Helvetica,Arial,sans-serif';
 $img_head=dol_buildpath($path.'/theme/'.$theme.'/img/headbg2.jpg',1);
 $img_button=dol_buildpath($path.'/theme/'.$theme.'/img/button_bg.png',1);
-$dol_hide_topmenu=(! empty($_SESSION['dol_hide_topmenu']) || GETPOST('dol_hide_topmenu'));
-$dol_hide_leftmenu=(! empty($_SESSION['dol_hide_leftmenu']) || GETPOST('dol_hide_leftmenu'));
+$dol_hide_topmenu=$conf->dol_hide_topmenu;
+$dol_hide_leftmenu=$conf->dol_hide_leftmenu;
+$dol_optimize_smallscreen=$conf->dol_optimize_smallscreen;
+$dol_no_mouse_hover=$conf->dol_no_mouse_hover;
+$dol_use_jmobile=$conf->dol_use_jmobile;
+
 
 // Define reference colors
 // Example: Light grey: $colred=235;$colgreen=235;$colblue=235;
@@ -104,8 +108,8 @@ $colorbacklinepair2='255,255,255';    // line pair
 $colorbacklinepairhover=(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9)).','.(230+round(($isred+$isgreen+$isblue)/9));
 $colorbackbody='#ffffff url('.$img_head.') 0 0 no-repeat;';
 $colortext='40,40,40';
-$fontsize=empty($conf->browser->phone)?'12':'14';
-$fontsizesmaller=empty($conf->browser->phone)?'11':'14';
+$fontsize=empty($conf->dol_optimize_smallscreen)?'12':'14';
+$fontsizesmaller=empty($conf->dol_optimize_smallscreen)?'11':'14';
 
 // Eldy colors
 if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
@@ -171,7 +175,7 @@ else $colortextmain='101010';
 $usecss3=true;
 if ($conf->browser->name == 'ie' && round($conf->browser->version,2) < 10) $usecss3=false;
 elseif ($conf->browser->name == 'iceweasel') $usecss3=false;
-elseif ($conf->browser->name == 'epiphany') $usecss3=false;
+elseif ($conf->browser->name == 'epiphany')  $usecss3=false;
 
 print '/*'."\n";
 print 'colred='.$colred.' colgreen='.$colgreen.' colblue='.$colblue."\n";
@@ -183,8 +187,14 @@ print 'colorbacklinepair1='.$colorbacklinepair1."\n";
 print 'colorbacklinepair2='.$colorbacklinepair2."\n";
 print 'colorbacklinepairhover='.$colorbacklinepairhover."\n";
 print 'usecss3='.$usecss3."\n";
+print 'dol_hide_topmenu='.$dol_hide_topmenu."\n";
+print 'dol_hide_leftmenu='.$dol_hide_leftmenu."\n";
+print 'dol_optimize_smallscreen='.$dol_optimize_smallscreen."\n";
+print 'dol_no_mouse_hover='.$dol_no_mouse_hover."\n";
+print 'dol_use_jmobile='.$dol_use_jmobile."\n";
 print '*/'."\n";
 
+if (! empty($conf->dol_optimize_smallscreen)) $fontsize=11;
 ?>
 
 /* ============================================================================== */
@@ -192,7 +202,7 @@ print '*/'."\n";
 /* ============================================================================== */
 
 body {
-<?php if (GETPOST("optioncss") == 'print' || ! empty($conf->browser->phone)) {  ?>
+<?php if (GETPOST("optioncss") == 'print' || ! empty($conf->dol_optimize_smallscreen)) {  ?>
 	background-color: #FFFFFF;
 <?php } else { ?>
 	background: <?php print $colorbackbody; ?>;
@@ -301,6 +311,11 @@ div.float
 {
     float:<?php print $left; ?>;
 }
+div.floatright
+{
+    float:<?php print $right; ?>;
+}
+
 th .button {
     -moz-box-shadow: none !important;
     -webkit-box-shadow: none !important;
@@ -332,7 +347,7 @@ th .button {
 /* ============================================================================== */
 
 .hideobject { display: none; }
-<?php if (! empty($conf->browser->phone)) { ?>
+<?php if (! empty($conf->dol_optimize_smallscreen)) { ?>
 .hideonsmartphone { display: none; }
 <?php } ?>
 .linkobject { cursor: pointer; }
@@ -359,7 +374,7 @@ td.showDragHandle {
 
 div.fiche {
 	margin-<?php print $left; ?>: <?php print (GETPOST("optioncss") == 'print'?6:((empty($conf->global->MAIN_MENU_USE_JQUERY_LAYOUT))?($dol_hide_leftmenu?'4':'20'):'24')); ?>px;
-	margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->browser->phone)?'12':'6')); ?>px;
+	margin-<?php print $right; ?>: <?php print (GETPOST("optioncss") == 'print'?8:(empty($conf->dol_optimize_smallscreen)?'12':'6')); ?>px;
 }
 
 div.fichecenter {
@@ -367,25 +382,25 @@ div.fichecenter {
 	clear: both;	/* This is to have div fichecenter that are true rectangles */
 }
 div.fichethirdleft {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 35%;\n"; } ?>
-	<?php if (! empty($conf->browser->phone)) { print "padding-bottom: 6px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 35%;\n"; } ?>
+	<?php if (! empty($conf->dol_optimize_smallscreen)) { print "padding-bottom: 6px;\n"; } ?>
 }
 div.fichetwothirdright {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$right.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 65%;\n"; } ?>
-	<?php if (! empty($conf->browser->phone)) { print "padding-bottom: 6px\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$right.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 65%;\n"; } ?>
+	<?php if (! empty($conf->dol_optimize_smallscreen)) { print "padding-bottom: 6px\n"; } ?>
 }
 div.fichehalfleft {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$left.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$left.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 50%;\n"; } ?>
 }
 div.fichehalfright {
-	<?php if (empty($conf->browser->phone))   { print "float: ".$right.";\n"; } ?>
-	<?php if (empty($conf->browser->phone))   { print "width: 50%;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "float: ".$right.";\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "width: 50%;\n"; } ?>
 }
 div.ficheaddleft {
-	<?php if (empty($conf->browser->phone))   { print "padding-left: 16px;\n"; } ?>
+	<?php if (empty($conf->dol_optimize_smallscreen))   { print "padding-left: 16px;\n"; } ?>
 }
 
 
@@ -394,7 +409,7 @@ div.ficheaddleft {
 /* ============================================================================== */
 
 <?php
-if (! empty($conf->browser->phone))
+if (! empty($conf->dol_optimize_smallscreen))
 {
 	$minwidthtmenu=0;
 	$heightmenu=19;
@@ -565,7 +580,7 @@ div.mainmenu {
 	min-width: 40px;
 }
 
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
 
 div.mainmenu.home{
 	background-image: url(<?php echo dol_buildpath($path.'/theme/'.$theme.'/img/menus/home.png',1) ?>);
@@ -795,7 +810,7 @@ div.login_block table {
 
 div.login {
 	white-space:nowrap;
-	padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+	padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
     margin: 0px 0px 0px 8px;
 	font-weight: bold;
 }
@@ -808,7 +823,7 @@ div.login a:hover {
 }
 
 img.login, img.printer, img.entity {
-	padding: <?php echo ($conf->browser->phone?'0':'8')?>px 0px 0px 0px;
+	padding: <?php echo ($conf->dol_optimize_smallscreen?'0':'8')?>px 0px 0px 0px;
 	margin: 0px 0px 0px 8px;
 	text-decoration: none;
 	color: white;
@@ -953,7 +968,7 @@ div.blockvmenubookmarksold
 
 div.blockvmenuhelp
 {
-<?php if (empty($conf->browser->phone)) { ?>
+<?php if (empty($conf->dol_optimize_smallscreen)) { ?>
     width:174px;
 	font-family: <?php print $fontlist ?>;
 	color: #000000;
@@ -1089,7 +1104,7 @@ img.toolbarbutton {
  *  RESIZER-BARS
  */
 .ui-layout-resizer  { /* all 'resizer-bars' */
-	width: <?php echo (empty($conf->browser->phone)?'8':'24'); ?>px !important;
+	width: <?php echo (empty($conf->dol_optimize_smallscreen)?'8':'24'); ?>px !important;
 }
 .ui-layout-resizer-hover    {   /* affects both open and closed states */
 }
@@ -1098,7 +1113,7 @@ img.toolbarbutton {
 /*.ui-layout-resizer-open-hover ,*/ /* hover-color to 'resize' */
 .ui-layout-resizer-dragging {   /* resizer beging 'dragging' */
     background: #DDD;
-    width: <?php echo (empty($conf->browser->phone)?'8':'24'); ?>px;
+    width: <?php echo (empty($conf->dol_optimize_smallscreen)?'8':'24'); ?>px;
 }
 .ui-layout-resizer-dragging {   /* CLONED resizer being dragged */
     border-left:  1px solid #BBB;
@@ -1134,7 +1149,7 @@ img.toolbarbutton {
  *  TOGGLER-BUTTONS
  */
 .ui-layout-toggler {
-    <?php if (empty($conf->browser->phone)) { ?>
+    <?php if (empty($conf->dol_optimize_smallscreen)) { ?>
     border-top: 1px solid #AAA; /* match pane-border */
     border-right: 1px solid #AAA; /* match pane-border */
     border-bottom: 1px solid #AAA; /* match pane-border */
@@ -1146,14 +1161,14 @@ img.toolbarbutton {
 }
 .ui-layout-toggler-open {
 	height: 54px !important;
-	width: <?php echo (empty($conf->browser->phone)?'7':'22'); ?>px !important;
+	width: <?php echo (empty($conf->dol_optimize_smallscreen)?'7':'22'); ?>px !important;
     -moz-border-radius:0px 10px 10px 0px;
 	-webkit-border-radius:0px 10px 10px 0px;
 	border-radius:0px 10px 10px 0px;
 }
 .ui-layout-toggler-closed {
-	height: <?php echo (empty($conf->browser->phone)?'54':'2'); ?>px !important;
-	width: <?php echo (empty($conf->browser->phone)?'7':'22'); ?>px !important;
+	height: <?php echo (empty($conf->dol_optimize_smallscreen)?'54':'2'); ?>px !important;
+	width: <?php echo (empty($conf->dol_optimize_smallscreen)?'7':'22'); ?>px !important;
     -moz-border-radius:0px 10px 10px 0px;
 	-webkit-border-radius:0px 10px 10px 0px;
 	border-radius:0px 10px 10px 0px;
@@ -1172,7 +1187,7 @@ img.toolbarbutton {
 }
 
 .ui-layout-north {
-	height: <?php print (empty($conf->browser->phone)?'54':'21'); ?>px !important;
+	height: <?php print (empty($conf->dol_optimize_smallscreen)?'54':'21'); ?>px !important;
 }
 
 
@@ -1374,6 +1389,8 @@ span.tabspan {
 /* Boutons actions                                                                */
 /* ============================================================================== */
 
+div.divbutaction { margin-bottom: 1.4em; }
+
 .butAction, .butAction:link, .butAction:visited, .butAction:hover, .butAction:active, .butActionDelete, .butActionDelete:link, .butActionDelete:visited, .butActionDelete:hover, .butActionDelete:active {
 	font-family: <?php print $fontlist ?>;
 	font-weight: bold;
@@ -1382,8 +1399,8 @@ span.tabspan {
 	color: #434956;
 	text-decoration: none;
 	white-space: nowrap;
-	padding: 0.4em 0.7em;
-	margin: 0em 0.7em;
+	padding: 0.4em <?php echo ($dol_optimize_smallscreen?'0.4':'0.7'); ?>em;
+	margin: 0em <?php echo ($dol_optimize_smallscreen?'0.9':'0.7'); ?>em;
     -moz-border-radius:0px 5px 0px 5px;
 	-webkit-border-radius:0px 5px 0px 5px;
 	border-radius:0px 5px 0px 5px;
diff --git a/htdocs/user/logout.php b/htdocs/user/logout.php
index 7113d2a459aaa83cf3cfe99c4b047629572bc4a0..5e649badcd9bb74d8ccd5290cb6e8532a2a53515 100644
--- a/htdocs/user/logout.php
+++ b/htdocs/user/logout.php
@@ -61,8 +61,10 @@ $url=DOL_URL_ROOT."/index.php";		// By default go to login page
 if ($urlfrom) $url=DOL_URL_ROOT.$urlfrom;
 if (! empty($conf->global->MAIN_LOGOUT_GOTO_URL)) $url=$conf->global->MAIN_LOGOUT_GOTO_URL;
 
-if (GETPOST('dol_hide_topmenu'))  $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1';
-if (GETPOST('dol_hide_leftmenu')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1';
+if (GETPOST('dol_hide_topmenu'))         $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_topmenu=1';
+if (GETPOST('dol_hide_leftmenu'))        $url.=(preg_match('/\?/',$url)?'&':'?').'dol_hide_leftmenu=1';
+if (GETPOST('dol_optimize_smallscreen')) $url.=(preg_match('/\?/',$url)?'&':'?').'dol_optimize_smallscreen=1';
+if (GETPOST('dol_no_mouse_over'))        $url.=(preg_match('/\?/',$url)?'&':'?').'dol_no_mouse_over=1';
 
 // Destroy session
 $prefix=dol_getprefix();
diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php
index 61ac2f373fc4c63d12f78c1f5f7a007a815b3ec1..f2e00ef7c7e301c87615178122f34242d46d2214 100644
--- a/htdocs/user/passwordforgotten.php
+++ b/htdocs/user/passwordforgotten.php
@@ -153,20 +153,13 @@ $title='Dolibarr '.DOL_VERSION;
 if (! empty($conf->global->MAIN_APPLICATION_TITLE)) $title=$conf->global->MAIN_APPLICATION_TITLE;
 
 // Select templates
-if (preg_match('/^smartphone/',$conf->smart_menu) && ! empty($conf->browser->phone))
+if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php"))
 {
-    $template_dir = DOL_DOCUMENT_ROOT.'/theme/phones/smartphone/tpl/';
+    $template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/";
 }
 else
 {
-    if (file_exists(DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/passwordforgotten.tpl.php"))
-    {
-        $template_dir = DOL_DOCUMENT_ROOT."/theme/".$conf->theme."/tpl/";
-    }
-    else
-    {
-        $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
-    }
+    $template_dir = DOL_DOCUMENT_ROOT."/core/tpl/";
 }
 
 // Note: $conf->css looks like '/theme/eldy/style.css.php'