diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index 020dbc584749c3e26f6604d7b70cf155675838f7..852b051e3dd5b2f193ffe99d6ae37c97fe5953d9 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -209,6 +209,23 @@ class Adherent extends CommonObject
 
 		// Substitutions
 		$substitutionarray=array(
+				'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
+				'__ID__'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
+				'__CIVILITY__'=>$this->getCivilityLabel(),
+				'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
+				'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
+				'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
+				'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
+				'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
+				'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
+				'__TOWN_'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
+				'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
+				'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
+				'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
+				'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
+				'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
+				'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
+				// For backward compatibility
 				'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
 				'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
 				'%CIVILITY%'=>$this->getCivilityLabel(),
@@ -225,7 +242,6 @@ class Adherent extends CommonObject
 				'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
 				'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
 				'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
-				// For backward compatibility
 				'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
 				'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
 				'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
@@ -234,16 +250,10 @@ class Adherent extends CommonObject
 				'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
 				'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
 		);
-		// Add extrafields as substitution key %EXTRA_XXX%
-		foreach($this->array_options as $key => $val)
-		{
-			$keyshort=preg_replace('/^(options|extra)_/','',$key);
-			$substitutionarray['%EXTRA_'.$keyshort.'%']=$val;
-		}
 
-		complete_substitutions_array($substitutionarray, $langs);
+		complete_substitutions_array($substitutionarray, $langs, $this);
 
-		return make_substitutions($text,$substitutionarray);
+		return make_substitutions($text, $substitutionarray, $langs);
 	}
 
 
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index a6ca7871ae407f2796180ca0bb0bf65255d101be..3933f5d00abd26f00574f2e8a9c0fbfef2dbb14d 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -284,7 +284,7 @@ print load_fiche_titre($langs->trans("OrdersSetup"),$linkback,'title_setup');
 
 $head = order_admin_prepare_head();
 
-dol_fiche_head($head, 'general', $langs->trans("Orders"), 0, 'order');
+dol_fiche_head($head, 'general', $langs->trans("Orders"), -1, 'order');
 
 /*
  * Orders Numbering model
@@ -593,8 +593,14 @@ print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print "<input type=\"hidden\" name=\"action\" value=\"set_COMMANDE_DRAFT_WATERMARK\">";
 print '<tr class="oddeven"><td>';
-print $langs->trans("WatermarkOnDraftOrders").'</td><td>';
-print '<input size="50" class="flat" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">';
+$substitutionarray=pdf_getSubstitutionArray($langs);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
+foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
+$htmltext.='</i>';
+print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext);
+print '</td><td>';
+print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">';
 print '</td><td align="right">';
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print "</td></tr>\n";
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 4e9b007ee14d4e320b134670cff44aca46e79e3b..e7f74f85e5e6f59ff7afe169a5ed5e7f40d905f8 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -279,7 +279,7 @@ $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToM
 print load_fiche_titre($langs->trans("BillsSetup"),$linkback,'title_setup');
 
 $head = invoice_admin_prepare_head();
-dol_fiche_head($head, 'general', $langs->trans("Invoices"), 0, 'invoice');
+dol_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoice');
 
 /*
  *  Numbering module
@@ -760,7 +760,13 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
 print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />';
 print '<tr class="oddeven"><td>';
-print $langs->trans("WatermarkOnDraftBill").'</td>';
+$substitutionarray=pdf_getSubstitutionArray($langs);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
+foreach($substitutionarray as $key => $val)	$htmltext.=$key.'<br>';
+$htmltext.='</i>';
+print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext);
+print '</td>';
 print '<td><input size="50" class="flat" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
 print '</td><td align="right">';
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
diff --git a/htdocs/admin/order_extrafields.php b/htdocs/admin/order_extrafields.php
index 5d7358ae051f7ba6939c311109227b86616791d5..043d6bbadd932639ac996ea62d495b671cff8396 100644
--- a/htdocs/admin/order_extrafields.php
+++ b/htdocs/admin/order_extrafields.php
@@ -75,7 +75,7 @@ print "<br>\n";
 
 $head = order_admin_prepare_head();
 
-dol_fiche_head($head, 'attributes', $langs->trans("Orders"), 0, 'order');
+dol_fiche_head($head, 'attributes', $langs->trans("Orders"), -1, 'order');
 
 require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
 
diff --git a/htdocs/admin/orderdet_extrafields.php b/htdocs/admin/orderdet_extrafields.php
index f966af78bf369a5cbfdbbb50254733fd8a180dfd..5120fd5c9318d902381597cdf820d800fb2fe7d6 100644
--- a/htdocs/admin/orderdet_extrafields.php
+++ b/htdocs/admin/orderdet_extrafields.php
@@ -76,7 +76,7 @@ print "<br>\n";
 
 $head = order_admin_prepare_head();
 
-dol_fiche_head($head, 'attributeslines', $langs->trans("OrderLines"), 0, 'order');
+dol_fiche_head($head, 'attributeslines', $langs->trans("OrderLines"), -1, 'order');
 
 require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
 
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index bff56b4f7768c71bedcd4e0b2e02904f17abf225..76179fac66c47ef94329385b41b0a3e4bb40d992 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -248,16 +248,15 @@ else if ($action == 'setmod')
 
 
 /*
- * Affiche page
+ * View
  */
 
-$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
+$form=new Form($db);
 
+$dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
 
 llxHeader('',$langs->trans("PropalSetup"));
 
-$form=new Form($db);
-
 //if ($mesg) print $mesg;
 
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
@@ -265,7 +264,7 @@ print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup');
 
 $head = propal_admin_prepare_head();
 
-dol_fiche_head($head, 'general', $langs->trans("Proposals"), 0, 'propal');
+dol_fiche_head($head, 'general', $langs->trans("Proposals"), -1, 'propal');
 
 /*
  *  Module numerotation
@@ -534,11 +533,10 @@ print '<br>';
 
 /*
  * Other options
- *
  */
+
 print load_fiche_titre($langs->trans("OtherOptions"),'','');
 
-$var=true;
 print "<table class=\"noborder\" width=\"100%\">";
 print "<tr class=\"liste_titre\">";
 print "<td>".$langs->trans("Parameter")."</td>\n";
@@ -572,7 +570,6 @@ print "</td></tr>\n";
 print '</form>';
 */
 
-$var=! $var;
 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<input type="hidden" name="action" value="set_PROPOSAL_FREE_TEXT">';
@@ -599,8 +596,14 @@ print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print "<input type=\"hidden\" name=\"action\" value=\"set_PROPALE_DRAFT_WATERMARK\">";
 print '<tr class="oddeven"><td>';
-print $langs->trans("WatermarkOnDraftProposal").'</td><td>';
-print '<input size="50" class="flat" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.$conf->global->PROPALE_DRAFT_WATERMARK.'">';
+$substitutionarray=pdf_getSubstitutionArray($langs);
+$substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
+$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
+foreach($substitutionarray as $key => $val)	$htmltext.=$key.'<br>';
+$htmltext.='</i>';
+print $form->textwithpicto($langs->trans("WatermarkOnDraftProposal"), $htmltext);
+print '</td><td>';
+print '<input class="flat minwidth200" type="text" name="PROPALE_DRAFT_WATERMARK" value="'.$conf->global->PROPALE_DRAFT_WATERMARK.'">';
 print '</td><td align="right">';
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print "</td></tr>\n";
diff --git a/htdocs/comm/admin/propal_extrafields.php b/htdocs/comm/admin/propal_extrafields.php
index 784512d6d1e154c833534e1a4288edc4915b082c..8d2ecd88277a12f9cf204116269eafc9e05c0b2e 100644
--- a/htdocs/comm/admin/propal_extrafields.php
+++ b/htdocs/comm/admin/propal_extrafields.php
@@ -69,7 +69,7 @@ print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup');
 
 $head = propal_admin_prepare_head();
 
-dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), 0, 'propal');
+dol_fiche_head($head, 'attributes', $langs->trans("Proposals"), -1, 'propal');
 
 require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
 
diff --git a/htdocs/comm/admin/propaldet_extrafields.php b/htdocs/comm/admin/propaldet_extrafields.php
index 633c4fab581ac3435fbd277f532d82249a6fbe95..80f5afdaeed9d6854958081d4e79b230859d8288 100644
--- a/htdocs/comm/admin/propaldet_extrafields.php
+++ b/htdocs/comm/admin/propaldet_extrafields.php
@@ -76,7 +76,7 @@ print load_fiche_titre($langs->trans("PropalSetup"),$linkback,'title_setup');
 
 $head = propal_admin_prepare_head();
 
-dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), 0, 'propal');
+dol_fiche_head($head, 'attributeslines', $langs->trans("Proposals"), -1, 'propal');
 
 require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_view.tpl.php';
 
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 13ea930dc5e6ae410035dabfdf08cfeb47f860a1..7f22898a458eda454f2d2f750515e48244e272ad 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -57,6 +57,7 @@ $hookmanager->initHooks(array('mailingcard','globalcard'));
 
 // Array of possible substitutions (See also file mailing-send.php that should manage same substitutions)
 $object->substitutionarray=FormMail::getAvailableSubstitKey('emailing');
+$object->substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
 
 $object->substitutionarrayfortest=array(
     '__ID__' => 'TESTIdRecord',
@@ -72,7 +73,7 @@ $object->substitutionarrayfortest=array(
 	'__SIGNATURE__' => (($user->signature && empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))?$user->signature:''),
     '__CHECK_READ__' => 'TagCheckMail',
 	'__UNSUBSCRIBE__' => 'TagUnsubscribe'
-	//,'__PERSONALIZED__' => 'TESTPersonalized'	// Not used yet
+		//,'__PERSONALIZED__' => 'TESTPersonalized'	// Not used yet
 );
 
 // List of sending methods
@@ -237,7 +238,7 @@ if (empty($reshook))
 							if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
 							else $substitutionarray['__SECUREKEYPAYPAL_CONTRACTLINE__']=dol_hash($conf->global->PAYPAL_SECURITY_TOKEN . 'contractline' . $obj->source_id, 2);
 						}
-						$substitutionisok=true;
+						//$substitutionisok=true;
 	                    complete_substitutions_array($substitutionarray, $langs);
 						$newsubject=make_substitutions($subject,$substitutionarray);
 						$newmessage=make_substitutions($message,$substitutionarray);
@@ -266,11 +267,11 @@ if (empty($reshook))
 						{
 							$res=0;
 						}
-						if (! $substitutionisok)
+						/*if (! $substitutionisok)
 						{
 							$mail->error='Some substitution failed';
 							$res=0;
-						}
+						}*/
 
 						// Send mail
 						if ($res)
@@ -754,8 +755,6 @@ else
 
 		$head = emailing_prepare_head($object);
 
-		dol_fiche_head($head, 'card', $langs->trans("Mailing"), 0, 'email');
-
 		// Confirmation back to draft
 		if ($action == 'settodraft')
 		{
@@ -780,6 +779,8 @@ else
 
 		if ($action != 'edit')
 		{
+			dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email');
+
 			/*
 			 * Mailing en mode visu
 			 */
@@ -842,7 +843,8 @@ else
 			if ($object->statut == 2) $morehtmlright.=' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.') ';
 			
 			dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
-			
+
+			print '<div class="fichecenter">';
 			print '<div class="underbanner clearboth"></div>';
 			
 			print '<table class="border" width="100%">';
@@ -903,8 +905,10 @@ else
 			print '</table>';
 
 			print "</div>";
+			
+			dol_fiche_end();
 
-
+			
 			// Clone confirmation
 			if ($action == 'clone')
 			{
@@ -1106,7 +1110,9 @@ else
 			/*
 			 * Mailing en mode edition
 			 */
-
+			
+			dol_fiche_head($head, 'card', $langs->trans("Mailing"), -1, 'email');
+			
 			$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
 
 			$morehtmlright='';
@@ -1114,6 +1120,7 @@ else
 			
 			dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
 			
+			print '<div class="fichecenter">';
 			print '<div class="underbanner clearboth"></div>';
 
 			print '<table class="border" width="100%">';
@@ -1132,9 +1139,6 @@ else
 			// To
 			print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td colspan="3">'.dol_print_email($object->email_errorsto,0,0,0,0,1).'</td></tr>';
 
-			// Status
-			print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4).'</td></tr>';
-
 			// Nb of distinct emails
 			print '<tr><td>';
 			print $langs->trans("TotalNbOfDistinctRecipients");
@@ -1160,6 +1164,7 @@ else
 			}
 
 			print '</table>';
+			print '</div>';
 
 			dol_fiche_end();
 
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 16f3f4db561a2f9586eb6d11c36be1c13a7a8428..d3642c503939cffdb610c65d2ac4a83e98214fe4 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -177,7 +177,7 @@ if ($object->fetch($id) >= 0)
 {
 	$head = emailing_prepare_head($object);
 
-	dol_fiche_head($head, 'targets', $langs->trans("Mailing"), 0, 'email');
+	dol_fiche_head($head, 'targets', $langs->trans("Mailing"), -1, 'email');
 
 	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
 
@@ -186,16 +186,11 @@ if ($object->fetch($id) >= 0)
 	
 	dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'ref', '', '', 0, '', $morehtmlright);
 
-	
+	print '<div class="fichecenter">';
 	print '<div class="underbanner clearboth"></div>';
 	
 	print '<table class="border" width="100%">';
-/*
-	print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td>';
-	print '<td colspan="3">';
-	print $form->showrefnav($object,'id', $linkback);
-	print '</td></tr>';
-*/
+
 	print '<tr><td class="titlefield">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
 
 	print '<tr><td>'.$langs->trans("MailFrom").'</td><td colspan="3">'.dol_print_email($object->email_from,0,0,0,0,1).'</td></tr>';
@@ -204,11 +199,6 @@ if ($object->fetch($id) >= 0)
 	print '<tr><td>'.$langs->trans("MailErrorsTo").'</td><td colspan="3">'.dol_print_email($object->email_errorsto,0,0,0,0,1);
 	print '</td></tr>';
 
-	// Status
-/*	print '<tr><td>'.$langs->trans("Status").'</td><td colspan="3">'.$object->getLibStatut(4);
-	if ($object->statut == 2) print ' ('.$object->countNbOfTargets('alreadysent').'/'.$object->nbemail.')';
-	print '</td></tr>';
-*/
 	// Nb of distinct emails
 	print '<tr><td>';
 	print $langs->trans("TotalNbOfDistinctRecipients");
@@ -229,6 +219,7 @@ if ($object->fetch($id) >= 0)
 
 	print "</div>";
 
+	dol_fiche_end();
 	
 
 	$allowaddtarget=($object->statut == 0);
@@ -256,8 +247,8 @@ if ($object->fetch($id) >= 0)
 		
 		clearstatcache();
 
-		$var=true;
-
+		$var = true;
+		
 		foreach ($modulesdir as $dir)
 		{
 		    $modulenames=array();
@@ -316,7 +307,7 @@ if ($object->fetch($id) >= 0)
 
 					if ($allowaddtarget)
 					{
-						print '<form '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
+						print '<form aa '.$bctag[$var].' name="'.$modulename.'" action="'.$_SERVER['PHP_SELF'].'?action=add&id='.$object->id.'&module='.$modulename.'" method="POST" enctype="multipart/form-data">';
 						print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 					}
 					else
@@ -514,7 +505,6 @@ if ($object->fetch($id) >= 0)
 		print '</td>';
 		print '</tr>';
 
-		$var = true;
 		$i = 0;
 
 		if ($num)
@@ -523,8 +513,6 @@ if ($object->fetch($id) >= 0)
 			{
 				$obj = $db->fetch_object($resql);
 
-				
-
 				print '<tr class="oddeven">';
 				print '<td>'.$obj->email.'</td>';
 				print '<td>'.$obj->lastname.'</td>';
@@ -599,7 +587,7 @@ if ($object->fetch($id) >= 0)
 		{
 			if ($object->statut < 2) 
 			{
-			    print '<tr '.$bc[false].'><td colspan="8" class="opacitymedium">';
+			    print '<tr><td colspan="8" class="opacitymedium">';
     			print $langs->trans("NoTargetYet");
     			print '</td></tr>';
 			}
diff --git a/htdocs/comm/mailing/info.php b/htdocs/comm/mailing/info.php
index 5280fcfad59d21c183eae2cf107cc3a646c89b90..ddb0d4a8fc6a67e301c11a50a8745c444e827615 100644
--- a/htdocs/comm/mailing/info.php
+++ b/htdocs/comm/mailing/info.php
@@ -27,6 +27,8 @@ require_once DOL_DOCUMENT_ROOT .'/comm/mailing/class/mailing.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/emailing.lib.php';
 
+$id=GETPOST('id');
+
 $langs->load("mails");
 
 // Security check
@@ -45,11 +47,11 @@ $form = new Form($db);
 
 $object = new Mailing($db);
 
-if ($object->fetch($_REQUEST["id"]) >= 0)
+if ($object->fetch($id) >= 0)
 {
 	$head = emailing_prepare_head($object);
 
-	dol_fiche_head($head, 'info', $langs->trans("Mailing"), 0, 'email');
+	dol_fiche_head($head, 'info', $langs->trans("Mailing"), -1, 'email');
 
 	$linkback = '<a href="'.DOL_URL_ROOT.'/comm/mailing/list.php">'.$langs->trans("BackToList").'</a>';
 
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 5838bb9bcf39712523b9f83b94e368065ef0300e..4b9ced1c4c0f03d2f3333ad4affdc236a52b87aa 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -359,7 +359,6 @@ class Facture extends CommonInvoice
 			    '__INVOICE_NEXT_YEAR__' => dol_print_date(dol_time_plus_duree($this->date, 1, 'y'), '%Y'),
 			);
 			
-			$substitutionisok=true;
 			complete_substitutions_array($substitutionarray, $outputlangs);
 			
 			$this->note_public=make_substitutions($this->note_public,$substitutionarray);
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 392ba507036d76c3ca7c828b73d05322c6cbf03a..706807c8f0247e179f1e13a73170b24bbcc8ad9a 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -938,7 +938,8 @@ if ($action == 'create')
 		    '__INVOICE_YEAR__' =>  $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($object->date,'%Y').')',
 		    '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($object->date, 1, 'y'),'%Y').')'
 		);
-
+		$substitutionarray['__(TRANSKEY)__']=$langs->trans("TransKey");
+		
 		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
 		foreach($substitutionarray as $key => $val)
 		{
@@ -1241,7 +1242,8 @@ else
 		    '__INVOICE_YEAR__' =>  $langs->trans("PreviousYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date($dateexample,'%Y').')',
 		    '__INVOICE_NEXT_YEAR__' => $langs->trans("NextYearOfInvoice").' ('.$langs->trans("Example").': '.dol_print_date(dol_time_plus_duree($dateexample, 1, 'y'),'%Y').')'
 		);
-
+		$substitutionarray['__(TRANSKEY)__']=$langs->trans("TransKey");
+		
 		$htmltext = '<i>'.$langs->trans("FollowingConstantsWillBeSubstituted").':<br>';
 		foreach($substitutionarray as $key => $val)
 		{
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 87039a3d454b4bde5e59970ee83197c58ea8af54..d430a8ea53b46aacb94043a294f8fdfccd25abd3 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1025,11 +1025,15 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
 	if ($object->element == 'member')    $modulepart='memberphoto';
 	if ($object->element == 'user')      $modulepart='userphoto';
 	if ($object->element == 'product')   $modulepart='product';
-	if ($object->element == 'propal')    $modulepart='propal';
-	if ($object->element == 'commande')  $modulepart='commande';
-	if ($object->element == 'facture')   $modulepart='facture';
-	if ($object->element == 'fichinter') $modulepart='ficheinter';
-	
+	if (class_exists("Imagick"))
+	{
+		if ($object->element == 'propal')    $modulepart='propal';
+		if ($object->element == 'commande')  $modulepart='commande';
+		if ($object->element == 'facture')   $modulepart='facture';
+		if ($object->element == 'fichinter') $modulepart='ficheinter';
+		if ($object->element == 'contrat')   $modulepart='contract';
+	}
+
 	if ($object->element == 'product')
 	{
 	    $width=80; $cssclass='photoref';
@@ -1051,14 +1055,14 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
 	}
 	else
 	{
-        if ($showimage)
+		if ($showimage)
         {
-            if ($modulepart != 'unknown')
+        	if ($modulepart != 'unknown')
             {
                 $phototoshow='';
                 
                 // Check if a preview file is available
-                if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter')) && class_exists("Imagick"))
+                if (in_array($modulepart, array('propal', 'commande', 'facture', 'ficheinter', 'contract')) && class_exists("Imagick"))
                 {
                     $objectref = dol_sanitizeFileName($object->ref);
                     $dir_output = $conf->$modulepart->dir_output . "/";
@@ -1083,7 +1087,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
                             $ret = dol_convert_file($file, 'png', $fileimage);
                             if ($ret < 0) $error++;
                         }
-    
+
                         // Si fichier png PDF d'1 page trouve
                         if (file_exists($fileimage))
                         {
@@ -4865,45 +4869,77 @@ function dol_concatdesc($text1,$text2,$forxml=false)
 /**
  *  Make substition into a string replacing key with vals from $substitutionarray (oldval=>newval)
  *
- *  @param	string	$chaine      			Source string in which we must do substitution
- *  @param  array	$substitutionarray		Array with key->val to substitute
- * 	@return string  		    			Output string after subsitutions
+ *  @param	string		$text	      			Source string in which we must do substitution
+ *  @param  array		$substitutionarray		Array with key->val to substitute
+ *  @param	Translate	$outputlangs			Output language
+ * 	@return string  		    				Output string after substitutions
  *  @see	complete_substitutions_array
  */
-function make_substitutions($chaine,$substitutionarray)
+function make_substitutions($text, $substitutionarray, $outputlangs=null)
 {
-	global $conf;
+	global $conf, $langs;
 
 	if (! is_array($substitutionarray)) return 'ErrorBadParameterSubstitutionArrayWhenCalling_make_substitutions';
-
-	// Make substitition
+	
+	if (empty($outputlangs)) $outputlangs=$langs;
+	
+	// Make substitution for language keys
+	if (is_object($outputlangs))
+	{
+		while (preg_match('/__\((.*)\)__/', $text, $reg))
+		{
+			$msgishtml = 0;
+			if (dol_textishtml($text,1)) $msgishtml = 1;
+			$text = preg_replace('/__\('.preg_quote($reg[1]).'\)__/', $msgishtml?dol_htmlentitiesbr($outputlangs->transnoentitiesnoconv($reg[1])):$outputlangs->transnoentitiesnoconv($reg[1]), $text);	
+		}
+	}
+		
+	// Make substitition for array $substitutionarray
 	foreach ($substitutionarray as $key => $value)
 	{
 		if ($key == '__SIGNATURE__' && (! empty($conf->global->MAIN_MAIL_DO_NOT_USE_SIGN))) $value='';
-		$chaine=str_replace("$key","$value",$chaine);	// We must keep the " to work when value is 123.5 for example
+		$text=str_replace("$key","$value",$text);	// We must keep the " to work when value is 123.5 for example
 	}
 
-	return $chaine;
+	return $text;
 }
 
 /**
  *  Complete the $substitutionarray with more entries
  *
  *  @param  array		$substitutionarray		Array substitution old value => new value value
- *  @param  Translate	$outputlangs            If we want substitution from special constants, we provide a language
- *  @param  object		$object                 If we want substitution from special constants, we provide data in a source object
- *  @param  Mixed		$parameters       		Add more parameters (useful to pass product lines)
+ *  @param  Translate	$outputlangs            Output language
+ *  @param  Object		$object                 Source object
+ *  @param  mixed		$parameters       		Add more parameters (useful to pass product lines)
  *  @param  string      $callfunc               What is the name of the custom function that will be called? (default: completesubstitutionarray)
  *  @return	void
  *  @see 	make_substitutions
  */
-function complete_substitutions_array(&$substitutionarray,$outputlangs,$object='',$parameters=null,$callfunc="completesubstitutionarray")
+function complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
 {
 	global $conf,$user;
 
 	require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
 
-	// Check if there is external substitution to do asked by plugins
+	// Add a substitution key for each object property
+	if (is_object($object))
+	{
+		// TODO
+	}
+	
+	// Add a substitution key for each extrafields, using key __EXTRA_XXX__
+	if (is_object($object) && is_array($object->array_options))
+	{
+		foreach($object->array_options as $key => $val)
+		{
+			$keyshort=preg_replace('/^(options|extra)_/','',$key);
+			$substitutionarray['__EXTRA_'.$keyshort.'__']=$val;
+			// For backward compatibiliy
+			$substitutionarray['%EXTRA_'.$keyshort.'%']=$val;
+		}
+	}
+	
+	// Check if there is external substitution to do, requested by plugins
 	$dirsubstitutions=array_merge(array(),(array) $conf->modules_parts['substitutions']);
 
 	foreach($dirsubstitutions as $reldir)
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 6855cef5f1ada41256e0e4fe9a134c39e5c37da0..282bdec690e0ffb53bf0945c824a154dddc19194 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -586,6 +586,29 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
 	}
 }
 
+
+/**
+ *   	Return array of possible substitutions
+ *
+ *		@param	Translate	$outputlangs	Output language
+ *      @return	array						Array of substitutions
+ */
+function pdf_getSubstitutionArray($outputlangs)
+{
+	global $conf, $mysoc, $user;
+	$substitutionarray=array(
+		'__MYCOMPANY_NAME__' => $mysoc->name,
+		'__MYCOMPANY_EMAIL__' => $mysoc->email,
+		'__USER_ID__' => $user->id,
+		'__USER_LOGIN__' => $user->login,
+		'__USER_LASTNAME__' => $user->lastname,
+		'__USER_FIRSTNAME__' => $user->firstname,
+		'__USER_FULLNAME__' => $user->getFullName($outputlangs)
+	);
+	return $substitutionarray;
+}
+
+
 /**
  *      Add a draft watermark on PDF files
  *
@@ -599,12 +622,20 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
  */
 function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
 {
+	global $langs, $mysoc, $user;
+	
 	// Print Draft Watermark
 	if ($unit=='pt') $k=1;
 	elseif ($unit=='mm') $k=72/25.4;
 	elseif ($unit=='cm') $k=72/2.54;
 	elseif ($unit=='in') $k=72;
 
+	// Make substitution
+	$substitutionarray=pdf_getSubstitutionArray($outputlangs);
+	complete_substitutions_array($substitutionarray,$outputlangs,$object);
+	$text=make_substitutions($text,$substitutionarray,$outputlangs);
+	$text=$outputlangs->convToOutputCharset($text);
+	
 	$savx=$pdf->getX(); $savy=$pdf->getY();
 
 	$watermark_angle=atan($h/$w)/2;
@@ -819,7 +850,7 @@ function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default
  */
 function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0,$hidefreetext=0)
 {
-	global $conf,$user;
+	global $conf,$user,$mysoc;
 
 	$outputlangs->load("dict");
 	$line='';
@@ -829,16 +860,15 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
 	// Line of free text
 	if (empty($hidefreetext) && ! empty($conf->global->$paramfreetext))
 	{
-		// Make substitution
-		$substitutionarray=array(
-			'__FROM_NAME__' => $fromcompany->name,
-			'__FROM_EMAIL__' => $fromcompany->email,
-			'__TOTAL_TTC__' => $object->total_ttc,
-			'__TOTAL_HT__' => $object->total_ht,
-			'__TOTAL_VAT__' => $object->total_vat
-		);
+		$substitutionarray=pdf_getSubstitutionArray($outputlangs);
+		// More substitution keys
+		$substitutionarray['__FROM_NAME__']=$fromcompany->name;
+		$substitutionarray['__FROM_EMAIL__']=$fromcompany->email;
+		$substitutionarray['__TOTAL_TTC__']=$object->total_ttc;
+		$substitutionarray['__TOTAL_HT__']=$object->total_ht;
+		$substitutionarray['__TOTAL_VAT__']=$object->total_vat;
 		complete_substitutions_array($substitutionarray,$outputlangs,$object);
-		$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray);
+		$newfreetext=make_substitutions($conf->global->$paramfreetext,$substitutionarray,$outputlangs);
 		$line.=$outputlangs->convToOutputCharset($newfreetext);
 	}
 
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 9ee00df696e4bd6f3bc8269dea108839181870b6..693dd2e412f328c8c36f5de314ca913e1a6067eb 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -1499,7 +1499,7 @@ class pdf_crabe extends ModelePDFFactures
 		pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
 
 		// Show Draft Watermark
-		if($object->statut==0 && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
+		if($object->statut==Facture::STATUS_DRAFT && (! empty($conf->global->FACTURE_DRAFT_WATERMARK)) )
         {
 		      pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->FACTURE_DRAFT_WATERMARK);
         }
@@ -1553,7 +1553,13 @@ class pdf_crabe extends ModelePDFFactures
 		$posy+=5;
 		$pdf->SetXY($posx,$posy);
 		$pdf->SetTextColor(0,0,60);
-		$pdf->MultiCell($w, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
+		$textref=$outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref);
+		if ($object->statut == Facture::STATUS_DRAFT) 
+		{
+			$pdf->SetTextColor(128,0,0);
+			$textref.=' - '.$outputlangs->trans("NotValidated");
+		}
+		$pdf->MultiCell($w, 4, $textref, '', 'R');
 
 		$posy+=1;
 		$pdf->SetFont('','', $default_font_size - 2);
diff --git a/htdocs/core/modules/modCommande.class.php b/htdocs/core/modules/modCommande.class.php
index 810bc7f3364a7a61a153c7b657305ab74c815fc2..f9c10eef6de0bd25584b3fe9a3df88a4539b35e4 100644
--- a/htdocs/core/modules/modCommande.class.php
+++ b/htdocs/core/modules/modCommande.class.php
@@ -98,6 +98,13 @@ class modCommande extends DolibarrModules
 		$this->const[$r][3] = "";
 		$this->const[$r][4] = 0;
 
+		/*$r++;
+		$this->const[$r][0] = "COMMANDE_DRAFT_WATERMARK";
+		$this->const[$r][1] = "chaine";
+		$this->const[$r][2] = "__(Draft)__";
+		$this->const[$r][3] = 'Watermark to show on draft orders';
+		$this->const[$r][4] = 0;*/
+		
 		// Boxes
 		$this->boxes = array(
 			0=>array('file'=>'box_commandes.php','enabledbydefaulton'=>'Home'),
diff --git a/htdocs/core/modules/modFacture.class.php b/htdocs/core/modules/modFacture.class.php
index 8022b21279f9317332d83d7e41aa414ec9bbf97a..148dd965abbb2f18a02de9ae3c0580b66eca161a 100644
--- a/htdocs/core/modules/modFacture.class.php
+++ b/htdocs/core/modules/modFacture.class.php
@@ -100,6 +100,13 @@ class modFacture extends DolibarrModules
 		$this->const[$r][4] = 0;
 		$r++;
 		
+		/*$this->const[$r][0] = "FACTURE_DRAFT_WATERMARK";
+		$this->const[$r][1] = "chaine";
+		$this->const[$r][2] = "__(Draft)__";
+		$this->const[$r][3] = 'Watermark to show on draft invoices';
+		$this->const[$r][4] = 0;
+		$r++;*/
+
 		
 		// Boxes
 		//$this->boxes = array(0=>array(1=>'box_factures_imp.php'),1=>array(1=>'box_factures.php'));
diff --git a/htdocs/core/modules/modPropale.class.php b/htdocs/core/modules/modPropale.class.php
index fe520e00925f40e13964de68a02b13fe8d71683c..ce23e996e0a4030a028d2958516e6e537c78ba57 100644
--- a/htdocs/core/modules/modPropale.class.php
+++ b/htdocs/core/modules/modPropale.class.php
@@ -100,7 +100,14 @@ class modPropale extends DolibarrModules
 		$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/proposals";
 		$this->const[$r][3] = "";
 		$this->const[$r][4] = 0;
-
+		$r++;
+		
+		/*$this->const[$r][0] = "PROPALE_DRAFT_WATERMARK";
+		$this->const[$r][2] = "__(Draft)__";
+		$this->const[$r][3] = 'Watermark to show on draft proposals';
+		$this->const[$r][4] = 0;
+		$r++;*/
+				
 		// Boxes
 		$this->boxes = array(
            	0=>array('file'=>'box_graph_propales_permonth.php','enabledbydefaulton'=>'Home'),
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 73c34f7101e85e05160dbc462c207acb3b7ece87..71788071a2de2cef5bb8f3143e21e7f435ebf4b3 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -153,6 +153,7 @@ Edit=Edit
 Validate=Validate
 ValidateAndApprove=Validate and Approve
 ToValidate=To validate
+NotValidated=Not validated
 Save=Save
 SaveAs=Save As
 TestConnection=Test connection
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index f5acdeac02bcf9fa8e9baa77fbce4332b9b43e1a..72a5f39e02c9e79096d99c07eb8660ca764b43b9 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -849,7 +849,7 @@ if (! defined('NOREQUIRETRAN'))
 $bc=array(0=>'class="impair"',1=>'class="pair"');
 $bcdd=array(0=>'class="drag drop oddeven"',1=>'class="drag drop oddeven"');
 $bcnd=array(0=>'class="nodrag nodrop nohover"',1=>'class="nodrag nodrop nohoverpair"');		// Used for tr to add new lines
-$bctag=array(0=>'class="tagtr"',1=>'class="pair tagtr"');
+$bctag=array(0=>'class="impair tagtr"',1=>'class="pair tagtr"');
 
 // Define messages variables
 $mesg=''; $warning=''; $error=0;
diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php
index 971a4d2ed40bb1a11e20374531ec2068b1971e64..5c7f1f446ae6d546f556d525593e41628a16e244 100644
--- a/htdocs/theme/eldy/style.css.php
+++ b/htdocs/theme/eldy/style.css.php
@@ -2501,21 +2501,20 @@ div.pagination li.paginationafterarrows {
 
 
 /* Set the color for hover lines */
-.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover,
-table.dataTable tr.even:hover, table.dataTable tr.odd:hover
+.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover
 {
 <?php if ($colorbacklinepairhover) { ?>
 	background: rgb(<?php echo $colorbacklinepairhover; ?>) !important;		/* Must be background to be stronger than background of odd or even */
 <?php } ?>
 }
 
-.oddeven, .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover
 {
 	font-family: <?php print $fontlist ?>;
 	margin-bottom: 1px;
 	color: #202020;
 }
-.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.impair, .nohover .impair:hover, tr.impair td.nohover
 {
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
 }
@@ -2523,16 +2522,16 @@ table.dataTable tr.even:hover, table.dataTable tr.odd:hover
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
 }
 
-.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover {
 	font-family: <?php print $fontlist ?>;
 	margin-bottom: 1px;
 	color: #202020;
 }
-.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.pair, .nohover .pair:hover, tr.pair td.nohover {
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?>;
 }
 
-table.dataTable tr.odd, table.dataTable tr.oddeven {
+table.dataTable tr.oddeven {
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
 }
 
@@ -2541,7 +2540,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
 }
-tr.nohoverpair td {
+td.evenodd, tr.nohoverpair td {
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
 }
@@ -2550,17 +2549,17 @@ tr.nohoverpair td {
 table.dataTable td {
     padding: 5px 2px 5px 3px !important;
 }
-tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
+tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
     padding: 7px 2px 7px 3px;
     border-bottom: 1px solid #ddd;
 }
 form.pair, form.impair {
 	font-weight: normal;
 }
-form.tagtr:last-of-type div.tagtd, tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
+form.tagtr:last-of-type div.tagtd, tr.pair:last-of-type td, tr.impair:last-of-type td {
     border-bottom: 0px !important;
 }
-tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td {
+tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td {
     border-bottom: 0px !important;
 }
 td.nobottom, td.nobottom {
@@ -2620,6 +2619,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
     font-family: <?php print $fontlist ?>;
     font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
     vertical-align: middle;
+    height: 24px;
 }
 tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
 	text-shadow: none !important;
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 27c4713742a310f24d23d8dd4b4c09d7fd2aa416..8cc95628561b0e2dcae42ccbdbb247f8fb535d95 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -2596,21 +2596,21 @@ div.pagination li.paginationafterarrows {
 */
 
 /* Set the color for hover lines */
-.oddeven:hover, .odd:hover, .impair:hover, .even:hover, .pair:hover, .even:hover, .pair:hover, table.dataTable tr.even:hover, table.dataTable tr.odd:hover
+.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover
 {
 <?php if ($colorbacklinepairhover) { ?>
 	background: rgb(<?php echo $colorbacklinepairhover; ?>) !important;
 <?php } ?>
 }
 
-.oddeven, .odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.oddeven, .evenodd, .impair, .nohover .impair:hover, tr.impair td.nohover
 {
 	font-family: <?php print $fontlist ?>;
 	border: 0px;
 	margin-bottom: 1px;
 	color: #202020;
 }
-.odd, .impair, .nohover .odd:hover, .nohover .impair:hover, tr.odd td.nohover, tr.impair td.nohover
+.impair, .nohover .impair:hover, tr.impair td.nohover
 {
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
 }
@@ -2618,15 +2618,15 @@ div.pagination li.paginationafterarrows {
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?>;
 }
 
-.oddeven, .even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.oddeven, .evenodd, .pair, .nohover .pair:hover, tr.pair td.nohover {
 	font-family: <?php print $fontlist ?>;
 	margin-bottom: 1px;
 	color: #202020;
 }
-.even, .pair, .nohover .even:hover, .nohover .pair:hover, tr.even td.nohover, tr.pair td.nohover {
+.pair, .nohover .pair:hover, tr.pair td.nohover {
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?>;
 }
-table.dataTable tr.odd, table.dataTable tr.oddeven {
+table.dataTable tr.oddeven {
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
 }
 
@@ -2635,7 +2635,7 @@ td.oddeven, table.nohover tr.impair, table.nohover tr.pair, table.nohover tr.imp
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklineimpair1)); ?> !important;
 }
-tr.nohoverpair td {
+td.evenodd, tr.nohoverpair td {
 	background-color: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
 	background: #<?php echo colorArrayToHex(colorStringToArray($colorbacklinepair1)); ?> !important;
 }
@@ -2643,17 +2643,17 @@ tr.nohoverpair td {
 table.dataTable td {
     padding: 5px 2px 5px 3px !important;
 }
-tr.even td, tr.pair td, tr.odd td, tr.impair td, form.odd div.tagtd, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
+tr.pair td, tr.impair td, form.impair div.tagtd, form.pair div.tagtd, div.impair div.tagtd, div.pair div.tagtd, div.liste_titre div.tagtd {
     padding: 5px 2px 5px 3px;
     border-bottom: 1px solid #eee;
 }
 form.pair, form.impair {
 	font-weight: normal;
 }
-tr.even:last-of-type td, tr.pair:last-of-type td, tr.odd:last-of-type td, tr.impair:last-of-type td {
+tr.pair:last-of-type td, tr.impair:last-of-type td {
     border-bottom: 0px !important;
 }
-tr.even td .nobordernopadding tr td, tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td, tr.odd td .nobordernopadding tr td {
+tr.pair td .nobordernopadding tr td, tr.impair td .nobordernopadding tr td {
     border-bottom: 0px !important;
 }
 td.nobottom, td.nobottom {
@@ -2726,6 +2726,7 @@ tr.liste_titre th, th.liste_titre, tr.liste_titre td, td.liste_titre, form.liste
     font-family: <?php print $fontlist ?>;
     font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
     vertical-align: middle;
+    height: 24px;
 }
 tr.liste_titre th a, th.liste_titre a, tr.liste_titre td a, td.liste_titre a, form.liste_titre div a, div.liste_titre a {
 	text-shadow: none !important;