diff --git a/ChangeLog b/ChangeLog
index 204eeddf8a6da8042871995e381bfb7c37894eef..a83fc453a653d81bd9f24a0a6897541cf5523a75 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,9 +24,7 @@ Dolibarr 4.0 should be compatible with PHP 7 but more feedbacks are still expect
 
 Following changes may create regression for some external modules, but were necessary to make
 Dolibarr better:
-- Method FormBank::select_type_comptes_financiers() has been renamed into FormBank::selectTypeOfBankAccount()
-- Method Form::form_date() has been renamed into Form::formDate()
-- Method Form::select_date() has been renamed into Form::selectDate()
+- Method select_type_comptes_financiers() has been renamed into selectTypeOfBankAccount() 
 
 
 
diff --git a/dev/skeletons/skeleton_card.php b/dev/skeletons/skeleton_card.php
index b122e9a86c7a5e8e5617b3754ab8ffe5862850ed..03f70955527622ef425d8e71bb0bebabadf6239e 100644
--- a/dev/skeletons/skeleton_card.php
+++ b/dev/skeletons/skeleton_card.php
@@ -288,7 +288,7 @@ if ($id && (empty($action) || $action == 'view' || $action == 'delete'))
 	dol_fiche_head();
 
 	if ($action == 'delete') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteMyOjbect'), $langs->trans('ConfirmDeleteMyObject'), 'confirm_delete', '', 0, 1);
 		print $formconfirm;
 	}
 	
diff --git a/dev/skeletons/skeleton_list.php b/dev/skeletons/skeleton_list.php
index 29ca9261a704938d4fb744b9d9f0f1e40d84f592..2321b76aac8905ce366c25924b61a5062b51e753 100644
--- a/dev/skeletons/skeleton_list.php
+++ b/dev/skeletons/skeleton_list.php
@@ -370,7 +370,7 @@ if ($resql)
     }*/
     // Action column
 	print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print '</tr>'."\n";
diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 9e16c81dcd5d844d8e923d82c87559d910641092..3f251e0090b68492badd2743de81747e1df01598 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -62,7 +62,7 @@ if (! $sortorder)
 	$sortorder = "ASC";
 
 if ($action == 'delete') {
-	$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1);
+	$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteAccount'), $langs->trans('ConfirmDeleteAccount'), 'confirm_delete', '', 0, 1);
 	print $formconfirm;
 }
 
diff --git a/htdocs/accountancy/admin/fiscalyear_card.php b/htdocs/accountancy/admin/fiscalyear_card.php
index e1e4b3346d75a437e2b0aede0dd001878f210858..e04cc7132f05ca526196937ace90e366b332f75d 100644
--- a/htdocs/accountancy/admin/fiscalyear_card.php
+++ b/htdocs/accountancy/admin/fiscalyear_card.php
@@ -162,12 +162,12 @@ if ($action == 'create') {
 	
 	// Date start
 	print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
-	print Form::selectDate(($date_start ? $date_start : ''), 'fiscalyear');
+	print $form->select_date(($date_start ? $date_start : ''), 'fiscalyear');
 	print '</td></tr>';
 	
 	// Date end
 	print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
-	print Form::selectDate(($date_end ? $date_end : - 1), 'fiscalyearend');
+	print $form->select_date(($date_end ? $date_end : - 1), 'fiscalyearend');
 	print '</td></tr>';
 	
 	// Statut
@@ -216,12 +216,12 @@ if ($action == 'create') {
 			
 			// Date start
 			print '<tr><td class="fieldrequired">' . $langs->trans("DateStart") . '</td><td>';
-			print Form::selectDate($object->date_start ? $object->date_start : - 1, 'fiscalyear');
+			print $form->select_date($object->date_start ? $object->date_start : - 1, 'fiscalyear');
 			print '</td></tr>';
 			
 			// Date end
 			print '<tr><td class="fieldrequired">' . $langs->trans("DateEnd") . '</td><td>';
-			print Form::selectDate($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
+			print $form->select_date($object->date_end ? $object->date_end : - 1, 'fiscalyearend');
 			print '</td></tr>';
 			
 			// Statut
@@ -245,7 +245,7 @@ if ($action == 'create') {
 			 * Confirm delete
 			 */
 			if ($action == 'delete') {
-				print Form::formconfirm($_SERVER["PHP_SELF"] . "?id=" . $id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete");
+				print $form->formconfirm($_SERVER["PHP_SELF"] . "?id=" . $id, $langs->trans("DeleteFiscalYear"), $langs->trans("ConfirmDeleteFiscalYear"), "confirm_delete");
 			}
 			
 			dol_fiche_head($head, 'card', $langs->trans("FiscalYearCard"), 0, 'cron');
@@ -263,23 +263,23 @@ if ($action == 'create') {
 			
 			// Label
 			print '<tr><td valign="top">';
-			print Form::editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
+			print $form->editfieldkey("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
 			print '</td><td colspan="2">';
-			print Form::editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
+			print $form->editfieldval("Label", 'label', $object->label, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'alpha:32');
 			print "</td></tr>";
 			
 			// Date start
 			print '<tr><td>';
-			print Form::editfieldkey("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+			print $form->editfieldkey("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
 			print '</td><td colspan="2">';
-			print Form::editfieldval("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+			print $form->editfieldval("Date", 'date_start', $object->date_start, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
 			print '</td></tr>';
 			
 			// Date end
 			print '<tr><td>';
-			print Form::editfieldkey("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+			print $form->editfieldkey("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
 			print '</td><td colspan="2">';
-			print Form::editfieldval("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
+			print $form->editfieldval("Date", 'date_end', $object->date_end, $object, $conf->global->MAIN_EDIT_ALSO_INLINE, 'datepicker');
 			print '</td></tr>';
 			
 			// Statut
diff --git a/htdocs/accountancy/bookkeeping/balance.php b/htdocs/accountancy/bookkeeping/balance.php
index f44f9620d8ed37d4372f401cd909449a1bdcf8e3..3e4b69d6624ae637b6b7970b72a22ac7ede56083 100644
--- a/htdocs/accountancy/bookkeeping/balance.php
+++ b/htdocs/accountancy/bookkeeping/balance.php
@@ -161,9 +161,9 @@ else {
 
 	print '<div class="liste_titre">';
 	print $langs->trans('DateStart') . ': ';
-	print Form::selectDate($search_date_start, 'date_start', 0, 0, 1);
+	print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
 	print $langs->trans('DateEnd') . ': ';
-	print Form::selectDate($search_date_end, 'date_end', 0, 0, 1);
+	print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
 	print '</div>';
 
 	print '<table class="noborder" width="100%">';
diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index f459f306d3129a8643f4e147900b8af37fa3cef9..b77bc5446af874e1dbeabc8ea01c7de1974b558f 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -203,7 +203,7 @@ $formventilation = new FormVentilation($db);
  *  Confirmation to delete the command
  */
 if ($action == 'delete') {
-	$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1);
+	$formconfirm = $html->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $id, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'confirm_delete', '', 0, 1);
 	print $formconfirm;
 }
 
@@ -248,7 +248,7 @@ if ($action == 'create') {
 	print '<tr>';
 	print '<td>' . $langs->trans("Docdate") . '</td>';
 	print '<td>';
-	print Form::selectDate('', 'doc_date', '', '', '', "create_mvt", 1, 1);
+	print $html->select_date('', 'doc_date', '', '', '', "create_mvt", 1, 1);
 	print '</td>';
 	print '</tr>';
 	
diff --git a/htdocs/accountancy/bookkeeping/list.php b/htdocs/accountancy/bookkeeping/list.php
index f2ada190468b75798f0705deca44532af748551f..b507c4dfffa672701082264e14797d434af8c392 100644
--- a/htdocs/accountancy/bookkeeping/list.php
+++ b/htdocs/accountancy/bookkeeping/list.php
@@ -340,7 +340,7 @@ else {
 	}
 
 	if ($action == 'delmouv') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?mvt_num=' . GETPOST('mvt_num'), $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delmouvconfirm', '', 0, 1);
 		print $formconfirm;
 	}
 	if ($action == 'delbookkeepingyear') {
@@ -361,7 +361,7 @@ else {
 				'default' => $delyear
 		);
 
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"], $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt'), 'delbookkeepingyearconfirm', $form_question, 0, 1);
 		print $formconfirm;
 	}
 
@@ -394,10 +394,10 @@ else {
 	print '<td><input type="text" name="search_mvt_num" size="6" value="' . $search_mvt_num . '"></td>';
 	print '<td class="liste_titre">';
 	print $langs->trans('From') . ': ';
-	print Form::selectDate($search_date_start, 'date_start', 0, 0, 1);
+	print $form->select_date($search_date_start, 'date_start', 0, 0, 1);
 	print '<br>';
 	print $langs->trans('To') . ': ';
-	print Form::selectDate($search_date_end, 'date_end', 0, 0, 1);
+	print $form->select_date($search_date_end, 'date_end', 0, 0, 1);
 	print '</td>';
 	print '<td><input type="text" name="search_doc_ref" size="8" value="' . $search_doc_ref . '"></td>';
 	print '<td>';
diff --git a/htdocs/accountancy/bookkeeping/listbyyear.php b/htdocs/accountancy/bookkeeping/listbyyear.php
index f9f86002376f6ea72b91a160863fa031823c7dc3..10640c1887ab1722b4a2cd47d14ff527999452bf 100644
--- a/htdocs/accountancy/bookkeeping/listbyyear.php
+++ b/htdocs/accountancy/bookkeeping/listbyyear.php
@@ -176,9 +176,9 @@ print_barre_liste($langs->trans("Bookkeeping") . ' ' . dol_print_date($search_da
 print '<form method="GET" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '">';
 print '<div class="liste_titre">';
 print $langs->trans('DateStart') . ': ';
-print Form::selectDate($search_date_start, 'date_start');
+print $form->select_date($search_date_start, 'date_start');
 print $langs->trans('DateEnd') . ': ';
-print Form::selectDate($search_date_end, 'date_end');
+print $form->select_date($search_date_end, 'date_end');
 print '</div>';
 print '<div class="liste_titre">';
 print $langs->trans('From') . ' ' . $langs->trans('AccountAccounting') . ': ';
@@ -220,7 +220,7 @@ print '<input type="text" size=7 class="flat" name="search_doc_type" value="' .
 print '</td>';
 
 print '<td class="liste_titre">';
-print Form::selectDate($search_doc_date, 'doc_date', 0, 0, 1);
+print $form->select_date($search_doc_date, 'doc_date', 0, 0, 1);
 print '</td>';
 
 print '<td class="liste_titre">';
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index 4d1d71f48b9a301d7c868570a216da1a3739c7c5..f995b2684ee9d2c02e1b144ef0e479473839d256 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -52,9 +52,8 @@ require_once DOL_DOCUMENT_ROOT . '/societe/class/client.class.php';
 $langs->load("companies");
 $langs->load("other");
 $langs->load("compta");
-$langs->load("banks");
+$langs->load("bank");
 $langs->load('bills');
-$langs->load('donations');
 $langs->load("accountancy");
 
 $id_bank_account = GETPOST('id_account', 'int');
@@ -131,12 +130,11 @@ if ($result) {
 
 	$num = $db->num_rows($result);
 	// Variables
-	$account_supplier = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
-	$account_customer = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
-	$account_employee = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
-	$account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
-	$account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
-	$account_transfer = (! empty($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) ? $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH : $langs->trans("CodeNotDef"));
+	$cptfour = (! empty($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER) ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : $langs->trans("CodeNotDef"));
+	$cptcli = (! empty($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER) ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : $langs->trans("CodeNotDef"));
+	$accountancy_account_salary = (! empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : $langs->trans("CodeNotDef"));
+	$accountancy_account_pay_vat = (! empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : $langs->trans("CodeNotDef"));
+	$accountancy_account_pay_donation = (! empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : $langs->trans("CodeNotDef"));
 
 	$tabpay = array ();
 	$tabbq = array ();
@@ -156,9 +154,11 @@ if ($result) {
 		// Controls
 		$compta_bank = $obj->account_number;
 		if ($obj->label == '(SupplierInvoicePayment)')
-			$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $account_supplier);
+			$compta_soc = (! empty($obj->code_compta_fournisseur) ? $obj->code_compta_fournisseur : $cptfour);
 		if ($obj->label == '(CustomerInvoicePayment)')
-			$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $account_customer);
+			$compta_soc = (! empty($obj->code_compta) ? $obj->code_compta : $cptcli);
+		if ($obj->typeop == '(BankTransfert)')
+			$compta_soc = $conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH;
 
 		// Variable bookkeeping
 		$tabpay[$obj->rowid]["date"] = $obj->do;
@@ -226,23 +226,25 @@ if ($result) {
 					$paymentdonstatic->id = $links[$key]['url_id'];
 					$paymentdonstatic->fk_donation = $links[$key]['url_id'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentDonation");
-					$tabtp[$obj->rowid][$account_pay_donation] += $obj->amount;
+					$tabtp[$obj->rowid][$accountancy_account_pay_donation] += $obj->amount;
 				} else if ($links[$key]['type'] == 'payment_vat') {
 					$paymentvatstatic->id = $links[$key]['url_id'];
 					$paymentvatstatic->ref = $links[$key]['url_id'];
-					$paymentvatstatic->label = $links[$key]['label'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("PaymentVat");
-					$tabtp[$obj->rowid][$account_pay_vat] += $obj->amount;
+					$tabtp[$obj->rowid][$accountancy_account_pay_vat] += $obj->amount;
 				} else if ($links[$key]['type'] == 'payment_salary') {
 					$paymentsalstatic->id = $links[$key]['url_id'];
 					$paymentsalstatic->ref = $links[$key]['url_id'];
 					$paymentsalstatic->label = $links[$key]['label'];
 					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentsalstatic->getNomUrl(2);
-					$tabtp[$obj->rowid][$account_employee ] += $obj->amount;
+					$tabtp[$obj->rowid][$accountancy_account_salary] += $obj->amount;
 				} else if ($links[$key]['type'] == 'banktransfert') {
-					$tabpay[$obj->rowid]["lib"] .= ' ' . $langs->trans("BankTransfer");
-					$tabtp[$obj->rowid][$account_transfer] += $obj->amount;
+					$tabpay[$obj->rowid]["lib"] .= ' ' . $paymentvatstatic->getNomUrl(2);
+					$tabtp[$obj->rowid][$cpttva] += $obj->amount;
 				}
+				/*else {
+				 $tabtp [$obj->rowid] [$accountancy_account_salary] += $obj->amount;
+				 }*/
 			}
 		}
 
@@ -539,7 +541,7 @@ else {
 	$nom = $langs->trans("FinanceJournal") . ' - ' . $bank_code_journal->getNomUrl(1);
 	$builddate = time();
 	$description = $langs->trans("DescFinanceJournal") . '<br>';
-	$period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
+	$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
 
 	$varlink = 'id_account=' . $id_bank_account;
 	report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
@@ -586,30 +588,24 @@ else {
 	foreach ( $tabpay as $key => $val ) {
 		$date = dol_print_date($db->jdate($val["date"]), 'day');
 
-		$reflabel = $val["ref"];
-		if ($reflabel == '(SupplierInvoicePayment)') {
-			$reflabel = $langs->trans('Supplier');
+		if ($val["lib"] == '(SupplierInvoicePayment)') {
+			$reflabel = $langs->trans('SupplierInvoicePayment');
 		}
-		if ($reflabel == '(CustomerInvoicePayment)') {
-			$reflabel = $langs->trans('Customer');
-		}		
-		if ($reflabel == '(SocialContributionPayment)') {
-			$reflabel = $langs->trans('SocialContribution');
-		}
-		if ($reflabel == '(DonationPayment)') {
-			$reflabel = $langs->trans('Donation');
+		if ($val["lib"] == '(CustomerInvoicePayment)') {
+			$reflabel = $langs->trans('CustomerInvoicePayment');
 		}
 
 		// Bank
 		foreach ( $tabbq[$key] as $k => $mt ) {
 			print "<tr " . $bc[$var] . ">";
 			print "<td>" . $date . "</td>";
-			print "<td>" . $ref . "</td>";
+			print "<td>" . $reflabel . "</td>";
 			print "<td>" . length_accountg($k) . "</td>";
+			// print "<td>" . $langs->trans('Bank') . "</td>";
 			if ($val['soclib'] == '') {
-				print "<td>" . $bank_code_journal->label . " - " . $val["ref"] . "</td>";
+				print "<td>" . $langs->trans('Bank') . " - " . $val["ref"] . "</td>";
 			} else {
-				print "<td>" . $bank_code_journal->label . " - " . $val['soclib'] . "</td>";
+				print "<td>" . $langs->trans("Bank") . " - " . $val['soclib'] . "</td>";
 			}
 			print "<td>" . $val["type_payment"] . "</td>";
 			print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
@@ -623,9 +619,19 @@ else {
 				if ($k != 'type') {
 					print "<tr " . $bc[$var] . ">";
 					print "<td>" . $date . "</td>";
-					print "<td>" . $ref . "</td>";
+					print "<td>" . $val["soclib"] . "</td>";
+					// print "<td>" . length_accounta($k) . "</td>";
+					if (length_accounta($k) == '') {
+						print "<td>" . length_accounta($conf->global->ACCOUNTING_ACCOUNT_TRANSFER_CASH) . "</td>";
+					} else {
 					print "<td>" . length_accounta($k) . "</td>";
-					print "<td>" . $reflabel . ' ' . $val['soclib'] . "</td>";
+					}
+					// print "<td>" . $langs->trans('ThirdParty') . " (" . $val['soclib'] . ")</td>";
+					if ($val['soclib'] == '') {
+						print "<td>" . $langs->trans('ThirdParty') . " - " . $val["ref"] . "</td>";
+					} else {
+						print "<td>" . $langs->trans("ThirdParty") . ' - ' . $val['soclib'] . "</td>";
+					}
 					print "<td>" . $val["type_payment"] . "</td>";
 					print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
 					print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
@@ -636,9 +642,14 @@ else {
 			foreach ( $tabbq[$key] as $k => $mt ) {
 				print "<tr " . $bc[$var] . ">";
 				print "<td>" . $date . "</td>";
-				print "<td>" . $ref . "</td>";
-				print "<td>" . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . "</td>";
 				print "<td>" . $reflabel . "</td>";
+				print "<td>" . length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) . "</td>";
+				// print "<td>" . $langs->trans('ThirdParty') . "</td>";
+				if ($val['soclib'] == '') {
+					print "<td>" . $langs->trans('ThirdParty') . " - " . $val["ref"] . "</td>";
+				} else {
+					print "<td>" . $langs->trans("ThirdParty") . ' - ' . $val['soclib'] . "</td>";
+				}
 				print "<td>&nbsp;</td>";
 				print "<td align='right'>" . ($mt < 0 ? price(- $mt) : '') . "</td>";
 				print "<td align='right'>" . ($mt >= 0 ? price($mt) : '') . "</td>";
diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php
index 6f8642a4c47627c7564944773fe7e8b4565d6811..8281159818824f9bc2fbce396c99d7fa9a5180cf 100644
--- a/htdocs/accountancy/journal/purchasesjournal.php
+++ b/htdocs/accountancy/journal/purchasesjournal.php
@@ -403,7 +403,7 @@ if ($action == 'export_csv') {
 		$description .= $langs->trans("DepositsAreIncluded");
 	}
 
-	$period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
+	$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
 	report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
 			'action' => ''
 	));
diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php
index 65e383dce881d8d2daa3c1efc8c3966163b6b971..670875ec52bf4413b6e4cf066e96ca85ef28b247 100644
--- a/htdocs/accountancy/journal/sellsjournal.php
+++ b/htdocs/accountancy/journal/sellsjournal.php
@@ -418,7 +418,7 @@ if ($action == 'export_csv') {
 		$description .= $langs->trans("DepositsAreNotIncluded");
 	else
 		$description .= $langs->trans("DepositsAreIncluded");
-	$period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
+	$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
 	report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array (
 			'action' => ''
 	));
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index 5ced4aa5f84a81e0eae0940433f715352a0e85dd..ade361fdd51786781507f16ff539a4fedea5524a 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -221,7 +221,7 @@ if ($result) {
 	print '<td class="liste_titre" align="center"><input type="text" class="flat" size="15" name="search_account" value="' . $search_account . '"></td>';
 	print '<td class="liste_titre" colspan="2">&nbsp;</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php
index 3a205b21723baa61e2799504ba47fd39c7fb2012..8e265eb70f7bac6ecd1ccf5c7b9d12f138010368 100644
--- a/htdocs/adherents/admin/adherent.php
+++ b/htdocs/adherents/admin/adherent.php
@@ -134,7 +134,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<input type="hidden" name="action" value="update">';
 print '<input type="hidden" name="constname" value="ADHERENT_LOGIN_NOT_REQUIRED">';
 print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentLoginRequired").'</td><td>';
-print Form::selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
+print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)?0:1),1);
 print '</td><td align="center" width="80">';
 print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
 print "</td></tr>\n";
@@ -147,7 +147,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<input type="hidden" name="action" value="update">';
 print '<input type="hidden" name="constname" value="ADHERENT_MAIL_REQUIRED">';
 print '<tr '.$bc[$var].'><td>'.$langs->trans("AdherentMailRequired").'</td><td>';
-print Form::selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
+print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_MAIL_REQUIRED)?$conf->global->ADHERENT_MAIL_REQUIRED:0),1);
 print '</td><td align="center" width="80">';
 print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
 print "</td></tr>\n";
@@ -160,7 +160,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<input type="hidden" name="action" value="update">';
 print '<input type="hidden" name="constname" value="ADHERENT_DEFAULT_SENDINFOBYMAIL">';
 print '<tr '.$bc[$var].'><td>'.$langs->trans("MemberSendInformationByMailByDefault").'</td><td>';
-print Form::selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
+print $form->selectyesno('constvalue',(! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?$conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL:0),1);
 print '</td><td align="center" width="80">';
 print '<input type="submit" class="button" value="'.$langs->trans("Update").'" name="Button">';
 print "</td></tr>\n";
diff --git a/htdocs/adherents/admin/public.php b/htdocs/adherents/admin/public.php
index 0023a4baca9f550735aee88da3fb428f0392fb08..6f5d1de5c87108ce43fec1e1521546e35bcb6f3c 100644
--- a/htdocs/adherents/admin/public.php
+++ b/htdocs/adherents/admin/public.php
@@ -149,7 +149,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("EnablePublicSubscriptionForm");
 print '</td><td align="right">';
-print Form::selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
+print $form->selectyesno("MEMBER_ENABLE_PUBLIC",(! empty($conf->global->MEMBER_ENABLE_PUBLIC)?$conf->global->MEMBER_ENABLE_PUBLIC:0),1);
 print "</td></tr>\n";
 
 // Type
@@ -158,7 +158,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<tr '.$bc[$var].' class="drag"><td>';
 print $langs->trans("EnablePublicSubscriptionForm");
 print '</td><td width="60" align="center">';
-print Form::selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1);
+print $form->selectyesno("forcedate",$conf->global->MEMBER_NEWFORM_FORCETYPE,1);
 print "</td></tr>\n"; */
 
 // Amount
@@ -176,7 +176,7 @@ print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print '<tr '.$bc[$var].' id="tredit"><td>';
 print $langs->trans("CanEditAmount");
 print '</td><td align="right">';
-print Form::selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
+print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT",(! empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT)?$conf->global->MEMBER_NEWFORM_EDITAMOUNT:0),1);
 print "</td></tr>\n";
 
 if (! empty($conf->paybox->enabled) || ! empty($conf->paypal->enabled))
diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php
index 609e050d9ef4b8d1eb32d519c8115200e125bed7..8d62917590296137afb8a1ffb012be1deda24655 100644
--- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php
+++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php
@@ -338,7 +338,7 @@ abstract class ActionsAdherentCardCommon
 
         if ($action == 'view' || $action == 'delete')
         {
-        	$this->tpl['showrefnav'] = Form::showrefnav($this->object,'id');
+        	$this->tpl['showrefnav'] = $form->showrefnav($this->object,'id');
 
         	if ($this->object->socid > 0)
         	{
@@ -385,7 +385,7 @@ abstract class ActionsAdherentCardCommon
         	array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login),
         	array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password));
 
-        	$this->tpl['action_create_user'] = Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateAdherent"),"confirm_create_user",$formquestion,'no');
+        	$this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateAdherent"),"confirm_create_user",$formquestion,'no');
         }
     }
 
diff --git a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
index 702438a9f684a6f3fa647da5172bc136c1aea6c2..7e0b12919980de6bd5768d425e0a8424cb2396ad 100644
--- a/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
+++ b/htdocs/adherents/canvas/default/actions_adherentcard_default.class.php
@@ -108,7 +108,7 @@ class ActionsAdherentCardDefault extends ActionsAdherentCardCommon
 			// Confirm delete contact
         	if ($action == 'delete' && $user->rights->adherent->supprimer)
         	{
-        		$this->tpl['action_delete'] = Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteAdherent"),$langs->trans("ConfirmDeleteAdherent"),"confirm_delete",'',0,1);
+        		$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteAdherent"),$langs->trans("ConfirmDeleteAdherent"),"confirm_delete",'',0,1);
         	}
 		}
 
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 2ab8640460beec9e01a64906fbed6f1afdc1b93f..f17ca46299f45be17e4b0043d8a20ecdae5b3d52 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -900,12 +900,12 @@ else
 
 		// Birthday
 		print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
-		Form::selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
+		$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
 		print "</td></tr>\n";
 
 		// Public profil
 		print "<tr><td>".$langs->trans("Public")."</td><td>\n";
-		print Form::selectyesno("public",$object->public,1);
+		print $form->selectyesno("public",$object->public,1);
 		print "</td></tr>\n";
 
 		// Categories
@@ -1154,12 +1154,12 @@ else
 
 		// Birthday
 		print "<tr><td>".$langs->trans("Birthday")."</td><td>\n";
-		Form::selectDate(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
+		$form->select_date(($object->birth ? $object->birth : -1),'birth','','',1,'formsoc');
 		print "</td></tr>\n";
 
 		// Public profil
 		print "<tr><td>".$langs->trans("Public")."</td><td>\n";
-		print Form::selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
+		print $form->selectyesno("public",(isset($_POST["public"])?$_POST["public"]:$object->public),1);
 		print "</td></tr>\n";
 
 		// Categories
@@ -1278,7 +1278,7 @@ else
 				if ($object->fk_soc > 0) $text.=$langs->trans("UserWillBeExternalUser");
 				else $text.=$langs->trans("UserWillBeInternalUser");
 			}
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
 		}
 
 		// Confirm create third party
@@ -1297,7 +1297,7 @@ else
 			// Create a form array
 			$formquestion=array(		array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
 
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
 		}
 
 		// Confirm validate member
@@ -1333,13 +1333,13 @@ else
 			if (! empty($conf->mailman->enabled) && ! empty($conf->global->ADHERENT_USE_SPIP))    {
 				$formquestion[]=array('type'=>'other','label'=>$langs->transnoentitiesnoconv("SynchroSpipEnabled"),'value'=>'');
 			}
-			print Form::formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1);
+			print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion,1,1);
 		}
 
 		// Confirm send card by mail
 		if ($action == 'sendinfo')
 		{
-			print Form::formconfirm("card.php?rowid=".$rowid,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
+			print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
 		}
 
 		// Confirm terminate
@@ -1370,7 +1370,7 @@ else
 			$formquestion=array();
 			if ($object->email) $formquestion[]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $label, 'value' => (! empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL)?'true':'false'));
 			if ($backtopage)    $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
-			print Form::formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion,'no',1);
+			print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion,'no',1);
 		}
 
 		// Confirm remove member
@@ -1378,7 +1378,7 @@ else
 		{
 			$formquestion=array();
 			if ($backtopage) $formquestion[]=array('type' => 'hidden', 'name' => 'backtopage', 'value' => ($backtopage != '1' ? $backtopage : $_SERVER["HTTP_REFERER"]));
-			print Form::formconfirm("card.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1);
+			print $form->formconfirm("card.php?rowid=".$rowid,$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete",$formquestion,0,1);
 		}
 
 		/*
@@ -1386,7 +1386,7 @@ else
 		 */
 		if ($action == 'add_spip')
 		{
-			print Form::formconfirm("card.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
+			print $form->formconfirm("card.php?rowid=".$rowid, $langs->trans('AddIntoSpip'), $langs->trans('AddIntoSpipConfirmation'), 'confirm_add_spip');
 		}
 
 		/*
@@ -1394,7 +1394,7 @@ else
 		 */
 		if ($action == 'del_spip')
 		{
-			print Form::formconfirm("card.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
+			print $form->formconfirm("card.php?rowid=$rowid", $langs->trans('DeleteIntoSpip'), $langs->trans('DeleteIntoSpipConfirmation'), 'confirm_del_spip');
 		}
 
 		$rowspan=17;
diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index 650508df95ac99523e634d8f13ec04355aa050f2..998dc53d5258a734813551146183e83c5de6aa8e 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -929,7 +929,7 @@ if ($rowid > 0)
 			// Create a form array
 			$formquestion=array(array('label' => $langs->trans("NameToCreate"), 'type' => 'text', 'name' => 'companyname', 'value' => $name));
 
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$object->id,$langs->trans("CreateDolibarrThirdParty"),$langs->trans("ConfirmCreateThirdParty"),"confirm_create_thirdparty",$formquestion,1);
 		}
 
 
@@ -974,7 +974,7 @@ if ($rowid > 0)
 				$datefrom=$object->datevalid;
             }
         }
-        print Form::selectDate($datefrom,'','','','',"cotisation",1,1,1);
+        print $form->select_date($datefrom,'','','','',"cotisation",1,1,1);
         print "</td></tr>";
 
         // Date end subscription
@@ -987,7 +987,7 @@ if ($rowid > 0)
             $dateto=-1;		// By default, no date is suggested
         }
         print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
-        print Form::selectDate($dateto,'end','','','',"cotisation",1,0,1);
+        print $form->select_date($dateto,'end','','','',"cotisation",1,0,1);
         print "</td></tr>";
 
         if ($adht->cotisation)
@@ -1088,7 +1088,7 @@ if ($rowid > 0)
 
                 // Date of payment
                 print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
-                print Form::selectDate(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1,1);
+                print $form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',1,1,1);
                 print "</td></tr>\n";
 
                 print '<tr class="bankswitchclass2"><td>'.$langs->trans('Numero');
diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php
index 5f3196521820419330c9a3922fd7456cc5ddf9e9..301664fab833f9e3b333163bb5206f8562d4b6f7 100644
--- a/htdocs/adherents/cotisations.php
+++ b/htdocs/adherents/cotisations.php
@@ -200,7 +200,7 @@ if ($result)
 	
     // Action column
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';  
 
diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php
index 3ecc840c1bb1bda0414aead8e1aaad1d5e229a66..6b980a4df1cec555d991a01e7c148054d423d7ce 100644
--- a/htdocs/adherents/fiche_subscription.php
+++ b/htdocs/adherents/fiche_subscription.php
@@ -196,7 +196,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
     // Ref
     print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 	print '<td class="valeur" colspan="3">';
-	print Form::showrefnav($subscription, 'rowid', $linkback, 1);
+	print $form->showrefnav($subscription, 'rowid', $linkback, 1);
 	print '</td></tr>';	
 
     // Member
@@ -207,13 +207,13 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit')
 
     // Date start subscription
     print '<tr><td>'.$langs->trans("DateSubscription").'</td><td class="valeur" colspan="2">';
-	Form::selectDate($subscription->dateh,'datesub',1,1,0,'update',1);
+	$form->select_date($subscription->dateh,'datesub',1,1,0,'update',1);
 	print '</td>';
     print '</tr>';
 
     // Date end subscription
     print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td class="valeur" colspan="2">';
-	Form::selectDate($subscription->datef,'datesubend',0,0,0,'update',1);
+	$form->select_date($subscription->datef,'datesubend',0,0,0,'update',1);
 	print '</td>';
     print '</tr>';
 
@@ -295,7 +295,7 @@ if ($rowid && $action != 'edit')
         //$formquestion['text']='<b>'.$langs->trans("ThisWillAlsoDeleteBankRecord").'</b>';
 		$text=$langs->trans("ConfirmDeleteSubscription");
 		if (! empty($conf->banque->enabled) && ! empty($conf->global->ADHERENT_BANK_USE)) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoDeleteBankRecord");
-		print Form::formconfirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1);
+		print $form->formconfirm($_SERVER["PHP_SELF"]."?rowid=".$subscription->id,$langs->trans("DeleteSubscription"),$text,"confirm_delete",$formquestion,0,1);
     }
 
     print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
@@ -307,7 +307,7 @@ if ($rowid && $action != 'edit')
     // Ref
     print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 	print '<td class="valeur" colspan="3">';
-	print Form::showrefnav($subscription, 'rowid', $linkback, 1);
+	print $form->showrefnav($subscription, 'rowid', $linkback, 1);
 	print '</td></tr>';
 
     // Member
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index beea3c5029e69ec7445c79465c7a37665c50e7aa..aea09f731244b32631e8304dc3af38aaa845fd99 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -287,7 +287,7 @@ if ($resql)
 
     // Action column
     print '<td class="liste_titre" colspan="2" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';    
 
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index a8c59995bf4d6bbc212ee296895a2833bb6479da..f46b6d0268c77e3a4a21d75ba484dda420543aa7 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -236,11 +236,11 @@ if ($action == 'create')
 	print '<tr><td width="25%" class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40"></td></tr>';
 
 	print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
-	print Form::selectyesno("cotisation",1,1);
+	print $form->selectyesno("cotisation",1,1);
 	print '</td></tr>';
 
 	print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
-	print Form::selectyesno("vote",0,1);
+	print $form->selectyesno("vote",0,1);
 	print '</td></tr>';
 
 	print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
@@ -297,7 +297,7 @@ if ($rowid > 0)
 		// Ref
 		print '<tr><td width="15%">'.$langs->trans("Ref").'</td>';
 		print '<td>';
-		print Form::showrefnav($object, 'rowid', $linkback);
+		print $form->showrefnav($object, 'rowid', $linkback);
 		print '</td></tr>';
 
 		// Label
@@ -634,11 +634,11 @@ if ($rowid > 0)
 		print '<tr><td>'.$langs->trans("Label").'</td><td><input type="text" name="libelle" size="40" value="'.dol_escape_htmltag($object->libelle).'"></td></tr>';
 
 		print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
-		print Form::selectyesno("cotisation",$object->cotisation,1);
+		print $form->selectyesno("cotisation",$object->cotisation,1);
 		print '</td></tr>';
 
 		print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
-		print Form::selectyesno("vote",$object->vote,1);
+		print $form->selectyesno("vote",$object->vote,1);
 		print '</td></tr>';
 
 		print '<tr><td valign="top">'.$langs->trans("Description").'</td><td>';
diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php
index 9b302a159d540a754ae7d695b57b98612eb9112d..9e09bf87b1dfead16be59da1143e46c38b27d2c5 100644
--- a/htdocs/admin/boxes.php
+++ b/htdocs/admin/boxes.php
@@ -472,7 +472,7 @@ print '</tr>';
 if ($conf->global->MAIN_FEATURES_LEVEL == 2 || ! empty($conf->global->MAIN_ACTIVATE_FILECACHE)) {
     $var=!$var;
     print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableFileCache").'</td><td>';
-    print Form::selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
+    print $form->selectyesno('MAIN_ACTIVATE_FILECACHE',$conf->global->MAIN_ACTIVATE_FILECACHE,1);
     print '</td>';
     print '</tr>';
 }
diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php
index 1bba473b374ccf18907853e8819c962dcecf29b1..a77fb706a71de6ef419fc485c6b0feef6d8d5843 100644
--- a/htdocs/admin/clicktodial.php
+++ b/htdocs/admin/clicktodial.php
@@ -83,7 +83,7 @@ print "</tr>\n";
 $var=!$var;
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("ClickToDialUseTelLink").'</td><td>';
-print Form::selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>';
+print $form->selectyesno("CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS", $conf->global->CLICKTODIAL_USE_TEL_LINK_ON_PHONE_NUMBERS, 1).'<br>';
 print '<br>';
 print $langs->trans("ClickToDialUseTelLinkDesc");
 print '</td></tr>';
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index 984480a3cef0c6ba4a943c24a955ba4bd700ce9f..14332ceee6306123d97619686e754653460cfb5f 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -184,7 +184,7 @@ if ($action == 'edit')
 
 	$var=false;
 	print '<tr '.$bc[$var].'>';
-	print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .Form::selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
+	print '<td>'.$langs->trans("MAIN_DISABLE_METEO").'</td><td>' .$form->selectyesno('MAIN_DISABLE_METEO',(empty($conf->global->MAIN_DISABLE_METEO)?0:1),1) . '</td></tr>';
 
 	print '</table>';
 
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index b8a68e4e02db9c95d90a1e3ec90a4467118521cd..8ee8b791303202b21f8e90d6fb62b68e02260dad 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -8,7 +8,7 @@
  * Copyright (C) 2011       Remy Younes             <ryounes@gmail.com>
  * Copyright (C) 2012-2015  Marcos García           <marcosgdf@gmail.com>
  * Copyright (C) 2012       Christophe Battarel     <christophe.battarel@ltairis.fr>
- * Copyright (C) 2011-2016  Alexandre Spangaro      <aspangaro.dolibarr@gmail.com>
+ * Copyright (C) 2011-2015  Alexandre Spangaro      <aspangaro.dolibarr@gmail.com>
  * Copyright (C) 2015       Ferran Marcet           <fmarcet@2byte.es>
  * Copyright (C) 2016       Raphaël Doursenaud      <rdoursenaud@gpcsolutions.fr>
  *
@@ -78,7 +78,7 @@ $hookmanager->initHooks(array('admin'));
 // Put here declaration of dictionaries properties
 
 // Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
-$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0);
+$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26);
 
 // Name of SQL tables of dictionaries
 $tabname=array();
@@ -112,8 +112,6 @@ $tabname[27]= MAIN_DB_PREFIX."c_stcomm";
 $tabname[28]= MAIN_DB_PREFIX."c_holiday_types";
 $tabname[29]= MAIN_DB_PREFIX."c_lead_status";
 $tabname[30]= MAIN_DB_PREFIX."c_format_cards";
-$tabname[31]= MAIN_DB_PREFIX."accounting_system";
-$tabname[32]= MAIN_DB_PREFIX."c_accountancy_category";
 
 // Dictionary labels
 $tablib=array();
@@ -147,8 +145,6 @@ $tablib[27]= "DictionaryProspectStatus";
 $tablib[28]= "DictionaryHolidayTypes";
 $tablib[29]= "DictionaryOpportunityStatus";
 $tablib[30]= "DictionaryFormatCards";
-$tablib[31]= "DictionaryAccountancysystem";
-$tablib[32]= "DictionaryAccountancyCategory";
 
 // Requests to extract data
 $tabsql=array();
@@ -182,8 +178,6 @@ $tabsql[27]= "SELECT id      as rowid, code, libelle, active FROM ".MAIN_DB_PREF
 $tabsql[28]= "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
 $tabsql[29]= "SELECT rowid   as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
 $tabsql[30]= "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
-$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1";
-$tabsql[32]= "SELECT a.rowid as rowid, a.code as code, a.label, a.range, a.position, a.fk_country as country_id, c.code as country_code, c.label as country, a.active FROM ".MAIN_DB_PREFIX."c_accountancy_category as a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_country=c.rowid and c.active=1";
 
 // Criteria to sort dictionaries
 $tabsqlsort=array();
@@ -217,8 +211,6 @@ $tabsqlsort[27]="code ASC";
 $tabsqlsort[28]="country ASC, code ASC";
 $tabsqlsort[29]="position ASC";
 $tabsqlsort[30]="code ASC";
-$tabsqlsort[31]="pcg_version ASC";
-$tabsqlsort[32]="code ASC, label ASC";
 
 // Nom des champs en resultat de select pour affichage du dictionnaire
 $tabfield=array();
@@ -252,8 +244,6 @@ $tabfield[27]= "code,libelle";
 $tabfield[28]= "code,label,affect,delay,newByMonth,country_id,country";
 $tabfield[29]= "code,label,percent,position";
 $tabfield[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
-$tabfield[31]= "pcg_version,country_id,country,label";
-$tabfield[32]= "code,label,range,position,country_id,country";
 
 // Nom des champs d'edition pour modification d'un enregistrement
 $tabfieldvalue=array();
@@ -287,8 +277,6 @@ $tabfieldvalue[27]= "code,libelle";
 $tabfieldvalue[28]= "code,label,affect,delay,newByMonth,country";
 $tabfieldvalue[29]= "code,label,percent,position";
 $tabfieldvalue[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
-$tabfieldvalue[31]= "pcg_version,country,label";
-$tabfieldvalue[32]= "code,label,range,position,country";
 
 // Nom des champs dans la table pour insertion d'un enregistrement
 $tabfieldinsert=array();
@@ -322,8 +310,6 @@ $tabfieldinsert[27]= "code,libelle";
 $tabfieldinsert[28]= "code,label,affect,delay,newByMonth,fk_country";
 $tabfieldinsert[29]= "code,label,percent,position";
 $tabfieldinsert[30]= "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
-$tabfieldinsert[31]= "pcg_version,fk_pays,label";
-$tabfieldinsert[32]= "code,label,range,position,fk_country";
 
 // Nom du rowid si le champ n'est pas de type autoincrement
 // Example: "" if id field is "rowid" and has autoincrement on
@@ -359,8 +345,6 @@ $tabrowid[27]= "id";
 $tabrowid[28]= "";
 $tabrowid[29]= "";
 $tabrowid[30]= "";
-$tabrowid[31]= "";
-$tabrowid[32]= "";
 
 // Condition to show dictionary in setup page
 $tabcond=array();
@@ -394,8 +378,6 @@ $tabcond[27]= ! empty($conf->societe->enabled);
 $tabcond[28]= ! empty($conf->holiday->enabled);
 $tabcond[29]= ! empty($conf->projet->enabled);
 $tabcond[30]= ! empty($conf->label->enabled);
-$tabcond[31]= ! empty($conf->accounting->enabled);
-$tabcond[32]= ! empty($conf->accounting->enabled);
 
 // List of help for fields
 $tabhelp=array();
@@ -429,8 +411,6 @@ $tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"));
 $tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"),'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
 $tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
 $tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
-$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
-$tabhelp[32] = array('code'=>$langs->trans("EnterAnyCode"));
 
 // List of check for fields (NOT USED YET)
 $tabfieldcheck=array();
@@ -464,8 +444,6 @@ $tabfieldcheck[27] = array();
 $tabfieldcheck[28] = array();
 $tabfieldcheck[29] = array();
 $tabfieldcheck[30] = array();
-$tabfieldcheck[31] = array();
-$tabfieldcheck[32] = array();
 
 // Complete all arrays with entries found into modules
 complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
@@ -482,7 +460,6 @@ if ($id == 11)
 	$langs->load("propal");
 	$langs->load("bills");
 	$langs->load("interventions");
-	$langs->load("accountancy");
 	$elementList = array(
 			''				    => '',
             'societe'           => $langs->trans('ThirdParty'),
@@ -557,7 +534,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
     $ok=1;
     foreach ($listfield as $f => $value)
     {
-        if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp','DictionaryAccountancysystem','DictionaryAccountancyCategory'))) continue;		// For some pages, country is not mandatory
+        if ($value == 'country_id' && in_array($tablib[$id],array('DictionaryVAT','DictionaryRegion','DictionaryCompanyType','DictionaryHolidayTypes','DictionaryRevenueStamp'))) continue;		// For some pages, country is not mandatory
     	if ($value == 'country' && in_array($tablib[$id],array('DictionaryCanton','DictionaryCompanyType','DictionaryRevenueStamp'))) continue;		// For some pages, country is not mandatory
         if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
         if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
@@ -873,7 +850,7 @@ print "<br>\n";
 // Confirmation de la suppression de la ligne
 if ($action == 'delete')
 {
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
 }
 //var_dump($elementList);
 
@@ -975,7 +952,6 @@ if ($id)
             if ($fieldlist[$field]=='sortorder')       { $valuetoshow=$langs->trans("SortOrder"); }
 	        if ($fieldlist[$field]=='short_label')     { $valuetoshow=$langs->trans("ShortLabel"); }
             if ($fieldlist[$field]=='type_template')   { $valuetoshow=$langs->trans("TypeOfTemplate"); }
-			if ($fieldlist[$field]=='range')   		   { $valuetoshow=$langs->trans("Range"); }
 
             if ($id == 2)	// Special cas for state page
             {
@@ -1143,7 +1119,6 @@ if ($id)
                 if ($fieldlist[$field]=='sortorder')       { $valuetoshow=$langs->trans("SortOrder"); }
 	            if ($fieldlist[$field]=='short_label')     { $valuetoshow=$langs->trans("ShortLabel"); }
             	if ($fieldlist[$field]=='type_template')   { $valuetoshow=$langs->trans("TypeOfTemplate"); }
-				if ($fieldlist[$field]=='range')   		   { $valuetoshow=$langs->trans("Range"); }
 
                 // Affiche nom du champ
                 if ($showfield)
@@ -1595,7 +1570,7 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
 		}
 		elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'fdm' || $fieldlist[$field] == 'deductible') {
 			print '<td>';
-			print Form::selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1);
+			print $form->selectyesno($fieldlist[$field],(! empty($obj->{$fieldlist[$field]})?$obj->{$fieldlist[$field]}:''),1);
 			print '</td>';
 		}
 		elseif (in_array($fieldlist[$field],array('nbjour','decalage','taux','localtax1','localtax2'))) {
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index bb5058c8b034bb94b060f6a3a1ed88d1aa70ba43..b3f1d7a5d516005bc4dbed0d53a53515ce9bf19b 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -744,7 +744,7 @@ print '<input type="hidden" name="action" value="setforcedate" />';
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("ForceInvoiceDate");
 print '</td><td width="60" align="center">';
-print Form::selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1);
+print $form->selectyesno("forcedate",$conf->global->FAC_FORCE_DATE_VALIDATION,1);
 print '</td><td align="right">';
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
 print "</td></tr>\n";
@@ -758,7 +758,7 @@ print '<input type="hidden" name="action" value="set_FAC_AUTO_FILLJS" />';
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("JSOnPaimentBill");
 print '</td><td width="60" align="center">';
-print Form::selectyesno("FAC_AUTO_FILLJS",$conf->global->FAC_AUTO_FILLJS,1);
+print $form->selectyesno("FAC_AUTO_FILLJS",$conf->global->FAC_AUTO_FILLJS,1);
 print '</td><td align="right">';
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
 print "</td></tr>\n";
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index eae46e76893d5c6dad31b897ef24b6baca3f3b08..51d0a6174c855470f6a81d6bbb3232b3450c04e7 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -170,7 +170,7 @@ if ($action == 'edit')	// Edit
 	// Multilangual GUI
     $var=!$var;
     print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableMultilangInterface").'</td><td>';
-    print Form::selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
+    print $form->selectyesno('main_multilangs',$conf->global->MAIN_MULTILANGS,1);
     print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
@@ -191,7 +191,7 @@ if ($action == 'edit')	// Edit
         {
             $var=!$var;
             print '<tr '.$bc[$var].'><td width="35%">'.$searchformtitle[$key].'</td><td colspan="2">';
-            print Form::selectyesno($searchform[$key],$searchformconst[$key],1);
+            print $form->selectyesno($searchform[$key],$searchformconst[$key],1);
             print '</td></tr>';
         }
         print '</table>';
@@ -207,7 +207,7 @@ if ($action == 'edit')	// Edit
 	// Show logo
     $var=!$var;
     print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("EnableShowLogo").'</td><td>';
-    print Form::selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
+    print $form->selectyesno('MAIN_SHOW_LOGO',$conf->global->MAIN_SHOW_LOGO,1);
     print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
@@ -227,7 +227,7 @@ if ($action == 'edit')	// Edit
     // Disable javascript and ajax
     $var=!$var;
     print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableJavascript").'</td><td>';
-    print Form::selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
+    print $form->selectyesno('main_disable_javascript',isset($conf->global->MAIN_DISABLE_JAVASCRIPT)?$conf->global->MAIN_DISABLE_JAVASCRIPT:0,1);
     print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
@@ -237,7 +237,7 @@ if ($action == 'edit')	// Edit
 	{
 	    $var=!$var;
 	    print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("UsePreviewTabs").'</td><td>';
-	    print Form::selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
+	    print $form->selectyesno('MAIN_USE_PREVIEW_TABS',isset($conf->global->MAIN_USE_PREVIEW_TABS)?$conf->global->MAIN_USE_PREVIEW_TABS:0,1);
 	    print '</td>';
 		print '<td width="20">&nbsp;</td>';
 		print '</tr>';
@@ -279,7 +279,7 @@ if ($action == 'edit')	// Edit
 	// Hide unauthorized button
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ButtonHideUnauthorized").'</td><td>';
-	print Form::selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
+	print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED',isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)?$conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED:0,1);
 	print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
@@ -287,7 +287,7 @@ if ($action == 'edit')	// Edit
     // Hide helpcenter link on login page
     $var=!$var;
     print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelpCenter").'</td><td>';
-    print Form::selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
+    print $form->selectyesno('MAIN_HELPCENTER_DISABLELINK',isset($conf->global->MAIN_HELPCENTER_DISABLELINK)?$conf->global->MAIN_HELPCENTER_DISABLELINK:0,1);
     print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
@@ -295,7 +295,7 @@ if ($action == 'edit')	// Edit
 	// Hide wiki link on login page
     $var=!$var;
     print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/helpdoc.png','',1)).'</td><td>';
-    print Form::selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
+    print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK)?$conf->global->MAIN_HELP_DISABLELINK:0,1);
     print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
@@ -303,7 +303,7 @@ if ($action == 'edit')	// Edit
 	// Show bugtrack link
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")).'</td><td>';
-	print Form::selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
+	print $form->selectyesno('MAIN_BUGTRACK_ENABLELINK',$conf->global->MAIN_BUGTRACK_ENABLELINK,1);
 	print '</td>';
 	print '<td width="20">&nbsp;</td>';
 	print '</tr>';
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index b24d3e02111bedf6ad62a3e820b016b9c891943e..52324dc167882c42f8c5623bde24fbfc28a829d1 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -343,7 +343,7 @@ if ($action == 'edit')
 	// Disable
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_DISABLE_ALL_MAILS").'</td><td>';
-	print Form::selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1);
+	print $form->selectyesno('MAIN_DISABLE_ALL_MAILS',$conf->global->MAIN_DISABLE_ALL_MAILS,1);
 	print '</td></tr>';
 
 	// Separator
@@ -482,7 +482,7 @@ if ($action == 'edit')
 	{
 		if (function_exists('openssl_open'))
 		{
-			print Form::selectyesno('MAIN_MAIL_EMAIL_TLS',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS)?$conf->global->MAIN_MAIL_EMAIL_TLS:0),1);
+			print $form->selectyesno('MAIN_MAIL_EMAIL_TLS',(! empty($conf->global->MAIN_MAIL_EMAIL_TLS)?$conf->global->MAIN_MAIL_EMAIL_TLS:0),1);
 		}
 		else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
 	}
@@ -496,7 +496,7 @@ if ($action == 'edit')
 	{
 		if (function_exists('openssl_open'))
 		{
-			print Form::selectyesno('MAIN_MAIL_EMAIL_STARTTLS',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS:0),1);
+			print $form->selectyesno('MAIN_MAIL_EMAIL_STARTTLS',(! empty($conf->global->MAIN_MAIL_EMAIL_STARTTLS)?$conf->global->MAIN_MAIL_EMAIL_STARTTLS:0),1);
 		}
 		else print yn(0).' ('.$langs->trans("YourPHPDoesNotHaveSSLSupport").')';
 	}
diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php
index 15b47d5efe820c0821b912782343b53acd91e210..7da0673b196f196920fffda0ee6160da6071fe31 100644
--- a/htdocs/admin/menus/index.php
+++ b/htdocs/admin/menus/index.php
@@ -249,7 +249,7 @@ if ($action == 'delete')
 	$result = $db->query($sql);
 	$obj = $db->fetch_object($result);
 
-    print Form::formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete");
+    print $form->formconfirm("index.php?menu_handler=".$menu_handler."&menuId=".$_GET['menuId'],$langs->trans("DeleteMenu"),$langs->trans("ConfirmDeleteMenu",$obj->titre),"confirm_delete");
 }
 
 
diff --git a/htdocs/admin/multicurrency.php b/htdocs/admin/multicurrency.php
index 7012aebfda3fcb415c5c6720241a35273cf5992f..b1ad347d8b71728930dba2e909400bce2d1f02ff 100644
--- a/htdocs/admin/multicurrency.php
+++ b/htdocs/admin/multicurrency.php
@@ -173,7 +173,7 @@ print '<td align="right" width="400">';
 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_MULTICURRENCY_USE_RATE_ON_INVOICE_DATE">';
-print Form::selectyesno("MULTICURRENCY_USE_RATE_ON_INVOICE_DATE",$conf->global->MULTICURRENCY_USE_RATE_ON_INVOICE_DATE,1);
+print $form->selectyesno("MULTICURRENCY_USE_RATE_ON_INVOICE_DATE",$conf->global->MULTICURRENCY_USE_RATE_ON_INVOICE_DATE,1);
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print '</form>';
 print '</td></tr>';
@@ -186,7 +186,7 @@ print '<td align="right" width="400">';
 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_MULTICURRENCY_USE_ORIGIN_TX">';
-print Form::selectyesno("MULTICURRENCY_USE_ORIGIN_TX",$conf->global->MULTICURRENCY_USE_ORIGIN_TX,1);
+print $form->selectyesno("MULTICURRENCY_USE_ORIGIN_TX",$conf->global->MULTICURRENCY_USE_ORIGIN_TX,1);
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print '</form>';
 print '</td></tr>';
@@ -199,7 +199,7 @@ print '<td align="right" width="400">';
 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_MULTICURRENCY_BUY_PRICE_IN_CURRENCY">';
-print Form::selectyesno("MULTICURRENCY_BUY_PRICE_IN_CURRENCY",$conf->global->MULTICURRENCY_BUY_PRICE_IN_CURRENCY,1);
+print $form->selectyesno("MULTICURRENCY_BUY_PRICE_IN_CURRENCY",$conf->global->MULTICURRENCY_BUY_PRICE_IN_CURRENCY,1);
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print '</form>';
 print '</td></tr>';
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index 429b6003a442f282ee32f3791c5e286285a98513..3b968af09c3206cef212245f2523bce0e8d07f73 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -139,7 +139,7 @@ if ($action == 'edit')	// Edit
     // Hide VAT Intra on address
     $var=!$var;
     print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowVATIntaInAddress").'</td><td>';
-    print Form::selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
+    print $form->selectyesno('MAIN_TVAINTRA_NOT_IN_ADDRESS',(! empty($conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS))?$conf->global->MAIN_TVAINTRA_NOT_IN_ADDRESS:0,1);
     print '</td></tr>';
 
     // Show prof id 1 in address into pdf
@@ -156,7 +156,7 @@ if ($action == 'edit')	// Edit
     if ($pid1)
     {
     	print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid1.'</td><td>';
-    	print Form::selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode);
+    	print $form->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1,$noCountryCode);
     	print '</td></tr>';
     }
 
@@ -174,7 +174,7 @@ if ($action == 'edit')	// Edit
     if ($pid2)
     {
     	print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid2.'</td><td>';
-    	print Form::selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode);
+    	print $form->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1,$noCountryCode);
     	print '</td></tr>';
     }
 
@@ -192,7 +192,7 @@ if ($action == 'edit')	// Edit
     if ($pid3)
     {
     	print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid3.'</td><td>';
-    	print Form::selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode);
+    	print $form->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1,$noCountryCode);
     	print '</td></tr>';
     }
 
@@ -210,7 +210,7 @@ if ($action == 'edit')	// Edit
     if ($pid4)
     {
     	print '<tr '.$bc[$var].'><td>'.$langs->trans("ShowProfIdInAddress").' - '.$pid4.'</td><td>';
-    	print Form::selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode);
+    	print $form->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1,$noCountryCode);
     	print '</td></tr>';
     }
 
@@ -227,31 +227,31 @@ if ($action == 'edit')	// Edit
     // Hide any PDF informations
     $var=!$var;
     print '<tr '.$bc[$var].'><td>'.$langs->trans("HideAnyVATInformationOnPDF").'</td><td>';
-	print Form::selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
+	print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))?$conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT:0,1);
     print '</td></tr>';
 
     //Desc
     $var=!$var;
     print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
-    print Form::selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
+    print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC:0,1);
     print '</td></tr>';
 
     //Ref
     $var=!$var;
     print '<tr '.$bc[$var].'><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
-    print Form::selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
+    print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_REF',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF:0,1);
     print '</td></tr>';
 
     //Details
     $var=!$var;
     print '<tr '.$bc[$var].'><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
-    print Form::selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
+    print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS',(! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS))?$conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS:0,1);
     print '</td></tr>';
 
  	// Place customer adress to the ISO location
     $var=!$var;
     print '<tr '.$bc[$var].'><td>'.$langs->trans("PlaceCustomerAddressToIsoLocation").'</td><td>';
-	print Form::selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
+	print $form->selectyesno('MAIN_PDF_USE_ISO_LOCATION',(! empty($conf->global->MAIN_PDF_USE_ISO_LOCATION))?$conf->global->MAIN_PDF_USE_ISO_LOCATION:0,1);
     print '</td></tr>';
 
 
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index 20c09360edbf67fd59cf46ec8f92d25884643a31..b4f1fe67e0b60b97a1aabd246e889f56d00927fb 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -565,7 +565,7 @@ print '<input type="hidden" name="action" value="setusecustomercontactasrecipien
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("UseCustomerContactAsPropalRecipientIfExist");
 print '</td><td width="60" align="center">';
-print Form::selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1);
+print $form->selectyesno("value",$conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT,1);
 print '</td><td align="right">';
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print "</td></tr>\n";
diff --git a/htdocs/admin/proxy.php b/htdocs/admin/proxy.php
index 1a9eebcaf70e4be673428b8b68f8b07222fe4e14..1f6e45223b48b14cc894cfd14c0dbe02f39a0cea 100644
--- a/htdocs/admin/proxy.php
+++ b/htdocs/admin/proxy.php
@@ -158,7 +158,7 @@ print '<tr '.$bc[$var].'>';
 print '<td>'.$langs->trans("MAIN_PROXY_USE").'</td><td align="right">';
 print '</td>';
 print '<td class="nowrap">';
-print Form::selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1);
+print $form->selectyesno('MAIN_PROXY_USE',$conf->global->MAIN_PROXY_USE,1);
 print '</td>';
 print '</tr>';
 
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index 7943db2fbb4baaad4c3e708cd5b470cecc1173a6..05fe548daffff4f2ab65ef2d87c30015480bf0df 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -177,7 +177,7 @@ if ($action == 'edit')
 	// Disable
 	$var=!$var;
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("MAIN_DISABLE_ALL_SMS").'</td><td>';
-	print Form::selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1);
+	print $form->selectyesno('MAIN_DISABLE_ALL_SMS',$conf->global->MAIN_DISABLE_ALL_SMS,1);
 	print '</td></tr>';
 
 	// Separator
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index 8613c99e04a248aad8fe7dbdb74f15bca04fe4dc..98ff43360a8d2c732900be8f6bda73a65f26eb56 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -150,7 +150,7 @@ if (! empty($conf->facture->enabled))
     print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_BILL\">";
-	print Form::selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
+	print $form->selectyesno("STOCK_CALCULATE_ON_BILL",$conf->global->STOCK_CALCULATE_ON_BILL,1,$disabled);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
 	print "</form>\n";
 }
@@ -170,7 +170,7 @@ if (! empty($conf->commande->enabled))
     print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_VALIDATE_ORDER\">";
-	print Form::selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
+	print $form->selectyesno("STOCK_CALCULATE_ON_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_VALIDATE_ORDER,1,$disabled);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
 	print "</form>\n";
 }
@@ -192,7 +192,7 @@ if (! empty($conf->expedition->enabled))
 	print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SHIPMENT\">";
-	print Form::selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
+	print $form->selectyesno("STOCK_CALCULATE_ON_SHIPMENT",$conf->global->STOCK_CALCULATE_ON_SHIPMENT,1,$disabled);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
 	print "</form>\n";
 }
@@ -234,7 +234,7 @@ if (! empty($conf->fournisseur->enabled))
     print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_BILL\">";
-	print Form::selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
+	print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_BILL",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_BILL,1,$disabled);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
 	print "</form>\n";
 }
@@ -255,7 +255,7 @@ if (! empty($conf->fournisseur->enabled))
     print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER\">";
-	print Form::selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
+	print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER,1,$disabled);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
 	print "</form>\n";
 }
@@ -275,7 +275,7 @@ if (! empty($conf->fournisseur->enabled))
     print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER\">";
-	print Form::selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
+	print $form->selectyesno("STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER",$conf->global->STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER,1,$disabled);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'"'.$disabled.'>';
 	print "</form>\n";
 }
@@ -314,7 +314,7 @@ if ($conf->invoice->enabled || $conf->order->enabled || $conf->expedition->enabl
 		print "<form method=\"post\" action=\"stock.php\">";
 		print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 		print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_INVOICE\">";
-		print Form::selectyesno("STOCK_MUST_BE_ENOUGH_FOR_INVOICE",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE,1);
+		print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_INVOICE",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE,1);
 		print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 		print '</form>';
 		print "</td>\n";
@@ -329,7 +329,7 @@ if ($conf->invoice->enabled || $conf->order->enabled || $conf->expedition->enabl
 		print "<form method=\"post\" action=\"stock.php\">";
 		print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 		print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_ORDER\">";
-		print Form::selectyesno("STOCK_MUST_BE_ENOUGH_FOR_ORDER",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER,1);
+		print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_ORDER",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER,1);
 		print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 		print '</form>';
 		print "</td>\n";
@@ -344,7 +344,7 @@ if ($conf->invoice->enabled || $conf->order->enabled || $conf->expedition->enabl
 		print "<form method=\"post\" action=\"stock.php\">";
 		print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 		print "<input type=\"hidden\" name=\"action\" value=\"STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT\">";
-		print Form::selectyesno("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT,1);
+		print $form->selectyesno("STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT",$conf->global->STOCK_MUST_BE_ENOUGH_FOR_SHIPMENT,1);
 		print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 		print '</form>';
 		print "</td>\n";
@@ -373,7 +373,7 @@ if ($virtualdiffersfromphysical)
 	print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USE_VIRTUAL_STOCK\">";
-	print Form::selectyesno("STOCK_USE_VIRTUAL_STOCK",$conf->global->STOCK_USE_VIRTUAL_STOCK,1);
+	print $form->selectyesno("STOCK_USE_VIRTUAL_STOCK",$conf->global->STOCK_USE_VIRTUAL_STOCK,1);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 	print '</form>';
 	print "</td>\n";
@@ -399,7 +399,7 @@ print '<td width="160" align="right">';
 print "<form method=\"post\" action=\"stock.php\">";
 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 print "<input type=\"hidden\" name=\"action\" value=\"STOCK_USERSTOCK_AUTOCREATE\">";
-print Form::selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
+print $form->selectyesno("STOCK_USERSTOCK_AUTOCREATE",$conf->global->STOCK_USERSTOCK_AUTOCREATE,1);
 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 print '</form>';
 print "</td>\n";
@@ -419,7 +419,7 @@ if ($conf->global->PRODUIT_SOUSPRODUITS)
 	print "<form method=\"post\" action=\"stock.php\">";
 	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 	print "<input type=\"hidden\" name=\"action\" value=\"INDEPENDANT_SUBPRODUCT_STOCK\">";
-	print Form::selectyesno("INDEPENDANT_SUBPRODUCT_STOCK",$conf->global->INDEPENDANT_SUBPRODUCT_STOCK,1);
+	print $form->selectyesno("INDEPENDANT_SUBPRODUCT_STOCK",$conf->global->INDEPENDANT_SUBPRODUCT_STOCK,1);
 	print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
 	print '</form>';
 	print "</td>\n";
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index beb92688ad536504f5f190bad899be0230b1a527..4ba759a66fa7ef2aa5b1edf936c62a790095d4cc 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -180,7 +180,7 @@ if ($result)
 	if ($action == 'purge')
 	{
 		$formquestion=array();
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeAuditEvents'), $langs->trans('ConfirmPurgeAuditEvents'),'confirm_purge',$formquestion,'no',1);
 	}
 	
 	print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
@@ -198,7 +198,7 @@ if ($result)
 	// Lignes des champs de filtres
 	print '<tr class="liste_titre">';
 
-	print '<td class="liste_titre" width="15%">'.Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
+	print '<td class="liste_titre" width="15%">'.$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).$form->select_date($date_end,'date_end',0,0,0,'',1,0,1).'</td>';
 
 	print '<td align="left" class="liste_titre">';
 	print '<input class="flat" type="text" size="10" name="search_code" value="'.$search_code.'">';
diff --git a/htdocs/admin/tools/listsessions.php b/htdocs/admin/tools/listsessions.php
index 0d0f10e9bc8104a37a22a56ff29cba1044a23da3..c313c91a7bd15b6f0bd4ac6bf5834dffc58af70e 100644
--- a/htdocs/admin/tools/listsessions.php
+++ b/htdocs/admin/tools/listsessions.php
@@ -116,12 +116,12 @@ print '<br>';
 if ($action == 'purge')
 {
 	$formquestion=array();
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2);
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('PurgeSessions'), $langs->trans('ConfirmPurgeSessions'),'confirm_purge',$formquestion,'no',2);
 }
 else if ($action == 'lock')
 {
 	$formquestion=array();
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1);
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?noparam=noparam', $langs->trans('LockNewSessions'), $langs->trans('ConfirmLockNewSessions',$user->login),'confirm_lock',$formquestion,'no',1);
 }
 
 if ($savehandler == 'files')
diff --git a/htdocs/admin/tools/purge.php b/htdocs/admin/tools/purge.php
index f0e62f659982cdff1a0b7613bb367cd0a8812334..170c37a79bf1098ec359d6c56a0da33e50ed9a52 100644
--- a/htdocs/admin/tools/purge.php
+++ b/htdocs/admin/tools/purge.php
@@ -108,7 +108,7 @@ if (preg_match('/^confirm/i',$choice))
 {
 	print '<br>';
 	$formquestion=array();
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2);
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2);
 }
 
 
diff --git a/htdocs/admin/websites.php b/htdocs/admin/websites.php
index 80a5b440a246f47fe4028c6547a7522920379d90..de4c0472f6267e005b834d0afdc33d9b6fd021c5 100644
--- a/htdocs/admin/websites.php
+++ b/htdocs/admin/websites.php
@@ -321,7 +321,7 @@ print "<br>\n";
 // Confirmation de la suppression de la ligne
 if ($action == 'delete')
 {
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&id='.$id, $langs->trans('DeleteWebsite'), $langs->trans('ConfirmDeleteWebsite'), 'confirm_delete','',0,1);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&id='.$id, $langs->trans('DeleteWebsite'), $langs->trans('ConfirmDeleteWebsite'), 'confirm_delete','',0,1);
 }
 //var_dump($elementList);
 
diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php
index c6c7548b851933af3dbc8fe868239a7aa37071d7..de60e8b80cf722a9d6b70a3a01b82d70ef3cb828 100644
--- a/htdocs/cashdesk/admin/cashdesk.php
+++ b/htdocs/cashdesk/admin/cashdesk.php
@@ -132,7 +132,7 @@ if (! empty($conf->stock->enabled))
 	print '<tr '.$bc[$var].'><td>'.$langs->trans("CashDeskDoNotDecreaseStock").'</td>';	// Force warehouse (this is not a default value)
 	print '<td colspan="2">';
 	if (empty($conf->productbatch->enabled)) {
-	   print Form::selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
+	   print $form->selectyesno('CASHDESK_NO_DECREASE_STOCK',$conf->global->CASHDESK_NO_DECREASE_STOCK,1);
 	}
 	else
 	{
@@ -166,7 +166,7 @@ if (! empty($conf->service->enabled))
     print '<tr '.$bc[$var].'><td>';
     print $langs->trans("CashdeskShowServices");
     print '<td colspan="2">';
-    print Form::selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
+    print $form->selectyesno("CASHDESK_SERVICES",$conf->global->CASHDESK_SERVICES,1);
     print "</td></tr>\n";
 }
 
@@ -177,7 +177,7 @@ if (! empty($conf->receiptprinter->enabled))
     print '<tr '.$bc[$var].'><td>';
     print $langs->trans("DolibarrReceiptPrinter").' ('.$langs->trans("FeatureNotYetAvailable").')';
     print '<td colspan="2">';
-    print Form::selectyesno("CASHDESK_DOLIBAR_RECEIPT_PRINTER",$conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER,1);
+    print $form->selectyesno("CASHDESK_DOLIBAR_RECEIPT_PRINTER",$conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER,1);
     print "</td></tr>\n";
 }
 
diff --git a/htdocs/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php
index 92db0df15fba9a3ad0df2e91495881ce2f95218e..ecb11c3e6ee3e8fa3a94c9a8e1a5dbdd3dfc55a4 100644
--- a/htdocs/cashdesk/tpl/facturation1.tpl.php
+++ b/htdocs/cashdesk/tpl/facturation1.tpl.php
@@ -43,10 +43,10 @@ $langs->load("cashdesk");
 			<tr>
 			<!-- Affichage de la reference et de la designation -->
 			<td><input class="texte_ref" type="text" id ="txtRef" name="txtRef" value="<?php echo $obj_facturation->ref() ?>"
-				onchange="setSource('REF');"
-				onkeyup="verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
-				onfocus="this.select(); verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
-				onBlur="document.getElementById('resultats_dhtml').innerHTML = '';"/>
+				onchange="javascript: setSource('REF');"
+				onkeyup="javascript: verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
+				onfocus="javascript: this.select(); verifResultat('resultats_dhtml', this.value, <?php echo (isset($conf->global->BARCODE_USE_SEARCH_TO_SELECT) ? (int) $conf->global->BARCODE_USE_SEARCH_TO_SELECT : 1) ?>);"
+				onBlur="javascript: document.getElementById('resultats_dhtml').innerHTML = '';"/>
 			</td>
 			<td class="select_design">
             <?php /*
@@ -60,7 +60,7 @@ $langs->load("cashdesk");
             */
             ?>
 
-				<select id="selProduit" name="selProduit" onchange="setSource('LISTE');">
+				<select id="selProduit" name="selProduit" onchange="javascript: setSource('LISTE');">
 					<?php
                         print '<option value="0">'.$top_liste_produits.'</option>'."\n";
 
@@ -93,7 +93,7 @@ $langs->load("cashdesk");
 		</table>
 	</form>
 
-	<form id="frmQte" class="formulaire1" method="post" action="facturation_verif.php?action=ajout_article" onsubmit ="return verifSaisie();">
+	<form id="frmQte" class="formulaire1" method="post" action="facturation_verif.php?action=ajout_article" onsubmit ="javascript: return verifSaisie();">
 		<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
 		<table>
 			<tr><th><?php echo $langs->trans("Qty"); ?></th>
@@ -106,7 +106,7 @@ $langs->load("cashdesk");
             <th><?php echo $langs->trans("VATRate"); ?></th>
             </tr>
 			<tr>
-				<td><input class="texte1" type="text" id="txtQte" name="txtQte" value="1" onkeyup="modif();" onfocus="this.select();" />
+				<td><input class="texte1" type="text" id="txtQte" name="txtQte" value="1" onkeyup="javascript: modif();" onfocus="javascript: this.select();" />
 <?php print genkeypad("txtQte", "frmQte");?>
 				</td>
 				<!-- Affichage du stock pour l'article courant -->
@@ -115,10 +115,10 @@ $langs->load("cashdesk");
 				</td>
 				<!-- Show unit price -->
 				<?php // TODO Remove the disabled and use this value when adding product into cart ?>
-				<td><input class="texte1_off" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="modif();" disabled /></td>
+				<td><input class="texte1_off" type="text" name="txtPrixUnit" value="<?php echo price2num($obj_facturation->prix(), 'MU'); ?>" onchange="javascript: modif();" disabled /></td>
 				<td></td>
     			<!-- Choix de la remise -->
-    			<td><input class="texte1" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="modif();" onfocus="this.select();"/>
+    			<td><input class="texte1" type="text" id="txtRemise" name="txtRemise" value="0" onkeyup="javascript: modif();" onfocus="javascript: this.select();"/>
 					<?php print genkeypad("txtRemise", "frmQte");?>
     			</td>
     			<!-- Affichage du total HT -->
@@ -126,7 +126,7 @@ $langs->load("cashdesk");
                 <!-- Choix du taux de TVA -->
                 <td class="select_tva">
                 <?php //var_dump($tab_tva); ?>
-                <select name="selTva" onchange="modif();" >
+                <select name="selTva" onchange="javascript: modif();" >
                     <?php
                         $tva_tx = $obj_facturation->tva();  // Try to get a previously entered VAT rowid. First time, this will return empty.
 
@@ -151,7 +151,7 @@ $langs->load("cashdesk");
 </fieldset>
 
 <!-- ========================= Cadre "Amount" ============================= -->
-<form id="frmDifference" class="formulaire1" method="post" onsubmit="return verifReglement()" action="validation_verif.php?action=valide_achat">
+<form id="frmDifference"  class="formulaire1" method="post" onsubmit="javascript: return verifReglement()" action="validation_verif.php?action=valide_achat">
 	<input type="hidden" name="hdnChoix" value="" />
 	<input type="hidden" name="token" value="<?php echo $_SESSION['newtoken']; ?>" />
 <fieldset class="cadre_facturation"><legend class="titre1"><?php echo $langs->trans("Amount"); ?></legend>
@@ -161,7 +161,7 @@ $langs->load("cashdesk");
 			<!-- Affichage du montant du -->
 			<td><input class="texte2_off" type="text" name="txtDu" value="<?php echo price2num($obj_facturation->prixTotalTtc(), 'MT'); ?>" disabled /></td>
 			<!-- Choix du montant encaisse -->
-			<td><input class="texte2" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="verifDifference();" onfocus="this.select();" />
+			<td><input class="texte2" type="text" id="txtEncaisse" name="txtEncaisse" value="" onkeyup="javascript: verifDifference();" onfocus="javascript: this.select();" />
 <?php print genkeypad("txtEncaisse", "frmDifference");?>
 			</td>
 			<!-- Affichage du montant rendu -->
@@ -201,10 +201,10 @@ $langs->load("cashdesk");
 			print '<div class="clearboth">';
 			print '<div class="inline-block" style="margin: 6px;">';
 			?>
-				<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="verifClic('DIF');" />
+				<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="javascript: verifClic('DIF');" />
 			<?php
 			print $langs->trans("DateEcheance").' :';
-			print Form::selectDate(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0,1);
+			print $form->select_date(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0,1);
 			print '</div>';
 			?>
 		</div>
diff --git a/htdocs/categories/categorie.php b/htdocs/categories/categorie.php
index cf582ba749ad4cbe7c8dea8180174e7838a3badd..1775c14767dd47297967f4d04a892f4fd5eb972d 100644
--- a/htdocs/categories/categorie.php
+++ b/htdocs/categories/categorie.php
@@ -248,7 +248,7 @@ if ($socid)
 	print '<table class="border" width="100%">';
 
 	print '<tr><td width="25%">'.$langs->trans("ThirdPartyName").'</td><td colspan="3">';
-	print Form::showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom','','&type='.$type);
+	print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom','','&type='.$type);
 	print '</td></tr>';
 
 	// Alias names (commercial, trademark or alias names)
@@ -358,7 +358,7 @@ else if ($id || $ref)
 		// Ref
 		print "<tr>";
 		print '<td width="15%">'.$langs->trans("Ref").'</td><td>';
-		print Form::showrefnav($product,'ref','',1,'ref');
+		print $form->showrefnav($product,'ref','',1,'ref');
 		print '</td>';
 		print '</tr>';
 
@@ -418,7 +418,7 @@ else if ($id || $ref)
 		// Ref
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 		print '<td class="valeur">';
-		print Form::showrefnav($member,'id','','1','rowid','ref','','&type='.$type);
+		print $form->showrefnav($member,'id','','1','rowid','ref','','&type='.$type);
 		print '</td></tr>';
 
         // Login
@@ -492,7 +492,7 @@ else if ($id || $ref)
 		// Ref
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 		print '<td class="valeur">';
-		print Form::showrefnav($object,'rowid');
+		print $form->showrefnav($object,'rowid');
 		print '</td></tr>';
 
 	  // Name
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index 6560c0a6ed6a4e351cd335f2fb951ad7052c2eb4..f3a84eed5d5eb9f54f7176ec2c3191a424ea703d 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -108,7 +108,7 @@ if ($object->id)
 	*/
 	if ($action == 'delete')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&type='.$type.'&file='.$_GET["file"], $langs->trans('DeletePicture'), $langs->trans('ConfirmDeletePicture'), 'confirm_delete', '', 0, 1);
 	}
 
 	print($mesg);
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index a72f8a803f3272f45b6b30034d958dd4d5593946..a1486ff344ff9707a7bdbd3f84a87effe3b0c587 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -182,7 +182,7 @@ dol_fiche_head($head, 'card', $title, 0, 'category');
 
 if ($action == 'delete')
 {
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete');
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;type='.$type,$langs->trans('DeleteCategory'),$langs->trans('ConfirmDeleteCategory'),'confirm_delete');
 }
 
 print '<table border="0" width="100%" class="border">';
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 0ae79ff88f28ee4f424432ab039c38129914f6a3..19633aa13d723371323657b1150103380b977016 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -665,9 +665,9 @@ if ($action == 'create')
 	$datep=($datep?$datep:$object->datep);
 	if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0);
 	print '<tr><td width="30%" class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td>';
-	if (GETPOST("afaire") == 1) Form::selectDate($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend');
-	else if (GETPOST("afaire") == 2) Form::selectDate($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend');
-	else Form::selectDate($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
+	if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend');
+	else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend');
+	else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
 	print '</td></tr>';
 
 	// Date end
@@ -678,9 +678,9 @@ if ($action == 'create')
 		$datef=dol_time_plus_duree($datep, $conf->global->AGENDA_AUTOSET_END_DATE_WITH_DELTA_HOURS, 'h');
 	}
 	print '<tr><td><span id="dateend"'.(GETPOST("actioncode") == 'AC_RDV'?' class="fieldrequired"':'').'>'.$langs->trans("DateActionEnd").'</span></td><td>';
-	if (GETPOST("afaire") == 1) Form::selectDate($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
-	else if (GETPOST("afaire") == 2) Form::selectDate($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
-	else Form::selectDate($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+	if (GETPOST("afaire") == 1) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+	else if (GETPOST("afaire") == 2) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+	else $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
 	print '</td></tr>';
 
 	// Status
@@ -893,7 +893,7 @@ if ($id > 0)
 	// Confirmation suppression action
 	if ($action == 'delete')
 	{
-		print Form::formconfirm("card.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1);
+		print $form->formconfirm("card.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1);
 	}
 
 	if ($action == 'edit')
@@ -955,16 +955,16 @@ if ($id > 0)
 
 		// Date start
 		print '<tr><td class="nowrap"><span class="fieldrequired">'.$langs->trans("DateActionStart").'</span></td><td colspan="3">';
-		if (GETPOST("afaire") == 1) Form::selectDate($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
-		else if (GETPOST("afaire") == 2) Form::selectDate($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
-		else Form::selectDate($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
+		if (GETPOST("afaire") == 1) $form->select_date($datep?$datep:$object->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart');
+		else if (GETPOST("afaire") == 2) $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
+		else $form->select_date($datep?$datep:$object->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart');
 		print '</td></tr>';
 		// Date end
 		print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
-		if (GETPOST("afaire") == 1) Form::selectDate($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
-		else if (GETPOST("afaire") == 2) Form::selectDate($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
-		//else Form::selectDate($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend','ap');
-		else Form::selectDate($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+		if (GETPOST("afaire") == 1) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+		else if (GETPOST("afaire") == 2) $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
+		//else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend','ap');
+		else $form->select_date($datef?$datef:$object->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend');
 		print '</td></tr>';
 
 		$userepeatevent=0;	// Dev in progress
@@ -1168,7 +1168,7 @@ if ($id > 0)
 		// Clone event
 		if($action == 'clone')
 		{
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
 
 			print $formconfirm;
 		}
@@ -1180,7 +1180,7 @@ if ($id > 0)
 
 		// Ref
 		print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
-		print Form::showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
+		print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
 		print '</td></tr>';
 
 		// Type
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 349a94511ed7b036fb4e2eb1877f24cde6d89fb1..992c23144462c385264049a9acc791f0d81ae41d 100644
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -130,7 +130,7 @@ if ($object->id > 0)
 
 	// Ref
 	print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
+	print $form->showrefnav($object, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
 	print '</td></tr>';
 
 	// Type
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index 1ad1374da6a422beebc3a8a2d196d883daa462f6..ed8227a1cb8431ed83397abacb055668bb679371 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -142,7 +142,7 @@ $form=new Form($db);
 $userstatic=new User($db);
 
 $nav='';
-$nav.=Form::selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
+$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
 $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
 
 $now=dol_now();
@@ -320,10 +320,10 @@ if ($resql)
 	    //print '<td class="liste_titre"><input type="text" name="search_type" value="'.$search_type.'"></td>';
 	}
 	print '<td class="liste_titre" align="center">';
-	print Form::selectDate($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
+	print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
 	print '</td>';
 	print '<td class="liste_titre" align="center">';
-	print Form::selectDate($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1);
+	print $form->select_date($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1);
 	print '</td>';
 	print '<td class="liste_titre"></td>';
 	print '<td class="liste_titre"></td>';
diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php
index f0b5df726fe076d483ce0b485f4e14f9806762b2..28a531c6b28fbfaf5bfc39435375e669502eaefa 100644
--- a/htdocs/comm/action/pertype.php
+++ b/htdocs/comm/action/pertype.php
@@ -261,7 +261,7 @@ $nav.='<input type="hidden" name="begin_d" value="' . $begin_d . '">';
 $nav.='<input type="hidden" name="end_d" value="' . $end_d . '">';
 $nav.='<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
 
-$nav.=Form::selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
+$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
 $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
 $nav.='</form>';
 
diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php
index aa588d7a837e94a044bc5ea5989345c15163d8ca..621d3ada57ab8501c14599cd4442011a1d7dc6d4 100644
--- a/htdocs/comm/action/peruser.php
+++ b/htdocs/comm/action/peruser.php
@@ -264,7 +264,7 @@ $nav.='<input type="hidden" name="begin_d" value="' . $begin_d . '">';
 $nav.='<input type="hidden" name="end_d" value="' . $end_d . '">';
 $nav.='<input type="hidden" name="showbirthday" value="' . $showbirthday . '">';
 
-$nav.=Form::selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
+$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
 $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
 $nav.='</form>';
 
diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php
index 18341fbeaef40fc997b510fac142129131532914..edb5042e358d242c6c6ec96aa26e92bf1ed95796 100644
--- a/htdocs/comm/address.php
+++ b/htdocs/comm/address.php
@@ -413,7 +413,7 @@ else
     // Confirmation delete
     if ($action == 'delete')
     {
-        print Form::formconfirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&amp;id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete");
+        print $form->formconfirm($_SERVER['PHP_SELF']."?socid=".$object->socid."&amp;id=".$id,$langs->trans("DeleteAddress"),$langs->trans("ConfirmDeleteAddress"),"confirm_delete");
     }
 
     $nblines = count($object->lines);
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index a687b9a814d3005b3a75301c48537c8eb9c9bb82..3988a986f674f222321981d130b3375245d08eef 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -255,9 +255,9 @@ if ($id > 0)
 
 		print '<tr>';
 		print '<td>';
-		print Form::editfieldkey("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
+		print $form->editfieldkey("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
 		print '</td><td colspan="3">';
-		print Form::editfieldval("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
+		print $form->editfieldval("CustomerAccountancyCode",'customeraccountancycode',$object->code_compta,$object,$user->rights->societe->creer);
 		print '</td>';
 		print '</tr>';
 	}
@@ -371,10 +371,10 @@ if ($id > 0)
 	{
 		print '<tr>';
 		print '<td>';
-		print Form::editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
+		print $form->editfieldkey("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer);
 		print '</td><td colspan="3">';
 		$limit_field_type = (! empty($conf->global->MAIN_USE_JQUERY_JEDITABLE)) ? 'numeric' : 'amount';
-		print Form::editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
+		print $form->editfieldval("OutstandingBill",'outstanding_limit',$object->outstanding_limit,$object,$user->rights->societe->creer,$limit_field_type,($object->outstanding_limit != '' ? price($object->outstanding_limit) : ''));
 		if (empty($object->outstanding_limit)) print $langs->trans("NoLimit");
 		
 		print '</td>';
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 3f5ac72355b02e838f837318a717ed18e5442d7e..9a7d0349f41b4a31f1b3a573f8e77efebc892463 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -726,17 +726,17 @@ else
 		// Confirmation de la validation du mailing
 		if ($action == 'valid')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ValidMailing"),$langs->trans("ConfirmValidMailing"),"confirm_valid",'','',1);
 		}
 		// Confirm reset
 		else if ($action == 'reset')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ResetMailing"),$langs->trans("ConfirmResetMailing",$object->ref),"confirm_reset",'','',2);
 		}
 		// Confirm delete
 		else if ($action == 'delete')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1);
 		}
 
 
@@ -783,7 +783,7 @@ else
                     }
 				    $text.=$langs->trans('ConfirmSendingEmailing').'<br>';
 					$text.=$langs->trans('LimitSendingEmailing',$conf->global->MAILING_LIMIT_SENDBYWEB);
-					print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,270);
+					print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('SendMailing'),$text,'sendallconfirmed',$formquestion,'',1,270);
 				}
 			}
 
@@ -793,22 +793,22 @@ else
 
 			print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 			print '<td colspan="3">';
-			print Form::showrefnav($object,'id', $linkback);
+			print $form->showrefnav($object,'id', $linkback);
 			print '</td></tr>';
 
 			// Description
-			print '<tr><td>'.Form::editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
-			print Form::editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
+			print '<tr><td>'.$form->editfieldkey("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
+			print $form->editfieldval("MailTitle",'titre',$object->titre,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
 			print '</td></tr>';
 
 			// From
-			print '<tr><td>'.Form::editfieldkey("MailFrom",'email_from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
-			print Form::editfieldval("MailFrom",'email_from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
+			print '<tr><td>'.$form->editfieldkey("MailFrom",'email_from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
+			print $form->editfieldval("MailFrom",'email_from',$object->email_from,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
 			print '</td></tr>';
 
 			// Errors to
-			print '<tr><td>'.Form::editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
-			print Form::editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
+			print '<tr><td>'.$form->editfieldkey("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string').'</td><td colspan="3">';
+			print $form->editfieldval("MailErrorsTo",'email_errorsto',$object->email_errorsto,$object,$user->rights->mailing->creer && $object->statut < 3,'string');
 			print '</td></tr>';
 
 			// Status
@@ -864,7 +864,7 @@ else
 				array('type' => 'checkbox', 'name' => 'clone_receivers', 'label' => $langs->trans("CloneReceivers"), 'value' => 0)
 				);
 				// Paiement incomplet. On demande si motif = escompte ou autre
-				print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240);
+				print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneEMailing'),$langs->trans('ConfirmCloneEMailing',$object->ref),'confirm_clone',$formquestion,'yes',2,240);
 			}
 
 			/*
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 3ed0098bed5286b478ca48fdc0561bf40bd8b6bd..0c133fac6df122d8abe472a5fe43d4e4a63b6b9e 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -184,7 +184,7 @@ if ($object->fetch($id) >= 0)
 
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 	print '<td colspan="3">';
-	print Form::showrefnav($object,'id', $linkback);
+	print $form->showrefnav($object,'id', $linkback);
 	print '</td></tr>';
 
 	print '<tr><td width="25%">'.$langs->trans("MailTitle").'</td><td colspan="3">'.$object->titre.'</td></tr>';
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 606e85b71ace10b3bc111ecdc62ef49301246fbf..b12e8004bc4fc6045b1715186e50d6c54db4fd73 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -1368,7 +1368,7 @@ if ($action == 'create')
 
 	// Date
 	print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
-	Form::selectDate('', '', '', '', '', "addprop", 1, 1);
+	$form->select_date('', '', '', '', '', "addprop", 1, 1);
 	print '</td></tr>';
 
 	// Validaty duration
@@ -1416,9 +1416,9 @@ if ($action == 'create')
 		$syear = date("Y", $tmpdte);
 		$smonth = date("m", $tmpdte);
 		$sday = date("d", $tmpdte);
-		Form::selectDate($syear."-".$smonth."-".$sday, 'date_livraison', '', '', '', "addprop");
+		$form->select_date($syear."-".$smonth."-".$sday, 'date_livraison', '', '', '', "addprop");
 	} else {
-		Form::selectDate(-1, 'date_livraison', '', '', '', "addprop", 1, 1);
+		$form->select_date(-1, 'date_livraison', '', '', '', "addprop", 1, 1);
 	}
 	print '</td></tr>';
 
@@ -1671,22 +1671,22 @@ if ($action == 'create')
 							// 1),
 							array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=2 OR s.client=3)')));
 		// Paiement incomplet. On demande si motif = escompte ou autre
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ClonePropal'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ClonePropal'), $langs->trans('ConfirmClonePropal', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
 	}
 
 	// Confirm delete
 	else if ($action == 'delete') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteProp'), $langs->trans('ConfirmDeleteProp', $object->ref), 'confirm_delete', '', 0, 1);
 	}
 
 	// Confirm reopen
 	else if ($action == 'reopen') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenProp', $object->ref), 'confirm_reopen', '', 0, 1);
 	}
 
 	// Confirmation delete product/service line
 	else if ($action == 'ask_deleteline') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 	}
 
 	// Confirm validate proposal
@@ -1714,7 +1714,7 @@ if ($action == 'create')
 		}
 
 		if (! $error)
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateProp'), $text, 'confirm_validate', '', 0, 1);
 	}
 
 	if (! $formconfirm) {
@@ -1733,7 +1733,7 @@ if ($action == 'create')
 
 	// Ref
 	print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 	print '</td></tr>';
 
 	// Ref customer
@@ -1804,7 +1804,7 @@ if ($action == 'create')
 		print '<form name="editdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
 		print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
 		print '<input type="hidden" name="action" value="setdate">';
-		Form::selectDate($object->date, 're', '', '', 0, "editdate");
+		$form->select_date($object->date, 're', '', '', 0, "editdate");
 		print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
 		print '</form>';
 	} else {
@@ -1830,7 +1830,7 @@ if ($action == 'create')
 		print '<form name="editecheance" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
 		print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
 		print '<input type="hidden" name="action" value="setecheance">';
-		Form::selectDate($object->fin_validite, 'ech', '', '', '', "editecheance");
+		$form->select_date($object->fin_validite, 'ech', '', '', '', "editecheance");
 		print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
 		print '</form>';
 	} else {
@@ -1865,9 +1865,9 @@ if ($action == 'create')
 	// Delivery date
 	$langs->load('deliveries');
 	print '<tr><td>';
-	print Form::editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer);
+	print $form->editfieldkey($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer);
 	print '</td><td colspan="5">';
-	print Form::editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer, 'day');
+	print $form->editfieldval($langs->trans('DeliveryDate'), 'date_livraison', $object->date_livraison, $object, $user->rights->propal->creer, 'day');
 	print '</td>';
 	print '</tr>';
 
diff --git a/htdocs/comm/propal/apercu.php b/htdocs/comm/propal/apercu.php
index d3373ff92d8c5f29583473aae86e5498f16c2bea..cdeacefafe18983d51f30f0b3b3a8d45f38b27a8 100644
--- a/htdocs/comm/propal/apercu.php
+++ b/htdocs/comm/propal/apercu.php
@@ -73,7 +73,7 @@ if ($id > 0 || ! empty($ref))
     
     	// Ref
     	print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
-    	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+    	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
     	print '</td></tr>';
 
         // Ref client
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index d85768170d040db2406ab6d079c988f36401030a..544c5ab27e3b60f51c1cd29179155f987a620054 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -161,7 +161,7 @@ if ($object->id > 0)
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
-	print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','');
+	print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
 	print '</td></tr>';
 
 	// Ref client
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 858e4e1c34bb8e6dba66f4c0473896f22c56d89d..af603d0606b3f31b27b69a290d6dab35f08de5f0 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -106,7 +106,7 @@ if ($object->id > 0)
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
-	print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','');
+	print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
 	print '</td></tr>';
 
 	// Ref client
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index cff7e9c313e8a7cb0b49ecc9b5790101a10a5205..1e5ace7353ed6836a1c0bc87d06b9e737b4cb51a 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -84,7 +84,7 @@ if ($id > 0 || ! empty($ref))
 
 			// Ref
 			print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
-			print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','');
+			print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
 			print '</td></tr>';
 
 			// Ref client
diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php
index a9445743e0ea1060aa9f0dc7af5e48f4974791d0..07989b457dea67b5d90e8f4590d833cbc8ed1fe5 100644
--- a/htdocs/comm/remx.php
+++ b/htdocs/comm/remx.php
@@ -296,7 +296,7 @@ if ($socid > 0)
 
 	if ($_GET['action'] == 'remove')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$_GET["remid"], $langs->trans('RemoveDiscount'), $langs->trans('ConfirmRemoveDiscount'), 'confirm_remove', '', 0, 1);
 	}
 
 	/*
@@ -403,7 +403,7 @@ if ($socid > 0)
 				array('type' => 'text', 'name' => 'amount_ttc_2', 'label' => $langs->trans("AmountTTC").' 2', 'value' => $amount2, 'size' => '5')
 			);
 			$langs->load("dict");
-			print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
+			print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&remid='.$showconfirminfo['rowid'], $langs->trans('SplitDiscount'), $langs->trans('ConfirmSplitDiscount',price($showconfirminfo['amount_ttc']),$langs->transnoentities("Currency".$conf->currency)), 'confirm_split', $formquestion, 0, 0);
 		}
 	}
 	else
diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php
index 712ef0fbc86ae69d29cf51fed04d6dd2870ed15c..1ec3a0533cc28652ecd973c11521f85df51792b1 100644
--- a/htdocs/commande/apercu.php
+++ b/htdocs/commande/apercu.php
@@ -70,7 +70,7 @@ if ($id > 0 || ! empty($ref))
     
     	// Ref
     	print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
-    	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+    	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
     	print '</td></tr>';
 
         // Ref cde client
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index f1f609dcc9f7df72ef765411f7a0d368aadd62bc..da8b9012b146e56b109ae6965e024b8439daeaa9 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1505,7 +1505,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 	}
 	// Date
 	print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
-	Form::selectDate('', 're', '', '', '', "crea_commande", 1, 1);			// Always autofill date with current date
+	$form->select_date('', 're', '', '', '', "crea_commande", 1, 1);			// Always autofill date with current date
 	print '</td></tr>';
 
 	// Delivery date planed
@@ -1515,7 +1515,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 		if (! empty($conf->global->DATE_LIVRAISON_WEEK_DELAY)) $datedelivery = time() + ((7*$conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
 		else $datedelivery=empty($conf->global->MAIN_AUTOFILL_DATE_DELIVERY)?-1:'';
 	}
-	Form::selectDate($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
+	$form->select_date($datedelivery, 'liv_', '', '', '', "crea_commande", 1, 1);
 	print "</td></tr>";
 
 	// Conditions de reglement
@@ -1775,7 +1775,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 		 * Confirmation de la suppression de la commande
 		*/
 		if ($action == 'delete') {
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1);
 		}
 
 		/*
@@ -1825,7 +1825,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 									array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockDecrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
 			}
 
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
 		}
 
 		// Confirm back to draft status
@@ -1857,14 +1857,14 @@ if ($action == 'create' && $user->rights->commande->creer)
 									array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
 			}
 
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('UnvalidateOrder'), $text, 'confirm_modif', $formquestion, "yes", 1, 220);
 		}
 
 		/*
 		 * Confirmation de la cloture
 		*/
 		if ($action == 'shipped') {
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloseOrder'), $langs->trans('ConfirmCloseOrder'), 'confirm_shipped', '', 0, 1);
 		}
 
 		/*
@@ -1898,13 +1898,13 @@ if ($action == 'create' && $user->rights->commande->creer)
 									array('type' => 'other','name' => 'idwarehouse','label' => $langs->trans("SelectWarehouseForStockIncrease"),'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1)));
 			}
 
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('Cancel'), $text, 'confirm_cancel', $formquestion, 0, 1);
 		}
 
 		// Confirmation to delete line
 		if ($action == 'ask_deleteline')
 		{
-			$formconfirm=Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
+			$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 		}
 
 		// Clone confirmation
@@ -1918,7 +1918,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 								// => 1),
 								array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', '(s.client=1 OR s.client=3)')));
 			// Paiement incomplet. On demande si motif = escompte ou autre
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneOrder'), $langs->trans('ConfirmCloneOrder', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
 		}
 
 		if (! $formconfirm) {
@@ -1951,7 +1951,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 		// Ref
 		print '<tr><td width="18%">' . $langs->trans('Ref') . '</td>';
 		print '<td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 		print '</td>';
 		print '</tr>';
 
@@ -2047,7 +2047,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 			print '<form name="setdate" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
 			print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
 			print '<input type="hidden" name="action" value="setdate">';
-			Form::selectDate($object->date, 'order_', '', '', '', "setdate");
+			$form->select_date($object->date, 'order_', '', '', '', "setdate");
 			print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
 			print '</form>';
 		} else {
@@ -2072,7 +2072,7 @@ if ($action == 'create' && $user->rights->commande->creer)
 			print '<form name="setdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
 			print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
 			print '<input type="hidden" name="action" value="setdate_livraison">';
-			Form::selectDate($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison");
+			$form->select_date($object->date_livraison ? $object->date_livraison : - 1, 'liv_', '', '', '', "setdate_livraison");
 			print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
 			print '</form>';
 		} else {
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index 53fcd5d9a570006c591b9345c916175f17e1a9e8..c72e040e61c66ec888e3d37e220c53cc91d8e133 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -156,7 +156,7 @@ if ($id > 0 || ! empty($ref))
 
 		// Ref
 		print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 		print "</td></tr>";
 
 		// Ref commande client
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index 1c4c7b8b8cba21a206a45238b3c33f094b63e3f0..2d9c80e9d2d87835c9d326d68b02502c9502bb84 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -110,7 +110,7 @@ if ($id > 0 || ! empty($ref))
 
 		// Ref
 		print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 		print '</td></tr>';
 
 		print '<tr><td>'.$langs->trans('Company').'</td><td colspan="3">'.$object->thirdparty->getNomUrl(1).'</td></tr>';
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index aaa1082398fcbd13bab37db3966e6af7836ab5fc..91a602c31a6060856493712aa8765a2185d3cbdf 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -403,11 +403,11 @@ if ($resql)
 	if (empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))
 	{
 	    print '<td align="center">';
-    	print Form::selectyesno('billed', $billed, 1, 0, 1);
+    	print $form->selectyesno('billed', $billed, 1, 0, 1);
 	    print '</td>';
 	}
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index 17ca75b8e80fbbfd16664dbee5db7fa7239af221..6f3519e9ced93cbb338ca794ddc6c863d7cb02fc 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -83,7 +83,7 @@ if ($id > 0 || ! empty($ref))
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print "</td></tr>";
 
 	// Ref commande client
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index 08700147cab316bdff7491fd196700f835fcde70..ebb9bedca2c1eb29770b36403294a238565bd653 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -427,7 +427,7 @@ if ($action == 'create' && !$error)
 
 	// Date invoice
 	print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
-	Form::selectDate('','','','','',"add",1,1);
+	$html->select_date('','','','','',"add",1,1);
 	print '</td></tr>';
 	// Payment term
 	print '<tr><td class="nowrap">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
@@ -575,8 +575,8 @@ if (($action != 'create' && $action != 'add') || ($action == 'create' && $error)
 		$num = $db->num_rows($resql);
 		print load_fiche_titre($title);
 		$i = 0;
-		$period=Form::selectDate($date_start,'date_start',0,0,1,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,1,'',1,0,1);
-		$periodely=Form::selectDate($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.Form::selectDate($date_endy,'date_end_dely',0,0,1,'',1,0,1);
+		$period=$html->select_date($date_start,'date_start',0,0,1,'',1,0,1).' - '.$html->select_date($date_end,'date_end',0,0,1,'',1,0,1);
+		$periodely=$html->select_date($date_starty,'date_start_dely',0,0,1,'',1,0,1).' - '.$html->select_date($date_endy,'date_end_dely',0,0,1,'',1,0,1);
 
 		if (! empty($socid))
 		{
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index 7919f074d41e8a6051d5cb5d99e87083d78185b4..b1bf6cd42702c1fae8d152306345b7e1c9ad0aa0 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -341,7 +341,7 @@ if ($id > 0 || ! empty($ref))
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 	print '<td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref');
 	print '</td></tr>';
 
 	// Label
@@ -404,7 +404,7 @@ if ($id > 0 || ! empty($ref))
 	if ($action == 'delete')
 	{
 		$text=$langs->trans('ConfirmDeleteTransaction');
-		print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete');
+		print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;rowid='.GETPOST("rowid"),$langs->trans('DeleteTransaction'),$text,'confirm_delete');
 
 	}
 
@@ -466,7 +466,7 @@ if ($id > 0 || ! empty($ref))
 
 		print '<tr '.$bc[false].'>';
 		print '<td class="nowrap" colspan="2">';
-		Form::selectDate($dateop,'op',0,0,0,'transaction');
+		$form->select_date($dateop,'op',0,0,0,'transaction');
 		print '</td>';
 		print '<td class="nowrap">';
 		$form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1);
@@ -521,9 +521,9 @@ if ($id > 0 || ! empty($ref))
 	print '<input type="hidden" name="action" value="search">';
 	print '<input type="hidden" name="id" value="'.$object->id.'">';
 
-	$period_filter .= $langs->trans('From').'&nbsp;'.Form::selectDate($req_stdt,'req_stdt',0,0,1,null,1,1,1);
+	$period_filter .= $langs->trans('From').'&nbsp;'.$form->select_date($req_stdt,'req_stdt',0,0,1,null,1,1,1);
 	$period_filter .= '&nbsp;';
-	$period_filter .= $langs->trans('to').'&nbsp;'.Form::selectDate($req_enddt,'req_enddt',0,0,1,null,1,1,1);
+	$period_filter .= $langs->trans('to').'&nbsp;'.$form->select_date($req_enddt,'req_enddt',0,0,1,null,1,1,1);
 	
 	print '<tr class="liste_titre">';
 	print '<td colspan="2">'.$period_filter.'</td>';
@@ -539,7 +539,7 @@ if ($id > 0 || ! empty($ref))
 	print '<td align="right"><input type="text" class="flat" name="req_credit" value="'.$req_credit.'" size="4"></td>';
 	print '<td align="center">&nbsp;</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index 97edaf5446f0860b56f2505e127279c4b0ba7382..7b53d775cb672ed29876df1b347894fe1bd64456 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -150,7 +150,7 @@ if ($_GET["account"])
 {
 	if (! preg_match('/,/', $id))
 	{
-		print Form::showrefnav($acct, 'ref', $linkback, 1, 'ref');
+		print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref');
 	}
 	else
 	{
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index 1288021d4708e96a136b718af47baa789466b1b8..b33b0438552f177d6ce54da859156ba1a0fd212f 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -365,7 +365,7 @@ if ($action == 'create')
 
 	print '<tr><td>'.$langs->trans("Date").'</td>';
 	print '<td colspan="3">';
-	Form::selectDate('', 're', 0, 0, 0, 'formsoc');
+	$form->select_date('', 're', 0, 0, 0, 'formsoc');
 	print '</td></tr>';
 
 	print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
@@ -558,7 +558,7 @@ else
 		*/
 		if ($action == 'delete')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
+			print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$account->id,$langs->trans("DeleteAccount"),$langs->trans("ConfirmDeleteAccount"),"confirm_delete");
 
 		}
 
@@ -569,7 +569,7 @@ else
 		// Ref
 		print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 		print '<td colspan="3">';
-		print Form::showrefnav($account, 'ref', $linkback, 1, 'ref');
+		print $form->showrefnav($account, 'ref', $linkback, 1, 'ref');
 		print '</td></tr>';
 
 		// Label
diff --git a/htdocs/compta/bank/document.php b/htdocs/compta/bank/document.php
index 151257a6535526da4eac4d5ed423d7e79e100a43..3b6957df40f44273875899dd963140ca4b316b80 100644
--- a/htdocs/compta/bank/document.php
+++ b/htdocs/compta/bank/document.php
@@ -179,7 +179,7 @@ if ($id > 0 || !empty($ref)) {
         // Ref
         print '<tr><td valign="top" width="25%">' . $langs->trans("Ref") . '</td>';
         print '<td colspan="3">';
-        print Form::showrefnav($object, 'ref', '', 1, 'ref');
+        print $form->showrefnav($object, 'ref', '', 1, 'ref');
         print '</td></tr>';
 
         // Label
@@ -200,7 +200,7 @@ if ($id > 0 || !empty($ref)) {
          * Confirmation suppression fichier
          */
         if ($action == 'delete') {
-            $ret = $formForm::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]),
+            $ret = $form->form_confirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode($_GET["urlfile"]),
                     $langs->trans('DeleteFile'),
                     $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile',
                     '', 0, 1);
diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php
index fb8a823b96e5e60decd1a7331e30288cdd60d01d..0764c87f5abf78c38e667f11fc1516f779b0b16e 100644
--- a/htdocs/compta/bank/graph.php
+++ b/htdocs/compta/bank/graph.php
@@ -770,7 +770,7 @@ if ($account)
 		if ($_GET["option"]!='all')
 		{
 			$morehtml='<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.'&option=all'.$moreparam.'">'.$langs->trans("ShowAllAccounts").'</a>';
-			print Form::showrefnav($acct, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam);
+			print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref', 'ref', '', $moreparam);
 		}
 		else
 		{
diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php
index 502fdf7d36c271d16360a5258239795c99b7ba63..a17614238be337e1ba06ee73744ce6842ee3ac24 100644
--- a/htdocs/compta/bank/ligne.php
+++ b/htdocs/compta/bank/ligne.php
@@ -259,7 +259,7 @@ if ($result)
         // Confirmations
         if ($action == 'delete_categ')
         {
-            print Form::formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1);
+            print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$rowid."&cat1=".GETPOST("fk_categ")."&orig_account=".$orig_account, $langs->trans("RemoveFromRubrique"), $langs->trans("RemoveFromRubriqueConfirm"), "confirm_delete_categ", '', 'yes', 1);
 
         }
 
@@ -276,7 +276,7 @@ if ($result)
         // Ref
         print '<tr><td width="20%">'.$langs->trans("Ref")."</td>";
         print '<td colspan="4">';
-        print Form::showrefnav($bankline, 'rowid', $linkback, 1, 'rowid', 'rowid');
+        print $form->showrefnav($bankline, 'rowid', $linkback, 1, 'rowid', 'rowid');
         print '</td>';
         print '</tr>';
 
@@ -451,7 +451,7 @@ if ($result)
         if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
         {
             print '<td colspan="3">';
-            print Form::selectDate($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
+            print $form->select_date($db->jdate($objp->do),'dateo','','','','update',1,0,1,$objp->rappro);
             print '</td>';
         }
         else
@@ -467,7 +467,7 @@ if ($result)
         if ($user->rights->banque->modifier || $user->rights->banque->consolidate)
         {
             print '<td colspan="3">';
-            print Form::selectDate($db->jdate($objp->dv),'datev','','','','update',1,0,1,$objp->rappro);
+            print $form->select_date($db->jdate($objp->dv),'datev','','','','update',1,0,1,$objp->rappro);
             if (! $objp->rappro)
             {
                 print ' &nbsp; ';
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index 9cf6b3fe2afe0f3502d425f3396187627400343c..8ef53f26203db46475a006580769b12bc7224461 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -131,7 +131,7 @@ if (empty($num))
 		// Ref
 		print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 		print '<td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref');
 		print '</td></tr>';
 
 		// Label
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index 47a24e916660b1bef42b2b4cb7fa1ae7ec7477e2..f86ac81aa760723d7436bda4c227a3c938f55003 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -191,9 +191,9 @@ if ($resql)
 	$moreforfilter = '';
 	$moreforfilter.='<div class="divsearchfield">';
 	$moreforfilter .= $langs->trans('Period') . ' ('.$langs->trans('DateOperationShort').') : ' . $langs->trans('StartDate') . ' ';
-	$moreforfilter .= Form::selectDate($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
+	$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 0, 1);
 	$moreforfilter .= ' - ';
-	$moreforfilter .= $langs->trans('EndDate') . ' ' . Form::selectDate($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
+	$moreforfilter .= $langs->trans('EndDate') . ' ' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 0, 1);
 	$moreforfilter .= '</div>';
 
 	if ($moreforfilter) 
@@ -238,7 +238,7 @@ if ($resql)
 	print '</td>';
 	print '<td></td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index a60c470993d0ca2e6b47600db3f4d5e5a697e091..db7f37cb3e50f71c53a321cdf5eb3d31389f1935 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -97,7 +97,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 	print '<td colspan="3">';
-	print Form::showrefnav($acct, 'ref', $linkback, 1, 'ref');
+	print $form->showrefnav($acct, 'ref', $linkback, 1, 'ref');
 	print '</td></tr>';
 
 	// Label
diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php
index 403574b04d03371a14ba060a69950fd6f64f9353..146ed4759c406085c4dcdb3019d801f581142876 100644
--- a/htdocs/compta/bank/virement.php
+++ b/htdocs/compta/bank/virement.php
@@ -177,7 +177,7 @@ $form->select_comptes($account_to,'account_to',0,'',1);
 print "</td>\n";
 
 print "<td>";
-Form::selectDate((! empty($dateo)?$dateo:''),'','','','','add');
+$form->select_date((! empty($dateo)?$dateo:''),'','','','','add');
 print "</td>\n";
 print '<td><input name="label" class="flat" type="text" size="40" value="'.$label.'"></td>';
 print '<td><input name="amount" class="flat" type="text" size="8" value="'.$amount.'"></td>';
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 930684a2e69a0345a18663b9fe0c48ecabd2a505..934c970accff0961fac9729d5e545be123b73b88 100644
--- a/htdocs/compta/deplacement/card.php
+++ b/htdocs/compta/deplacement/card.php
@@ -262,7 +262,7 @@ if ($action == 'create')
 
     print "<tr>";
     print '<td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
-    print Form::selectDate($datec?$datec:-1,'','','','','add',1,1,1);
+    print $form->select_date($datec?$datec:-1,'','','','','add',1,1,1);
     print '</td></tr>';
 
     // Km
@@ -358,7 +358,7 @@ else if ($id)
 
             // Date
             print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td>';
-            print Form::selectDate($object->date,'',0,0,0,'update',1,0,1);
+            print $form->select_date($object->date,'',0,0,0,'update',1,0,1);
             print '</td></tr>';
 
             // Km
@@ -416,7 +416,7 @@ else if ($id)
             */
             if ($action == 'delete')
             {
-                print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
+                print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete");
 
             }
 
@@ -429,16 +429,16 @@ else if ($id)
 
             // Ref
             print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
-            print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+            print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
             print '</td></tr>';
 
 	        $form->load_cache_types_fees();
 
 	        // Type
             print '<tr><td>';
-            print Form::editfieldkey("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
+            print $form->editfieldkey("Type",'type',$langs->trans($object->type),$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
             print '</td><td>';
-            print Form::editfieldval("Type",'type',$form->cache_types_fees[$object->type],$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
+            print $form->editfieldval("Type",'type',$form->cache_types_fees[$object->type],$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'select:types_fees');
             print '</td></tr>';
 
             // Who
@@ -450,16 +450,16 @@ else if ($id)
 
             // Date
             print '<tr><td>';
-            print Form::editfieldkey("Date",'dated',$object->date,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'datepicker');
+            print $form->editfieldkey("Date",'dated',$object->date,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'datepicker');
             print '</td><td>';
-            print Form::editfieldval("Date",'dated',$object->date,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'datepicker');
+            print $form->editfieldval("Date",'dated',$object->date,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'datepicker');
             print '</td></tr>';
 
             // Km/Price
             print '<tr><td valign="top">';
-            print Form::editfieldkey("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
+            print $form->editfieldkey("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
             print '</td><td>';
-            print Form::editfieldval("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
+            print $form->editfieldval("FeesKilometersOrAmout",'km',$object->km,$object,$conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer,'numeric:6');
             print "</td></tr>";
 
             // Where
diff --git a/htdocs/compta/deplacement/document.php b/htdocs/compta/deplacement/document.php
index 80f49fec401a503bbda0759ea5eaaf361349ca1e..b6b1cbfa277dfbdec7eeda7372d9c3c08b453c49 100644
--- a/htdocs/compta/deplacement/document.php
+++ b/htdocs/compta/deplacement/document.php
@@ -108,7 +108,7 @@ if ($object->id)
 
 	// Ref
 	print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+	print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
 	print '</td></tr>';
 
 	// Societe
diff --git a/htdocs/compta/deplacement/list.php b/htdocs/compta/deplacement/list.php
index 8767ca97961e52e29b093fbbe84255e1358df635..497de98fa72637d892dc4607d8a28d1176141f3a 100644
--- a/htdocs/compta/deplacement/list.php
+++ b/htdocs/compta/deplacement/list.php
@@ -165,7 +165,7 @@ if ($resql)
     // print '<input class="flat" size="10" type="text" name="search_amount" value="'.$search_amount.'">';
     print '</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     print "</tr>\n";
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 00e5d0f9ccc1b1f581c78f573f18889c0f17620b..7298eb1813551fa6e3a749d190faa374770f146a 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2354,7 +2354,7 @@ if ($action == 'create')
 	// Date invoice
 	print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
 	$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
-	print Form::selectDate($datefacture?$datefacture:$dateinvoice, '', '', '', '', "add", 1, 1, 1);
+	print $form->select_date($datefacture?$datefacture:$dateinvoice, '', '', '', '', "add", 1, 1, 1);
 	print '</td></tr>';
 
 	// Payment term
@@ -2548,12 +2548,12 @@ if ($action == 'create')
 					print '<td class="nobordernopadding nowrap">';
 					print $langs->trans('From') . ' ';
 					print '</td><td class="nobordernopadding nowrap">';
-					print Form::selectDate('', 'date_start' . $i, $usehm, $usehm, 1, "add", 1, 0, 1);
+					print $form->select_date('', 'date_start' . $i, $usehm, $usehm, 1, "add", 1, 0, 1);
 					print '</td></tr>';
 					print '<td class="nobordernopadding nowrap">';
 					print $langs->trans('to') . ' ';
 					print '</td><td class="nobordernopadding nowrap">';
-					print Form::selectDate('', 'date_end' . $i, $usehm, $usehm, 1, "add", 1, 0, 1);
+					print $form->select_date('', 'date_end' . $i, $usehm, $usehm, 1, "add", 1, 0, 1);
 					print '</td></tr></table>';
 					print '</td>';
 				}
@@ -2664,7 +2664,7 @@ else if ($id > 0 || ! empty($ref))
 	// Confirmation de la conversion de l'avoir en reduc
 	if ($action == 'converttoreduc') {
 		$text = $langs->trans('ConfirmConvertToReduc');
-		$formconfirm = Form::formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('ConvertToReduc'), $text, 'confirm_converttoreduc', '', "yes", 2);
 	}
 
 	// Confirmation to delete invoice
@@ -2692,9 +2692,9 @@ else if ($id > 0 || ! empty($ref))
 								// array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value'
 								// => 1),
 								array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, $langs->trans("NoStockAction"))));
-			$formconfirm = Form::formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1);
+			$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', $formquestion, "yes", 1);
 		} else {
-			$formconfirm = Form::formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1);
+			$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('DeleteBill'), $text, 'confirm_delete', '', '', 1);
 		}
 	}
 
@@ -2758,7 +2758,7 @@ else if ($id > 0 || ! empty($ref))
 		{
 			$text .= '<br>' . img_warning() . ' ' . $langs->trans("ErrorInvoiceOfThisTypeMustBePositive");
 		}
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, (($object->type != Facture::TYPE_CREDIT_NOTE && $object->total_ttc < 0) ? "no" : "yes"), 2);
 	}
 
 	// Confirm back to draft status
@@ -2795,12 +2795,12 @@ else if ($id > 0 || ! empty($ref))
 								array('type' => 'other','name' => 'idwarehouse','label' => $label,'value' => $value));
 		}
 
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('UnvalidateBill'), $text, 'confirm_modif', $formquestion, "yes", 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('UnvalidateBill'), $text, 'confirm_modif', $formquestion, "yes", 1);
 	}
 
 	// Confirmation du classement paye
 	if ($action == 'paid' && $resteapayer <= 0) {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', "yes", 1);
 	}
 	if ($action == 'paid' && $resteapayer > 0) {
 		// Code
@@ -2829,7 +2829,7 @@ else if ($id > 0 || ! empty($ref))
 		// Cree un tableau formulaire
 		$formquestion = array('text' => $langs->trans("ConfirmClassifyPaidPartiallyQuestion"),array('type' => 'radio','name' => 'close_code','label' => $langs->trans("Reason"),'values' => $arrayreasons),array('type' => 'text','name' => 'close_note','label' => $langs->trans("Comment"),'value' => '','size' => '100'));
 		// Paiement incomplet. On demande si motif = escompte ou autre
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes");
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidPartially', $object->ref), 'confirm_paid_partially', $formquestion, "yes");
 	}
 
 	// Confirmation du classement abandonne
@@ -2860,13 +2860,13 @@ else if ($id > 0 || ! empty($ref))
 			// Cree un tableau formulaire
 			$formquestion = array('text' => $langs->trans("ConfirmCancelBillQuestion"),array('type' => 'radio','name' => 'close_code','label' => $langs->trans("Reason"),'values' => $arrayreasons),array('type' => 'text','name' => 'close_note','label' => $langs->trans("Comment"),'value' => '','size' => '100'));
 
-			$formconfirm = Form::formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('CancelBill'), $langs->trans('ConfirmCancelBill', $object->ref), 'confirm_canceled', $formquestion, "yes");
+			$formconfirm = $form->formconfirm($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $langs->trans('CancelBill'), $langs->trans('ConfirmCancelBill', $object->ref), 'confirm_canceled', $formquestion, "yes");
 		}
 	}
 
 	// Confirmation de la suppression d'une ligne produit
 	if ($action == 'ask_deleteline') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 'no', 1);
 	}
 
 	// Clone confirmation
@@ -2878,7 +2878,7 @@ else if ($id > 0 || ! empty($ref))
 							// array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1)
 							array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1)));
 		// Paiement incomplet. On demande si motif = escompte ou autre
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?facid=' . $object->id, $langs->trans('CloneInvoice'), $langs->trans('ConfirmCloneInvoice', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
 	}
 
 	if (! $formconfirm)
@@ -2910,7 +2910,7 @@ else if ($id > 0 || ! empty($ref))
 	if ($result < 0) {
 		dol_print_error('', $discount->error);
 	}
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
 	print '</td></tr>';
 
 	// Ref customer
@@ -3091,7 +3091,7 @@ else if ($id > 0 || ! empty($ref))
 
 	if ($object->type != Facture::TYPE_CREDIT_NOTE) {
 		if ($action == 'editinvoicedate') {
-			Form::formDate($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date, 'invoicedate');
+			$form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date, 'invoicedate');
 		} else {
 			print dol_print_date($object->date, 'daytext');
 		}
@@ -3454,7 +3454,7 @@ else if ($id > 0 || ! empty($ref))
 	if ($object->type != Facture::TYPE_CREDIT_NOTE)
 	{
 		if ($action == 'editpaymentterm') {
-			Form::formDate($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm');
+			$form->form_date($_SERVER['PHP_SELF'] . '?facid=' . $object->id, $object->date_lim_reglement, 'paymentterm');
 		} else {
 			print dol_print_date($object->date_lim_reglement, 'daytext');
 			if ($object->hasDelay()) {
diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php
index c2d7143fe4475ec6f21128a158e94edc64ddd36e..1172769e95a129e1ee860cdefc89c3e3cbadf09b 100644
--- a/htdocs/compta/facture/apercu.php
+++ b/htdocs/compta/facture/apercu.php
@@ -93,7 +93,7 @@ if ($id > 0 || ! empty($ref))
     	if ($result < 0) {
     		dol_print_error('', $discount->error);
     	}
-    	print Form::showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+    	print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
     	print '</td></tr>';
 
         // Ref customer
diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php
index e6e474883f4197b27adc991b0b9191e296071ee8..b07a8f8c2d46b2a68f644b137f44344a49e195fa 100644
--- a/htdocs/compta/facture/contact.php
+++ b/htdocs/compta/facture/contact.php
@@ -159,7 +159,7 @@ if ($id > 0 || ! empty($ref))
 		{
 			dol_print_error('',$discount->error);
 		}
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
 		print '</td></tr>';
 
 		// Ref customer
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 18e0fac540a483a1546ec7a57c658930b188f041..e4f9846309a3b0110b3fdc9d9ae892da82830d00 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -126,7 +126,7 @@ if ($id > 0 || ! empty($ref))
 		{
 			dol_print_error('',$discount->error);
 		}
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
 		print '</td></tr>';
 
 		// Ref customer
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 9411d1fb01bd296b07c4730f7c8af89a357b11db..e833c0629b3d7060fa3ecd3cd5cfe5afcb267e60 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -349,7 +349,7 @@ if ($action == 'create')
 		// First date of execution for cron
 		print "<tr><td>".$langs->trans('NextDateToExecution')."</td><td>";
 		$date_next_execution = isset($date_next_execution) ? $date_next_execution : (GETPOST('remonth') ? dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear')) : -1);
-		print Form::selectDate($date_next_execution, '', 1, 1, '', "add", 1, 1, 1);
+		print $form->select_date($date_next_execution, '', 1, 1, '', "add", 1, 1, 1);
 		print "</td></tr>";
 		
 		// Number max of generation
@@ -609,7 +609,7 @@ else
 		if ($result < 0) {
 		    dol_print_error('', $discount->error);
 		}*/
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'titre', 'titre', $morehtmlref);
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'titre', 'titre', $morehtmlref);
 		print '</td></tr>';
 		
 		
@@ -669,9 +669,9 @@ else
 
 		
 		print '<tr><td>';
-		print Form::editfieldkey($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
+		print $form->editfieldkey($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer);
 		print '</td><td colspan="5">';
-		print Form::editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60');
+		print $form->editfieldval($langs->trans("NotePrivate"), 'note_private', $object->note_private, $object, $user->rights->facture->creer, 'textarea:'.ROWS_4.':60');
 		print '</td>';
 		print '</tr>';
 		
@@ -771,7 +771,7 @@ else
 		print '<tr><td>';
 		if ($action == 'date_when' || $object->frequency > 0)
 		{
-		    print Form::editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day');
+		    print $form->editfieldkey($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day');
 		}
 		else
 		{
@@ -780,7 +780,7 @@ else
 		print '</td><td colspan="5">';
 		if ($action == 'date_when' || $object->frequency > 0)
 		{
-		    print Form::editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day');
+		    print $form->editfieldval($langs->trans("NextDateToExecution"), 'date_when', $object->date_when, $object, $user->rights->facture->creer, 'day');
 		}
 		print '</td>';
 		print '</tr>';
@@ -789,7 +789,7 @@ else
 		print '<tr><td>';
 		if ($action == 'nb_gen_max' || $object->frequency > 0)
 		{
-		    print Form::editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
+		    print $form->editfieldkey($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max, $object, $user->rights->facture->creer);
 		}
 		else
 		{
@@ -798,7 +798,7 @@ else
 		print '</td><td colspan="5">';
 		if ($action == 'nb_gen_max' || $object->frequency > 0)
 		{
-		      print Form::editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', $object, $user->rights->facture->creer);
+		      print $form->editfieldval($langs->trans("MaxPeriodNumber"), 'nb_gen_max', $object->nb_gen_max?$object->nb_gen_max:'', $object, $user->rights->facture->creer);
 		}
 		else
 		{
@@ -810,14 +810,14 @@ else
 		// Status of generated invoices
 		print '<tr><td>';
 		if ($action == 'auto_validate' || $object->frequency > 0)
-		    print Form::editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer);
+		    print $form->editfieldkey($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer);
 		else
 		    print $langs->trans("StatusOfGeneratedInvoices");
 		print '</td><td colspan="5">';
     	$select = 'select;0:'.$langs->trans('BillStatusDraft').',1:'.$langs->trans('BillStatusValidated');
 		if ($action == 'auto_validate' || $object->frequency > 0)
 		{
-    		print Form::editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer, $select);
+    		print $form->editfieldval($langs->trans("StatusOfGeneratedInvoices"), 'auto_validate', $object->auto_validate, $object, $user->rights->facture->creer, $select);
 		}
 		print '</td>';
 		print '</tr>';
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index c204d908a3f2cfd428bccfd4cfd59b99298374ae..d227d127f6938dd7a76a6fa0434ecb8f7fc11367 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -719,7 +719,7 @@ if ($resql)
     if ($show_files)         $param.='&show_files=' .$show_files;
 	$param.=(! empty($option)?"&amp;option=".$option:"");
 	
-	$massactionbutton=Form::selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
+	$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
     
     $i = 0;
     print '<form method="POST" name="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@@ -924,7 +924,7 @@ if ($resql)
 	print $form->selectarray('search_status', $liststatus, $search_status, 1);
     print '</td>';
     print '<td class="liste_titre" align="center">';
-    $searchpitco=Form::showFilterAndCheckAddButtons(1, 'checkforselect', 1);
+    $searchpitco=$form->showFilterAndCheckAddButtons(1, 'checkforselect', 1);
     print $searchpitco;
     print '</td>';
     print "</tr>\n";
diff --git a/htdocs/compta/facture/note.php b/htdocs/compta/facture/note.php
index 7d2cd530955e0985a8250258eb5f044c6692c0bc..3562a235963eb108a862020bd5d14cca83aa4918 100644
--- a/htdocs/compta/facture/note.php
+++ b/htdocs/compta/facture/note.php
@@ -94,7 +94,7 @@ if ($id > 0 || ! empty($ref))
 	{
 		dol_print_error('',$discount->error);
 	}
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
 	print '</td></tr>';
 
 	// Ref customer
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index a3302f3f18ecd1ebfd263ead4534959eb9ed8e45..00254b7440f6d04923f2690dd0d7cdfb956688a8 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -167,7 +167,7 @@ if ($object->id > 0)
 	{
 		dol_print_error('',$discount->error);
 	}
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'facnumber', 'ref', $morehtmlref);
 	print "</td></tr>";
 
 	// Ref customer
@@ -300,7 +300,7 @@ if ($object->id > 0)
 	{
 		if ($action == 'editinvoicedate')
 		{
-			Form::formDate($_SERVER['PHP_SELF'].'?id='.$object->id,$object->date,'invoicedate');
+			$form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$object->date,'invoicedate');
 		}
 		else
 		{
@@ -351,7 +351,7 @@ if ($object->id > 0)
 	{
 		if ($action == 'editpaymentterm')
 		{
-			Form::formDate($_SERVER['PHP_SELF'].'?id='.$object->id,$object->date_lim_reglement,'paymentterm');
+			$form->form_date($_SERVER['PHP_SELF'].'?id='.$object->id,$object->date_lim_reglement,'paymentterm');
 		}
 		else
 		{
diff --git a/htdocs/compta/journal/purchasesjournal.php b/htdocs/compta/journal/purchasesjournal.php
index bd219b171a7e0b2f0f097d72fd9ccf82c2bfcdd3..b8a5779c708c9d3611fdcc75e84a7c3a61f160ed 100644
--- a/htdocs/compta/journal/purchasesjournal.php
+++ b/htdocs/compta/journal/purchasesjournal.php
@@ -92,7 +92,7 @@ $builddate=time();
 $description=$langs->trans("DescPurchasesJournal").'<br>';
 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
 else  $description.= $langs->trans("DepositsAreIncluded");
-$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
 
 $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
diff --git a/htdocs/compta/journal/sellsjournal.php b/htdocs/compta/journal/sellsjournal.php
index 68df0cd964e599d1fee63dc0f599d2618ccbd00c..0cbd5068077d02ce25f8a2ffe007d8a82d60f670 100644
--- a/htdocs/compta/journal/sellsjournal.php
+++ b/htdocs/compta/journal/sellsjournal.php
@@ -96,7 +96,7 @@ $builddate=time();
 $description=$langs->trans("DescSellsJournal").'<br>';
 if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
 else  $description.= $langs->trans("DepositsAreIncluded");
-$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink);
 
 $p = explode(":", $conf->global->MAIN_INFO_SOCIETE_COUNTRY);
diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php
index 6c479a4d9f6fa1aaef77728ec2cacce31515e489..566a2ff53cc3c19a670fcea7b087c47ecb04352a 100644
--- a/htdocs/compta/localtax/card.php
+++ b/htdocs/compta/localtax/card.php
@@ -19,7 +19,7 @@
 /**
  *	    \file       htdocs/compta/localtax/card.php
  *      \ingroup    tax
- *		\brief      Page of second or third tax payments (like IRPF for spain, ...)
+ *		\brief      Page of IRPF payments
  */
 
 require '../../main.inc.php';
@@ -30,25 +30,17 @@ $langs->load("compta");
 $langs->load("banks");
 $langs->load("bills");
 
-$id=GETPOST("id",'int');
-$action=GETPOST("action","alpha");
-$refund=GETPOST("refund","int");
-if (empty($refund)) $refund=0;
-
+$id=$_REQUEST["id"];
 $lttype=GETPOST('localTaxType', 'int');
+$mesg = '';
 
 // Security check
 $socid = isset($_GET["socid"])?$_GET["socid"]:'';
 if ($user->societe_id) $socid=$user->societe_id;
 $result = restrictedArea($user, 'tax', '', '', 'charges');
 
-$localtax = new Localtax($db);
-
-// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
-$hookmanager->initHooks(array('localtaxvatcard','globalcard'));
 
-
-/**
+/*
  * Actions
  */
 
@@ -58,8 +50,9 @@ if($_POST["cancel"] == $langs->trans("Cancel")){
 	exit;
 }
 
-if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
+if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 {
+    $localtax = new Localtax($db);
 
     $db->begin();
 
@@ -90,9 +83,10 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 }
 
 //delete payment of localtax
-if ($action == 'delete')
+if ($_GET["action"] == 'delete')
 {
-    $result=$localtax->fetch($id);
+    $localtax = new Localtax($db);
+    $result=$localtax->fetch($_GET['id']);
 
 	if ($localtax->rappro == 0)
 	{
@@ -105,10 +99,10 @@ if ($action == 'delete')
 			{
 				$accountline=new AccountLine($db);
 				$result=$accountline->fetch($localtax->fk_bank);
-				if ($result > 0) $result=$accountline->delete($user);	// $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
+				$result=$accountline->delete($user);
 			}
 
-			if ($result >= 0)
+			if ($result > 0)
 			{
 				$db->commit();
 				header("Location: ".DOL_URL_ROOT.'/compta/localtax/reglement.php?localTaxType='.$localtax->ltt);
@@ -155,26 +149,26 @@ if ($id)
 }
 
 
-if ($action == 'create')
+if ($_GET["action"] == 'create')
 {
-    print load_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment",$mysoc->country_code));
-    
-    print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" name="formlocaltax" method="post">'."\n";
+    print "<form name='add' action=\"card.php\" method=\"post\">\n";
     print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
     print '<input type="hidden" name="localTaxType" value="'.$lttype.'">';
     print '<input type="hidden" name="action" value="add">';
 
-    dol_fiche_head();
+    print load_fiche_titre($langs->transcountry($lttype==2?"newLT2Payment":"newLT1Payment",$mysoc->country_code));
+    
+    if ($mesg) print $mesg;
 
     print '<table class="border" width="100%">';
 
     print "<tr>";
     print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
-    print Form::selectDate($datep,"datep",'','','','add',1,1);
+    print $form->select_date($datep,"datep",'','','','add');
     print '</td></tr>';
 
     print '<tr><td class="fieldrequired">'.$langs->trans("DateValue").'</td><td>';
-    print Form::selectDate($datev,"datev",'','','','add',1,1);
+    print $form->select_date($datev,"datev",'','','','add');
     print '</td></tr>';
 
 	// Label
@@ -190,22 +184,13 @@ if ($action == 'create')
         print '</td></tr>';
 
 	    print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
-	    $form->select_types_paiements(GETPOST("paiementtype"), "paiementtype");
+	    $form->select_types_paiements($_POST["paiementtype"], "paiementtype");
 	    print "</td>\n";
 	    print "</tr>";
-	
-		// Number
-		print '<tr><td>'.$langs->trans('Numero');
-		print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
-		print '<td><input name="num_payment" type="text" value="'.GETPOST("num_payment").'"></td></tr>'."\n";
-    }
-    // Other attributes
-    $parameters=array('colspan' => ' colspan="1"');
-    $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);    // Note that $action and $object may have been modified by hook
-
+	}
     print '</table>';
 
-	dol_fiche_end();
+	print "<br>";
 
 	print '<div class="center">';
 	print '<input type="submit" class="button" value="'.$langs->trans("Save").'">';
@@ -225,6 +210,8 @@ if ($action == 'create')
 
 if ($id)
 {
+    if ($mesg) print $mesg;
+
 	$h = 0;
 	$head[$h][0] = DOL_URL_ROOT.'/compta/localtax/card.php?id='.$vatpayment->id;
 	$head[$h][1] = $langs->trans('Card');
@@ -268,14 +255,9 @@ if ($id)
 		}
 	}
 
-    // Other attributes
-    $parameters=array('colspan' => ' colspan="3"');
-    $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$vatpayment,$action);    // Note that $action and $object may have been modified by hook
-	
-    print '</table>';
+	print '</table>';
 
-	dol_fiche_end();
-	
+	print '</div>';
 
 	/*
 	* Boutons d'actions
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index 2e39dc6058ec7a8211de3d8d1de826c61c43d3ef..ac30e5298396e19149964474820fae274aeac8f1 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/htdocs/compta/localtax/clients.php
@@ -111,7 +111,7 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1)	// Calculate on invoice
     $nom=$langs->transcountry($local==1?"LT1ReportByCustomersInInputOutputMode":"LT2ReportByCustomersInInputOutputMode",$mysoc->country_code);
     $calcmode=$calc==0?$langs->trans("CalcModeLT".$local):$langs->trans("CalcModeLT".$local."Rec");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
     $description.=$fsearch;
     $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')';
@@ -129,7 +129,7 @@ if ($conf->global->$calc==2) 	// Invoice for goods, payment for services
     $nom=$langs->transcountry($local==1?"LT1ReportByCustomersInInputOutputMode":"LT2ReportByCustomersInInputOutputMode",$mysoc->country_code);
     $calcmode=$langs->trans("CalcModeLT2Debt");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     if (! empty($conf->global->MAIN_MODULE_COMPTABILITE)) $description.='<br>'.$langs->trans("WarningDepositsNotIncluded");
     $description.=$fsearch;
     $description.='<br>('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')';
diff --git a/htdocs/compta/localtax/index.php b/htdocs/compta/localtax/index.php
index 887c3698af5cf39c0737d8d0948af1b2536b6122..3bed627402eb0548ce48b8887103500e199ce581 100644
--- a/htdocs/compta/localtax/index.php
+++ b/htdocs/compta/localtax/index.php
@@ -27,15 +27,10 @@ require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
 
 $langs->load("other");
-$langs->load("compta");
-$langs->load("banks");
-$langs->load("bills");
-
 $localTaxType=GETPOST('localTaxType', 'int');
 
-$year=GETPOST("year","int");
-if ($year == 0)
-{
+$year=$_GET["year"];
+if ($year == 0 ) {
     $year_current = strftime("%Y",time());
     $year_start = $year_current;
 } else {
@@ -127,24 +122,25 @@ if($localTaxType==1) {
 $textprevyear="<a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current-1) . "\">".img_previous()."</a>";
 $textnextyear=" <a href=\"index.php?localTaxType=".$localTaxType."&year=" . ($year_current+1) . "\">".img_next()."</a>";
 
-print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear", 'title_accountancy.png');
+print load_fiche_titre($langs->transcountry($LT,$mysoc->country_code),"$textprevyear ".$langs->trans("Year")." $year_start $textnextyear");
 
 print $langs->trans("LTReportBuildWithOptionDefinedInModule").'<br>';
 print '('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')<br>';
 print '<br>';
 
-print '<table width="100%" class="notopnoleftnoright">';
-print '<tr><td class="notopnoleft width="50%">';
-print load_fiche_titre($langs->transcountry($LTSummary,$mysoc->country_code), '', '');
-print '</td><td>&nbsp;</td><td>';
-print load_fiche_titre($langs->transcountry($LTPaid,$mysoc->country_code), '', '');
+print '<table width="100%" class="nobordernopadding">';
+print '<tr><td>';
+print load_fiche_titre($langs->transcountry($LTSummary,$mysoc->country_code));
+
+print '</td><td width="5">&nbsp;</td><td>';
+print load_fiche_titre($langs->transcountry($LTPaid,$mysoc->country_code));
 print '</td></tr>';
 
-print '<tr><td class="notopnoleft" width="50%" valign="top">';
+print '<tr><td width="50%" valign="top">';
 
-print '<table class="noborder" width="100%">';
-print '<tr class="liste_titre">';
-print '<td width="30%">'.$langs->trans("Year")." ".$y."</td>";
+print "<table class=\"noborder\" width=\"100%\">";
+print "<tr class=\"liste_titre\">";
+print "<td width=\"30%\">".$langs->trans("Year")." $y</td>";
 if($CalcLT==0) {
     print "<td align=\"right\">".$langs->transcountry($LTCustomer,$mysoc->country_code)."</td>";
     print "<td align=\"right\">".$langs->transcountry($LTSupplier,$mysoc->country_code)."</td>";
@@ -275,7 +271,7 @@ $sql.= " WHERE f.entity = ".$conf->entity;
 $sql.= " AND f.datev >= '".$db->idate(dol_get_first_day($y,1,false))."'";
 $sql.= " AND f.datev <= '".$db->idate(dol_get_last_day($y,12,false))."'";
 $sql.= " AND localtaxtype=".$localTaxType;
-$sql.= " GROUP BY dm ASC ORDER BY dm ASC";
+$sql.= " GROUP BY dm ASC";
 
 pt($db, $sql,$langs->trans("Year")." $y");
 
diff --git a/htdocs/compta/localtax/quadri_detail.php b/htdocs/compta/localtax/quadri_detail.php
index 5fea79227f59a4d7cd718b3ec62e3d039be3ebed..7c1e99b35373e3e3a6014646fa938cef66eda70b 100644
--- a/htdocs/compta/localtax/quadri_detail.php
+++ b/htdocs/compta/localtax/quadri_detail.php
@@ -131,7 +131,7 @@ if ($conf->global->$calc==0 || $conf->global->$calc==1)	// Calculate on invoice
     $nom=$langs->trans($local==1?"LT1ReportByQuartersInDueDebtMode":"LT2ReportByQuartersInDueDebtMode");
     $calcmode=$calc==0?$langs->trans("CalcModeLT".$local):$langs->trans("CalcModeLT".$local."Rec");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     $prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) $prevquarter--;
 	else { $prevquarter=4; $prevyear--; }
@@ -163,7 +163,7 @@ if ($conf->global->$calc==2) 	// Invoice for goods, payment for services
     $nom=$langs->trans($local==1?"LT1ReportByQuartersInInputOutputMode":"LT2ReportByQuartersInInputOutputMode");
     $calcmode=$calc==0?$langs->trans("CalcModeLT".$local):$langs->trans("CalcModeLT".$local."Rec");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRulesLT",DOL_URL_ROOT.'/admin/company.php').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     $prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) $prevquarter--;
 	else { $prevquarter=4; $prevyear--; }
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 5715d3c711be764e41f70847fdb3e5790d4aa9b1..72fd65d686b72cc8f0ba8354f2974afbd1f6b06b 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -462,7 +462,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
         print '<tr><td><span class="fieldrequired">'.$langs->trans('Date').'</span></td><td>';
         $datepayment = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
         $datepayment= ($datepayment == '' ? (empty($conf->global->MAIN_AUTOFILL_DATE)?-1:'') : $datepayment);
-        Form::selectDate($datepayment,'','','',0,"add_paiement",1,1,0,0,'','',$facture->date);
+        $form->select_date($datepayment,'','','',0,"add_paiement",1,1,0,0,'','',$facture->date);
         print '</td>';
         print '<td>'.$langs->trans('Comments').'</td></tr>';
 
@@ -773,7 +773,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
                 $text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
                 print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
             }
-            print Form::formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
+            print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('ReceivedCustomersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
         }
 
         print "</form>\n";
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index 42370682f4be054d528c2c1a041fd9a2b83fbe23..0f03eb8ae47fa75d8bc86fa3458c2a2a5212c2a5 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -185,7 +185,7 @@ dol_fiche_head($head, 'payment', $langs->trans("PaymentCustomerInvoice"), 0, 'pa
  */
 if ($action == 'delete')
 {
-	print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
+	print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
 
 }
 
@@ -195,7 +195,7 @@ if ($action == 'delete')
 if ($action == 'valide')
 {
 	$facid = $_GET['facid'];
-	print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
+	print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
 
 }
 
@@ -206,12 +206,12 @@ $linkback = '<a href="' . DOL_URL_ROOT . '/compta/paiement/list.php">' . $langs-
 
 // Ref
 print '<tr><td width="20%">'.$langs->trans('Ref').'</td><td colspan="3">';
-print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 print '</td></tr>';
 
 // Date payment
-print '<tr><td>'.Form::editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).'</td><td colspan="3">';
-print Form::editfieldval("Date",'datep',$object->date,$object,$user->rights->facture->paiement,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
+print '<tr><td>'.$form->editfieldkey("Date",'datep',$object->date,$object,$user->rights->facture->paiement).'</td><td colspan="3">';
+print $form->editfieldval("Date",'datep',$object->date,$object,$user->rights->facture->paiement,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
 print '</td></tr>';
 
 // Payment type (VIR, LIQ, ...)
@@ -219,16 +219,16 @@ $labeltype=$langs->trans("PaymentType".$object->type_code)!=("PaymentType".$obje
 print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="3">'.$labeltype.'</td></tr>';
 
 // Payment numero
-print '<tr><td>'.Form::editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
-print Form::editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
+print '<tr><td>'.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
+print $form->editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
 print '</td></tr>';
 
 // Amount
 print '<tr><td>'.$langs->trans('Amount').'</td><td colspan="3">'.price($object->montant,'',$langs,0,0,-1,$conf->currency).'</td></tr>';
 
 // Note
-print '<tr><td class="tdtop">'.Form::editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).'</td><td colspan="3">';
-print Form::editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea');
+print '<tr><td class="tdtop">'.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->facture->paiement).'</td><td colspan="3">';
+print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->facture->paiement,'textarea');
 print '</td></tr>';
 
 $disable_delete = 0;
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index a785094807f430939e2669dcee56b37a22b8fbab..fba7a9044faefa33febb69ea9b55f7159628e697 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -339,7 +339,7 @@ else
 	 */
 	if ($action == 'delete')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("DeleteCheckReceipt"), $langs->trans("ConfirmDeleteCheckReceipt"), 'confirm_delete','','',1);
 
 	}
 
@@ -348,7 +348,7 @@ else
 	 */
 	if ($action == 'valide')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("ValidateCheckReceipt"), $langs->trans("ConfirmValidateCheckReceipt"), 'confirm_valide','','',1);
 
 	}
 
@@ -361,7 +361,7 @@ else
 			array('type' => 'hidden','name' => 'bankid','value' => GETPOST('lineid')),
 			array('type' => 'date','name' => 'rejectdate_','label' => $langs->trans("RejectCheckDate"),'value' => dol_now())
 		);
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("RejectCheck"), $langs->trans("ConfirmRejectCheck"), 'confirm_reject_check',$formquestion,'',1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("RejectCheck"), $langs->trans("ConfirmRejectCheck"), 'confirm_reject_check',$formquestion,'',1);
 	}
 }
 
@@ -387,7 +387,7 @@ if ($action == 'new')
 	//print '<tr><td width="30%">'.$langs->trans('Date').'</td><td width="70%">'.dol_print_date($now,'day').'</td></tr>';
 	// Filter
 	print '<tr><td width="200">'.$langs->trans("DateChequeReceived").'</td><td>';
-	print Form::selectDate($filterdate,'fd',0,0,1,'',1,1,1);
+	print $form->select_date($filterdate,'fd',0,0,1,'',1,1,1);
 	print '</td></tr>';
     print '<tr><td>'.$langs->trans("BankAccount").'</td><td>';
     $form->select_comptes($filteraccountid,'accountid',0,'courant <> 2',1);
@@ -582,7 +582,7 @@ else
 	}
 	else
 	{
-	    print Form::showrefnav($object,'ref',$linkback, 1, 'number');
+	    print $form->showrefnav($object,'ref',$linkback, 1, 'number');
 	}
 
 	print '</td>';
@@ -601,7 +601,7 @@ else
         print '<form name="setdate" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
         print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
         print '<input type="hidden" name="action" value="setdate">';
-        Form::selectDate($object->date_bordereau,'datecreate_','','','',"setdate");
+        $form->select_date($object->date_bordereau,'datecreate_','','','',"setdate");
         print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
         print '</form>';
     }
diff --git a/htdocs/compta/paiement/cheque/class/remisecheque.class.php b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
index bad8b58cd5f887167cfb34cd2a13129d6b010d17..e70993bcaedbe80e773edadce9a8a2882f124465 100644
--- a/htdocs/compta/paiement/cheque/class/remisecheque.class.php
+++ b/htdocs/compta/paiement/cheque/class/remisecheque.class.php
@@ -502,7 +502,7 @@ class RemiseCheque extends CommonObject
 
 		dol_syslog("RemiseCheque::generatePdf model=".$model." id=".$this->id, LOG_DEBUG);
 
-		$dir=DOL_DOCUMENT_ROOT ."/core/modules/cheque/doc/";
+		$dir=DOL_DOCUMENT_ROOT ."/core/modules/cheque/pdf/";
 
 		// Charge le modele
 		$file = "pdf_".$model.".class.php";
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index ff4beea6c0e712d89a7b6b9402d6699f96fde400..5b4929ae42b1b2d22ceeda8f4444b067cb20d5a1 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -162,7 +162,7 @@ if ($resql)
 	print '</td>';
 	print '<td></td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     print "</tr>\n";
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index f095e2ad577a07af4c2865bb70c5b83a22fa16d4..bcca56ed6457cceb637180e35b16a40a11d263a1 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -265,7 +265,7 @@ if ($resql)
     print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">';
 	print '</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     if (! empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php
index 83c86cb528e1e1853a313db9ddf587db63d4bdbe..a68f34453053730230c70b5900e743156a66c30a 100644
--- a/htdocs/compta/paiement_charge.php
+++ b/htdocs/compta/paiement_charge.php
@@ -209,7 +209,7 @@ if ($_GET["action"] == 'create')
 	print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
 	$datepaye = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 	$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0;
-	Form::selectDate($datepayment,'','','','',"add_payment",1,1);
+	$form->select_date($datepayment,'','','','',"add_payment",1,1);
 	print "</td>";
 	print '</tr>';
 
diff --git a/htdocs/compta/payment_sc/card.php b/htdocs/compta/payment_sc/card.php
index a621a008f1bf581f7613cdded0679ad9e585746c..ad59687b43c23294445dd1e2cd52499422fee282 100644
--- a/htdocs/compta/payment_sc/card.php
+++ b/htdocs/compta/payment_sc/card.php
@@ -144,7 +144,7 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentSocialContribution"), 0,
  */
 if ($action == 'delete')
 {
-	print Form::formconfirm('card.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
+	print $form->formconfirm('card.php?id='.$paiement->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
 	
 }
 
@@ -154,7 +154,7 @@ if ($action == 'delete')
 if ($action == 'valide')
 {
 	$facid = $_GET['facid'];
-	print Form::formconfirm('card.php?id='.$paiement->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
+	print $form->formconfirm('card.php?id='.$paiement->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
 	
 }
 
@@ -164,7 +164,7 @@ print '<table class="border" width="100%">';
 // Ref
 print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td>';
 print '<td colspan="3">';
-print Form::showrefnav($paiement,'id','',1,'rowid','id');
+print $form->showrefnav($paiement,'id','',1,'rowid','id');
 print '</td></tr>';
 
 // Date
diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index ea6c40ae159a2834871cac2ed26fb5c0f3225a07..9dd841e0addc157cdc07e99b7fcb2c4d56c7b272 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -156,7 +156,7 @@ if ($id > 0)
 
 	/*if ($action == 'credite')
 	{
-		print Form::formconfirm("card.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
+		print $form->formconfirm("card.php?id=".$bon->id,$langs->trans("ClassCredited"),$langs->trans("ClassCreditedConfirm"),"confirm_credite",'',1,1);
 
 	}*/
 
@@ -214,7 +214,7 @@ if ($id > 0)
 		print '<tr class="liste_titre">';
 		print '<td colspan="3">'.$langs->trans("NotifyTransmision").'</td></tr>';
 		print '<tr '.$bc[false].'><td width="20%">'.$langs->trans("TransData").'</td><td>';
-		print Form::selectDate('','','','','',"userfile",1,1);
+		print $form->select_date('','','','','',"userfile",1,1);
 		print '</td></tr>';
 		print '<tr '.$bc[false].'><td width="20%">'.$langs->trans("TransMetod").'</td><td>';
 		print $form->selectarray("methode",$bon->methodes_trans);
@@ -237,7 +237,7 @@ if ($id > 0)
 		print '<tr class="liste_titre">';
 		print '<td colspan="3">'.$langs->trans("NotifyCredit").'</td></tr>';
 		print '<tr '.$bc[false].'><td width="20%">'.$langs->trans('CreditDate').'</td><td>';
-		print Form::selectDate('','','','','',"infocredit",1,1);
+		print $form->select_date('','','','','',"infocredit",1,1);
 		print '</td></tr>';
 		print '</table>';
 		print '<br>'.$langs->trans("ThisWillAlsoAddPaymentOnInvoice");
diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php
index d21f7dc9ba7282881c448201ca47d15c3943fd5a..d43ba27ef2665da439ba2ff81c80f1f4d1c71e33 100644
--- a/htdocs/compta/prelevement/ligne.php
+++ b/htdocs/compta/prelevement/ligne.php
@@ -193,13 +193,13 @@ if ($id)
 		//Select yes/no
 		print '<tr><td class="valid">'.$langs->trans("WithdrawalRefusedConfirm").' '.$soc->name.' ?</td>';
 		print '<td colspan="2" class="valid">';
-		print Form::selectyesno("confirm",1,0);
+		print $form->selectyesno("confirm",1,0);
 		print '</td></tr>';
 
 		//Date
 		print '<tr><td class="fieldrequired valid">'.$langs->trans("RefusedData").'</td>';
 		print '<td colspan="2" class="valid">';
-		print Form::selectDate('','','','','',"confirm_rejet");
+		print $form->select_date('','','','','',"confirm_rejet");
 		print '</td></tr>';
 
 		//Reason
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 148052aa0006fa30fe646e0b292621235861e1a6..e7cef1a50ad28682114750a1f05c8ab986e0b1d1 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -137,7 +137,7 @@ if ($result)
     print '<td class="liste_titre">&nbsp;</td>';
     print '<td class="liste_titre">&nbsp;</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     print '</tr>';
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index dd69ee71d6eba30b12928e866055ca3d2e5134b9..4286c6a8453c0c3b43e5112eff406ecc4c0c46b4 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -125,7 +125,7 @@ if ($modecompta=="CREANCES-DETTES")
     $name=$langs->trans("AnnualByCompaniesDueDebtMode");
 	$calcmode=$langs->trans("CalcModeDebt");
     $calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     //$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
     $description=$langs->trans("RulesResultDue");
 	if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
@@ -137,8 +137,8 @@ else {
     $name=$langs->trans("AnnualByCompaniesInputOutputMode");
 	$calcmode=$langs->trans("CalcModeEngagement");
     $calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=CREANCES-DETTES">','</a>').')';
-    //$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',1,1,0,'',1,0,1);
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     //$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
     $description=$langs->trans("RulesResultInOut");
     $builddate=time();
diff --git a/htdocs/compta/salaries/card.php b/htdocs/compta/salaries/card.php
index eea7746dbeb9c6219e41fa282017f48d577b17f5..4a8dc21ca1b7b3a138df9f339b9c3d965772d50a 100644
--- a/htdocs/compta/salaries/card.php
+++ b/htdocs/compta/salaries/card.php
@@ -239,13 +239,13 @@ if ($action == 'create')
 	// Date payment
 	print '<tr><td>';
 	print fieldLabel('DatePayment','datep',1).'</td><td>';
-	print Form::selectDate((empty($datep)?-1:$datep),"datep",'','','','add',1,1);
+	print $form->select_date((empty($datep)?-1:$datep),"datep",'','','','add',1,1);
 	print '</td></tr>';
 
 	// Date value for bank
 	print '<tr><td>';
 	print fieldLabel('DateValue','datev',0).'</td><td>';
-	print Form::selectDate((empty($datev)?-1:$datev),"datev",'','','','add',1,1);
+	print $form->select_date((empty($datev)?-1:$datev),"datev",'','','','add',1,1);
 	print '</td></tr>';
 
 	// Employee
@@ -263,13 +263,13 @@ if ($action == 'create')
 	// Date start period
 	print '<tr><td>';
 	print fieldLabel('DateStartPeriod','datesp',1).'</td><td>';
-	print Form::selectDate($datesp,"datesp",'','','','add');
+	print $form->select_date($datesp,"datesp",'','','','add');
 	print '</td></tr>';
 
 	// Date end period
 	print '<tr><td>';
 	print fieldLabel('DateEndPeriod','dateep',1).'</td><td>';
-	print Form::selectDate($dateep,"dateep",'','','','add');
+	print $form->select_date($dateep,"dateep",'','','','add');
 	print '</td></tr>';
 
 	// Amount
@@ -340,7 +340,7 @@ if ($id)
 	
     print "<tr>";
 	print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+	print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
 	print '</td></tr>';
 
 	// Employee
diff --git a/htdocs/compta/salaries/document.php b/htdocs/compta/salaries/document.php
index 7f89d9967c204a4070f38a32c92f56c4ba923a61..7e015a4ad2ea18f85cadb03d91eea924833bf8b5 100644
--- a/htdocs/compta/salaries/document.php
+++ b/htdocs/compta/salaries/document.php
@@ -108,7 +108,7 @@ if ($object->id)
 
 	// Ref
 	print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+	print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
 	print '</td></tr>';
 
 	// Societe
diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php
index 33218b00f02b1f61de2949ae8054c6f3c820fab1..b0584d628508687c13488a942ad9b1d10a188b34 100644
--- a/htdocs/compta/salaries/index.php
+++ b/htdocs/compta/salaries/index.php
@@ -176,7 +176,7 @@ if ($result)
 	print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
 
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php
index ba1e97f0db90be3dff078fd9c384d1afcf6c7325..2a9894be87a72813bbbb37fc90ed630868d59fe7 100644
--- a/htdocs/compta/sociales/charges.php
+++ b/htdocs/compta/sociales/charges.php
@@ -270,7 +270,7 @@ if ($action == 'create')
     print $langs->trans("PeriodEndDate");
     print '</td>';
    	print '<td>';
-    print Form::selectDate(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1);
+    print $form->select_date(! empty($dateperiod)?$dateperiod:'-1', 'period', 0, 0, 0, 'charge', 1);
 	print '</td>';
     print '</tr>';
     // Amount
@@ -286,7 +286,7 @@ if ($action == 'create')
     print $langs->trans("DateDue");
     print '</td>';
     print '<td>';
-    print Form::selectDate(! empty($dateech)?$dateech:'-1', 'ech', 0, 0, 0, 'charge', 1);
+    print $form->select_date(! empty($dateech)?$dateech:'-1', 'ech', 0, 0, 0, 'charge', 1);
 	print '</td>';
     print "</tr>\n";
 
@@ -325,20 +325,20 @@ if ($id > 0)
 
 			);
 
-		    print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneTax'),$langs->trans('ConfirmCloneTax',$object->ref),'confirm_clone',$formclone,'yes');
+		    print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneTax'),$langs->trans('ConfirmCloneTax',$object->ref),'confirm_clone',$formclone,'yes');
 		}
 
 		// Confirmation de la suppression de la charge
 		if ($action == 'paid')
 		{
 			$text=$langs->trans('ConfirmPaySocialContribution');
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans('PaySocialContribution'),$text,"confirm_paid",'','',2);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans('PaySocialContribution'),$text,"confirm_paid",'','',2);
 		}
 
 		if ($action == 'delete')
 		{
 			$text=$langs->trans('ConfirmDeleteSocialContribution');
-			print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSocialContribution'),$text,'confirm_delete','','',2);
+			print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSocialContribution'),$text,'confirm_delete','','',2);
 		}
 
 		if ($action == 'edit')
@@ -351,7 +351,7 @@ if ($id > 0)
 
 		// Ref
 		print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="2">';
-		print Form::showrefnav($object,'id');
+		print $form->showrefnav($object,'id');
 		print "</td></tr>";
 
 		// Label
@@ -443,7 +443,7 @@ if ($id > 0)
 		print "<td>";
 		if ($action == 'edit')
 		{
-			print Form::selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1);
+			print $form->select_date($object->periode, 'period', 0, 0, 0, 'charge', 1);
 		}
 		else
 		{
@@ -455,7 +455,7 @@ if ($id > 0)
 		if ($action == 'edit')
 		{
 			print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
-			print Form::selectDate($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
+			print $form->select_date($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
 			print "</td></tr>";
 		}
 		else {
diff --git a/htdocs/compta/sociales/document.php b/htdocs/compta/sociales/document.php
index 81bc7e533824338f0bac15a99d89b6e7d776acab..f87791dfed9aec3b50ecffa6284980e40dc45a92 100644
--- a/htdocs/compta/sociales/document.php
+++ b/htdocs/compta/sociales/document.php
@@ -107,7 +107,7 @@ if ($object->id)
 
     // Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object,'id');
+	print $form->showrefnav($object,'id');
 	print "</td></tr>";
 
     // Label
@@ -130,7 +130,7 @@ if ($object->id)
     print "<td>";
     if ($action == 'edit')
     {
-        print Form::selectDate($object->periode, 'period', 0, 0, 0, 'charge', 1);
+        print $form->select_date($object->periode, 'period', 0, 0, 0, 'charge', 1);
     }
     else
     {
@@ -143,7 +143,7 @@ if ($object->id)
     if ($action == 'edit')
     {
         print '<tr><td>'.$langs->trans("DateDue")."</td><td>";
-        print Form::selectDate($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
+        print $form->select_date($object->date_ech, 'ech', 0, 0, 0, 'charge', 1);
         print "</td></tr>";
     }
     else {
diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php
index d33d3ea2414ff9951c4077536257742aafe1d217..3133022b9e671b92ca4a13db22f28e44ba77b378 100644
--- a/htdocs/compta/sociales/index.php
+++ b/htdocs/compta/sociales/index.php
@@ -205,7 +205,7 @@ if ($resql)
 		print '<td class="liste_titre">&nbsp;</td>';
 
         print '<td class="liste_titre" align="right">';
-        $searchpitco=Form::showFilterAndCheckAddButtons();
+        $searchpitco=$form->showFilterAndCheckAddButtons(0);
         print $searchpitco;
         print '</td>';
 		print "</tr>\n";
diff --git a/htdocs/compta/stats/cabyprodserv.php b/htdocs/compta/stats/cabyprodserv.php
index 5ff08743dcfb61ece6becb30c6f303ebf7c775da..e995b06aa6b89525ed887f67f980c1bfc6e941fb 100644
--- a/htdocs/compta/stats/cabyprodserv.php
+++ b/htdocs/compta/stats/cabyprodserv.php
@@ -150,7 +150,7 @@ if ($modecompta=="CREANCES-DETTES") {
 	$calcmode=$langs->trans("CalcModeDebt");
 	$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=RECETTES-DEPENSES">','</a>').')';
 
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 
 	$description=$langs->trans("RulesCADue");
 	if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
@@ -164,7 +164,7 @@ if ($modecompta=="CREANCES-DETTES") {
 	$calcmode=$langs->trans("CalcModeEngagement");
 	$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=CREANCES-DETTES">','</a>').')';
 
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 
 	$description=$langs->trans("RulesCAIn");
 	$description.= $langs->trans("DepositsAreIncluded");
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index 54a59926f5ba942aa582beb331e167413732d8f6..cb8151cf33c337912029d6eed20f6ebb37c21d00 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -139,7 +139,7 @@ if ($modecompta=="CREANCES-DETTES") {
     $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice");
     $calcmode=$langs->trans("CalcModeDebt");
     $calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=RECETTES-DEPENSES">','</a>').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     //$periodlink="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
     $description=$langs->trans("RulesCADue");
 	if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
@@ -150,7 +150,7 @@ if ($modecompta=="CREANCES-DETTES") {
     $nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByUserAuthorOfInvoice");
 	$calcmode=$langs->trans("CalcModeEngagement");
     $calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=CREANCES-DETTES">','</a>').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     //$periodlink="<a href='".$_SERVER["PHP_SELF"]."?year=".($year-1)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year+1)."&modecompta=".$modecompta."'>".img_next()."</a>";
     $description=$langs->trans("RulesCAIn");
 	$description.= $langs->trans("DepositsAreIncluded");
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index d6b40e4438975bd7f2a3abd7baf0de71dc46e052..dade07fd0e387d7cfe89fa740060602a22e10f70 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -155,7 +155,7 @@ if ($modecompta=="CREANCES-DETTES")
 	$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties");
 	$calcmode=$langs->trans("CalcModeDebt");
 	$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=RECETTES-DEPENSES">','</a>').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 	//$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
 	$description=$langs->trans("RulesCADue");
 	if (! empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) $description.= $langs->trans("DepositsAreNotIncluded");
@@ -166,7 +166,7 @@ if ($modecompta=="CREANCES-DETTES")
 	$nom=$langs->trans("SalesTurnover").', '.$langs->trans("ByThirdParties");
 	$calcmode=$langs->trans("CalcModeEngagement");
 	$calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.'&modecompta=CREANCES-DETTES">','</a>').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 	//$periodlink='<a href="'.$_SERVER["PHP_SELF"].'?year='.($year-1).'&modecompta='.$modecompta.'">'.img_previous().'</a> <a href="'.$_SERVER["PHP_SELF"].'?year='.($year+1).'&modecompta='.$modecompta.'">'.img_next().'</a>';
 	$description=$langs->trans("RulesCAIn");
 	$description.= $langs->trans("DepositsAreIncluded");
diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php
index 70133f6c82f0de08b3b4306ef97e039162b8ef9d..f7d8361b8ff1443508f98ad0269d25c747e4690b 100644
--- a/htdocs/compta/tva/card.php
+++ b/htdocs/compta/tva/card.php
@@ -42,7 +42,7 @@ $socid = isset($_GET["socid"])?$_GET["socid"]:'';
 if ($user->societe_id) $socid=$user->societe_id;
 $result = restrictedArea($user, 'tax', '', '', 'charges');
 
-$object = new Tva($db);
+$tva = new Tva($db);
 
 // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
 $hookmanager->initHooks(array('taxvatcard','globalcard'));
@@ -52,22 +52,12 @@ $hookmanager->initHooks(array('taxvatcard','globalcard'));
  * Actions
  */
 
-if ($_POST["cancel"] == $langs->trans("Cancel") && ! $id)
+if ($_POST["cancel"] == $langs->trans("Cancel"))
 {
 	header("Location: reglement.php");
 	exit;
 }
 
-if ($action == 'setdatev' && $user->rights->tax->charges->creer)
-{
-    $object->fetch($id);
-    $object->datev=dol_mktime(12,0,0,$_POST['datevmonth'],$_POST['datevday'],$_POST['datevyear']);
-    $result=$object->update($user);
-    if ($result < 0) dol_print_error($db,$object->error);
-    
-    $action='';
-}
-
 if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 {
     $error=0;
@@ -75,36 +65,36 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 	$datev=dol_mktime(12,0,0, $_POST["datevmonth"], $_POST["datevday"], $_POST["datevyear"]);
     $datep=dol_mktime(12,0,0, $_POST["datepmonth"], $_POST["datepday"], $_POST["datepyear"]);
 
-    $object->accountid=GETPOST("accountid");
-    $object->type_payment=GETPOST("type_payment");
-	$object->num_payment=GETPOST("num_payment");
-    $object->datev=$datev;
-    $object->datep=$datep;
+    $tva->accountid=GETPOST("accountid");
+    $tva->type_payment=GETPOST("type_payment");
+	$tva->num_payment=GETPOST("num_payment");
+    $tva->datev=$datev;
+    $tva->datep=$datep;
 	
 	$amount = price2num(GETPOST("amount"));
 	if ($refund == 1) {
 		$amount= -$amount;
 	}
-    $object->amount= $amount;
-	$object->label=GETPOST("label");
-	$object->note=GETPOST("note");
+    $tva->amount= $amount;
+	$tva->label=GETPOST("label");
+	$tva->note=GETPOST("note");
 	
-	if (empty($object->datev))
+	if (empty($tva->datev))
 	{
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateValue")), null, 'errors');
 		$error++;
 	}
-	if (empty($object->datep))
+	if (empty($tva->datep))
 	{
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("DatePayment")), null, 'errors');
 		$error++;
 	}
-	if (empty($object->type_payment) || $object->type_payment < 0)
+	if (empty($tva->type_payment) || $tva->type_payment < 0)
 	{
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("PaymentMode")), null, 'errors');
 		$error++;
 	}
-	if (empty($object->amount))
+	if (empty($tva->amount))
 	{
 		setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
 		$error++;
@@ -114,7 +104,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 	{
 		$db->begin();
 
-    	$ret=$object->addPayment($user);
+    	$ret=$tva->addPayment($user);
 		if ($ret > 0)
 		{
 			$db->commit();
@@ -124,7 +114,7 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 		else
 		{
 			$db->rollback();
-			setEventMessages($object->error, $object->errors, 'errors');
+			setEventMessages($tva->error, $tva->errors, 'errors');
 			$action="create";
 		}
 	}
@@ -134,19 +124,19 @@ if ($action == 'add' && $_POST["cancel"] <> $langs->trans("Cancel"))
 
 if ($action == 'delete')
 {
-    $result=$object->fetch($id);
+    $result=$tva->fetch($id);
 
-	if ($object->rappro == 0)
+	if ($tva->rappro == 0)
 	{
 	    $db->begin();
 
-	    $ret=$object->delete($user);
+	    $ret=$tva->delete($user);
 	    if ($ret > 0)
 	    {
-			if ($object->fk_bank)
+			if ($tva->fk_bank)
 			{
 				$accountline=new AccountLine($db);
-				$result=$accountline->fetch($object->fk_bank);
+				$result=$accountline->fetch($tva->fk_bank);
 				if ($result > 0) $result=$accountline->delete($user);	// $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
 			}
 
@@ -158,15 +148,15 @@ if ($action == 'delete')
 			}
 			else
 			{
-				$object->error=$accountline->error;
+				$tva->error=$accountline->error;
 				$db->rollback();
-				setEventMessages($object->error, $object->errors, 'errors');
+				setEventMessages($tva->error, $tva->errors, 'errors');
 			}
 	    }
 	    else
 	    {
 	        $db->rollback();
-	        setEventMessages($object->error, $object->errors, 'errors');
+	        setEventMessages($tva->error, $tva->errors, 'errors');
 	    }
 	}
 	else
@@ -186,7 +176,8 @@ $form = new Form($db);
 
 if ($id)
 {
-	$result = $object->fetch($id);
+    $vatpayment = new Tva($db);
+	$result = $vatpayment->fetch($id);
 	if ($result <= 0)
 	{
 		dol_print_error($db);
@@ -243,11 +234,11 @@ if ($action == 'create')
 
     print "<tr>";
     print '<td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
-    print Form::selectDate($datep,"datep",'','','','add',1,1);
+    print $form->select_date($datep,"datep",'','','','add',1,1);
     print '</td></tr>';
 
     print '<tr><td class="fieldrequired">'.$langs->trans("DateValue").'</td><td>';
-    print Form::selectDate($datev,"datev",'','','','add',1,1);
+    print $form->select_date($datev,"datev",'','','','add',1,1);
     print '</td></tr>';
 
 	// Label
@@ -306,7 +297,7 @@ if ($action == 'create')
 if ($id)
 {
 	$h = 0;
-	$head[$h][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$object->id;
+	$head[$h][0] = DOL_URL_ROOT.'/compta/tva/card.php?id='.$vatpayment->id;
 	$head[$h][1] = $langs->trans('Card');
 	$head[$h][2] = 'card';
 	$h++;
@@ -318,33 +309,29 @@ if ($id)
 
 	print "<tr>";
 	print '<td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print $object->ref;
+	print $vatpayment->ref;
 	print '</td></tr>';
 
 	// Label
-	print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->label.'</td></tr>';
+	print '<tr><td>'.$langs->trans("Label").'</td><td>'.$vatpayment->label.'</td></tr>';
 
 	print "<tr>";
 	print '<td>'.$langs->trans("DatePayment").'</td><td colspan="3">';
-	print dol_print_date($object->datep,'day');
+	print dol_print_date($vatpayment->datep,'day');
 	print '</td></tr>';
 
-
-	print '<tr><td>';
-	print $form->editfieldkey("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
-	print '</td><td colspan="3">';
-	print $form->editfieldval("DateValue", 'datev', $object->datev, $object, $user->rights->tax->charges->creer, 'day');
-	//print dol_print_date($object->datev,'day');
+	print '<tr><td>'.$langs->trans("DateValue").'</td><td colspan="3">';
+	print dol_print_date($vatpayment->datev,'day');
 	print '</td></tr>';
 
-	print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($object->amount).'</td></tr>';
+	print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="3">'.price($vatpayment->amount).'</td></tr>';
 
 	if (! empty($conf->banque->enabled))
 	{
-		if ($object->fk_account > 0)
+		if ($vatpayment->fk_account > 0)
 		{
  		   	$bankline=new AccountLine($db);
-    		$bankline->fetch($object->fk_bank);
+    		$bankline->fetch($vatpayment->fk_bank);
 
 	    	print '<tr>';
 	    	print '<td>'.$langs->trans('BankTransactionLine').'</td>';
@@ -357,22 +344,21 @@ if ($id)
 
         // Other attributes
         $parameters=array('colspan' => ' colspan="3"');
-        $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);    // Note that $action and $object may have been modified by hook
+        $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$vatpayment,$action);    // Note that $action and $object may have been modified by hook
 
 	print '</table>';
 
-	dol_fiche_end();
+	print '</div>';
 
-	
 	/*
 	* Boutons d'actions
 	*/
 	print "<div class=\"tabsAction\">\n";
-	if ($object->rappro == 0)
+	if ($vatpayment->rappro == 0)
 	{
 		if (! empty($user->rights->tax->charges->supprimer))
 		{
-			print '<a class="butActionDelete" href="card.php?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
+			print '<a class="butActionDelete" href="card.php?id='.$vatpayment->id.'&action=delete">'.$langs->trans("Delete").'</a>';
 		}
 		else
 		{
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index 6e59b44514a74b933ceca03f69245e1b80b36dae..b0d7a9bce3051d8f085ab7beb488a5e854d66364 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -140,7 +140,7 @@ if ($modetax==1) {	// Calculate on invoice for goods and services
 	$calcmode=$langs->trans("CalcModeVATDebt");
 	$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
 	//$name.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 	//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
 	$description=$langs->trans("RulesVATDueServices");
 	$description.='<br>';
@@ -183,7 +183,7 @@ if ($modetax==0) {	// Invoice for goods, payment for services
 	$calcmode=$langs->trans("CalcModeVATEngagement");
 	$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
 	//$name.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 	//$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
 	$description=$langs->trans("RulesVATInServices");
 	$description.=' '.$langs->trans("DepositsAreIncluded");
diff --git a/htdocs/compta/tva/index.php b/htdocs/compta/tva/index.php
index c49b24102cb18cf5e620000964499840b55dbae2..dc2be67e44f5d4bf6ba2cbf2e93950920c6984a7 100644
--- a/htdocs/compta/tva/index.php
+++ b/htdocs/compta/tva/index.php
@@ -56,7 +56,7 @@ if (isset($_GET["modetax"])) $modetax=$_GET["modetax"];
 
 
 /**
- * print function
+ * pt
  *
  * @param 	DoliDB	$db		Database handler
  * @param 	string	$sql	SQL Request
diff --git a/htdocs/compta/tva/quadri_detail.php b/htdocs/compta/tva/quadri_detail.php
index 8fbf0d89093a2fbc99f5da0529bd01f9053e2aa6..e04530a9dc70853596157ab041a6e09a0c92ea3d 100644
--- a/htdocs/compta/tva/quadri_detail.php
+++ b/htdocs/compta/tva/quadri_detail.php
@@ -130,7 +130,7 @@ if ($modetax==1)	// Calculate on invoice for goods and services
     $nom=$langs->trans("VATReportByQuartersInDueDebtMode");
     $calcmode=$langs->trans("CalcModeVATDebt");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     $prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) $prevquarter--;
 	else { $prevquarter=4; $prevyear--; }
@@ -165,7 +165,7 @@ if ($modetax==0) 	// Invoice for goods, payment for services
     $nom=$langs->trans("VATReportByQuartersInInputOutputMode");
     $calcmode=$langs->trans("CalcModeVATEngagement");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
-    $period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+    $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     $prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) $prevquarter--;
 	else { $prevquarter=4; $prevyear--; }
diff --git a/htdocs/compta/tva/quarter_report.php b/htdocs/compta/tva/quarter_report.php
index 7f4157fceea924fce790c3f4080dd0628f417cd2..61d019894e8610d61b20e45f62bf8fc96a102c56 100644
--- a/htdocs/compta/tva/quarter_report.php
+++ b/htdocs/compta/tva/quarter_report.php
@@ -149,7 +149,7 @@ if ($modetax==1) { // Calculate on invoice for goods and services
 	$nom=$langs->trans("VATReportByQuartersInDueDebtMode");
 	$calcmode=$langs->trans("CalcModeVATDebt");
 	$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 	$prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) {
 		$prevquarter--;
@@ -198,7 +198,7 @@ if ($modetax==0) {	// Invoice for goods, payment for services
 	$nom=$langs->trans("VATReportByQuartersInInputOutputMode");
 	$calcmode=$langs->trans("CalcModeVATEngagement");
 	$calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
-	$period=Form::selectDate($date_start,'date_start',0,0,0,'',1,0,1).' - '.Form::selectDate($date_end,'date_end',0,0,0,'',1,0,1);
+	$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
 	$prevyear=$year_start; $prevquarter=$q;
 	if ($prevquarter > 1) {
 		$prevquarter--;
diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php
index 1c17e68362a3935c7b24bbff37e8079f57534de9..9615bec99f15d18ad15f2d1df90eb2fc20051eb0 100644
--- a/htdocs/compta/tva/reglement.php
+++ b/htdocs/compta/tva/reglement.php
@@ -1,6 +1,6 @@
 <?php
 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
- * Copyright (C) 2004-2016 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2004-2015 Laurent Destailleur  <eldy@users.sourceforge.net>
  * Copyright (C) 2005-2009 Regis Houssin        <regis.houssin@capnetworks.com>
  * Copyright (C) 2011-2014 Alexandre Spangaro   <aspangaro.dolibarr@gmail.com>
  *
@@ -91,7 +91,7 @@ $form = new Form($db);
 $formother=new FormOther($db);
 $tva_static = new Tva($db);
 
-$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dv, t.datep as dp, t.fk_typepayment as type, t.num_payment, pst.code as payment_code";
+$sql = "SELECT t.rowid, t.amount, t.label, t.datev as dm, t.fk_typepayment as type, t.num_payment, pst.code as payment_code";
 $sql.= " FROM ".MAIN_DB_PREFIX."tva as t";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as pst ON t.fk_typepayment = pst.id";
 $sql.= " WHERE t.entity = ".$conf->entity;
@@ -151,8 +151,7 @@ if ($result)
     print '<tr class="liste_titre">';
 	print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"t.rowid","",$param,"",$sortfield,$sortorder);
 	print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"t.label","",$param,'align="left"',$sortfield,$sortorder);
-	print_liste_field_titre($langs->trans("DateValue"),$_SERVER["PHP_SELF"],"dv","",$param,'align="center"',$sortfield,$sortorder);
-	print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dp","",$param,'align="center"',$sortfield,$sortorder);
+	print_liste_field_titre($langs->trans("DatePayment"),$_SERVER["PHP_SELF"],"dm","",$param,'align="center"',$sortfield,$sortorder);
 	print_liste_field_titre($langs->trans("Type"),$_SERVER["PHP_SELF"],"type","",$param,'align="left"',$sortfield,$sortorder);
 	print_liste_field_titre($langs->trans("PayedByThisPayment"),$_SERVER["PHP_SELF"],"t.amount","",$param,'align="right"',$sortfield,$sortorder);
 	print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch ');
@@ -161,7 +160,6 @@ if ($result)
 	print '<tr class="liste_titre">';
 	print '<td class="liste_titre"><input type="text" class="flat" size="4" name="search_ref" value="'.$search_ref.'"></td>';
 	print '<td class="liste_titre"><input type="text" class="flat" size="10" name="search_label" value="'.$search_label.'"></td>';
-	print '<td class="liste_titre"></td>';
 	print '<td class="liste_titre" colspan="1" align="center">';
 	print '<input class="flat" type="text" size="1" maxlength="2" name="month" value="'.$month.'">';
 	$syear = $year;
@@ -174,7 +172,7 @@ if ($result)
 	print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
 
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
@@ -199,9 +197,8 @@ if ($result)
 		$tva_static->ref=$obj->rowid;
 		print "<td>".$tva_static->getNomUrl(1)."</td>\n";
         print "<td>".dol_trunc($obj->label,40)."</td>\n";
-        print '<td align="center">'.dol_print_date($db->jdate($obj->dv),'day')."</td>\n";
-        print '<td align="center">'.dol_print_date($db->jdate($obj->dp),'day')."</td>\n";
-        // Type
+        print '<td align="center">'.dol_print_date($db->jdate($obj->dm),'day')."</td>\n";
+		// Type
 		print $type;
 		// Amount
         $total = $total + $obj->amount;
diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index 0e392374053b6b6a9e4e4bf3dadba28c3f4d52fc..3d6b792d99b54c73a43d35ef492b66b10ff7dceb 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -364,7 +364,7 @@ abstract class ActionsContactCardCommon
 
         if ($action == 'view' || $action == 'delete')
         {
-        	$this->tpl['showrefnav'] = Form::showrefnav($this->object,'id');
+        	$this->tpl['showrefnav'] = $form->showrefnav($this->object,'id');
 
         	if ($this->object->socid > 0)
         	{
@@ -413,7 +413,7 @@ abstract class ActionsContactCardCommon
         	array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login),
         	array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password));
 
-        	$this->tpl['action_create_user'] = Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion,'no');
+        	$this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion,'no');
         }
     }
 
diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php
index 709c1b303007abd2946d2558615966e3753c44dc..30a52469da29ddfe90848a768209394f3bb855d7 100644
--- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php
+++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php
@@ -107,7 +107,7 @@ class ActionsContactCardDefault extends ActionsContactCardCommon
 			// Confirm delete contact
         	if ($action == 'delete' && $user->rights->societe->contact->supprimer)
         	{
-        		$this->tpl['action_delete'] = Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
+        		$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
         	}
 		}
 
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index b1e48a42d50bc46c6ce1ec999d4419fa33123729..fca007bfd1feee229e4a93cd9f608f0cf13ded5f 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -450,7 +450,7 @@ else
     {
         if ($action == 'delete')
         {
-            print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
+            print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id.($backtopage?'&backtopage='.$backtopage:''),$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1);
         }
     }
 
@@ -633,7 +633,7 @@ else
             if (! empty($conf->mailing->enabled))
             {
             	print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
-	            print '<td>'.Form::selectyesno('no_email',(GETPOST("no_email",'alpha')?GETPOST("no_email",'alpha'):$object->no_email), 1).'</td>';
+	            print '<td>'.$form->selectyesno('no_email',(GETPOST("no_email",'alpha')?GETPOST("no_email",'alpha'):$object->no_email), 1).'</td>';
             }
             else
 			      {
@@ -688,11 +688,11 @@ else
             $form=new Form($db);
             if ($object->birthday)
             {
-                print Form::selectDate($object->birthday,'birthday',0,0,0,"perso", 1, 0, 1);
+                print $form->select_date($object->birthday,'birthday',0,0,0,"perso", 1, 0, 1);
             }
             else
             {
-                print Form::selectDate('','birthday',0,0,1,"perso", 1, 0, 1);
+                print $form->select_date('','birthday',0,0,1,"perso", 1, 0, 1);
             }
             print '</td>';
 
@@ -873,7 +873,7 @@ else
             if (! empty($conf->mailing->enabled))
             {
             	print '<td><label for="no_email">'.$langs->trans("No_Email").'</label></td>';
-	            print '<td>'.Form::selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td>';
+	            print '<td>'.$form->selectyesno('no_email',(isset($_POST["no_email"])?$_POST["no_email"]:$object->no_email), 1).'</td>';
             }
             else
 			{
@@ -1044,7 +1044,7 @@ else
                 if ($object->socid > 0) $text.=$langs->trans("UserWillBeExternalUser");
                 else $text.=$langs->trans("UserWillBeInternalUser");
             }
-            print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
+            print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CreateDolibarrLogin"),$text,"confirm_create_user",$formquestion,'yes');
 
         }
 
diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php
index c9ca56cdbb1347457b1fc68e4cfbf89ddba9f74e..8bebb6f0cfb13429b54b0c4601834e13bf08db7b 100644
--- a/htdocs/contact/perso.php
+++ b/htdocs/contact/perso.php
@@ -130,7 +130,7 @@ if ($action == 'edit')
     // Date To Birth
     print '<tr><td>'.$langs->trans("DateToBirth").'</td><td>';
     $form=new Form($db);
-    print Form::selectDate($object->birthday,'birthday',0,0,1,"perso", 1,0,1);
+    print $form->select_date($object->birthday,'birthday',0,0,1,"perso", 1,0,1);
     print '</td>';
 
     print '<td colspan="2">'.$langs->trans("Alert").': ';
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 20171da0cd996136a7746d058381292fdfe119c4..c8903d8d3631a986998c2f4fb65e07b237a7d1c2 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1148,7 +1148,7 @@ if ($action == 'create')
     print '</td></tr>';
 
     print '<tr><td><span class="fieldrequired">'.$langs->trans("Date").'</span></td><td>';
-    Form::selectDate($datecontrat,'',0,0,'',"contrat");
+    $form->select_date($datecontrat,'',0,0,'',"contrat");
     print "</td></tr>";
 
     // Project
@@ -1243,7 +1243,7 @@ else
          */
         if ($action == 'delete')
         {
-            print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1);
+            print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAContract"),$langs->trans("ConfirmDeleteAContract"),"confirm_delete",'',0,1);
 
         }
 
@@ -1264,7 +1264,7 @@ else
 
         	$text=$langs->trans('ConfirmValidateContract',$numref);
 
-            print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1);
+            print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("ValidateAContract"),$text,"confirm_valid",'',0,1);
 
         }
 
@@ -1273,7 +1273,7 @@ else
          */
         if ($action == 'close')
         {
-            print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1);
+            print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CloseAContract"),$langs->trans("ConfirmCloseContract"),"confirm_close",'',0,1);
 
         }
 
@@ -1294,31 +1294,31 @@ else
         // Ref du contrat
         if (!empty($modCodeContract->code_auto)) {
 	        print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	        print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+	        print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 	        print "</td></tr>";
         } else {
         	print '<tr>';
         	print '<td  width="20%">';
-        	print Form::editfieldkey("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer);
+        	print $form->editfieldkey("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer);
         	print '</td><td>';
-        	print Form::editfieldval("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer);
+        	print $form->editfieldval("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer);
         	print '</td>';
         	print '</tr>';
         }
 
         print '<tr>';
 		print '<td  width="20%">';
-		print Form::editfieldkey("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
+		print $form->editfieldkey("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
 		print '</td><td>';
-		print Form::editfieldval("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
+		print $form->editfieldval("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
 		print '</td>';
 		print '</tr>';
         
 		print '<tr>';
 		print '<td  width="20%">';
-		print Form::editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
+		print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
 		print '</td><td>';
-		print Form::editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
+		print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->contrat->creer);
 		print '</td>';
 		print '</tr>';
 
@@ -1346,9 +1346,9 @@ else
         // Date
         print '<tr>';
 		print '<td  width="20%">';
-		print Form::editfieldkey("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer);
+		print $form->editfieldkey("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer);
 		print '</td><td>';
-		print Form::editfieldval("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer,'datehourpicker');
+		print $form->editfieldval("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer,'datehourpicker');
 		print '</td>';
 		print '</tr>';
        /* print '<tr><td>'.$langs->trans("Date").'</td>';
@@ -1651,9 +1651,9 @@ else
                     print "<tr ".$bc[$var].">";
                     print '<td colspan="'.$colspan.'">';
                     print $langs->trans("DateStartPlanned").' ';
-                    Form::selectDate($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update");
+                    $form->select_date($db->jdate($objp->date_debut),"date_start_update",$usehm,$usehm,($db->jdate($objp->date_debut)>0?0:1),"update");
                     print ' &nbsp;&nbsp;'.$langs->trans("DateEndPlanned").' ';
-                    Form::selectDate($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update");
+                    $form->select_date($db->jdate($objp->date_fin),"date_end_update",$usehm,$usehm,($db->jdate($objp->date_fin)>0?0:1),"update");
                     print '</td>';
 
                     if (is_array($extralabelslines) && count($extralabelslines)>0) {
@@ -1691,7 +1691,7 @@ else
              */
             if ($action == 'deleteline' && ! $_REQUEST["cancel"] && $user->rights->contrat->creer && $object->lines[$cursorline-1]->id == GETPOST('rowid'))
             {
-                print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1);
+                print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("DeleteContractLine"),$langs->trans("ConfirmDeleteContractLine"),"confirm_deleteline",'',0,1);
                 if ($ret == 'html') print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
             }
 
@@ -1711,7 +1711,7 @@ else
 				'text' => $langs->trans("ConfirmMoveToAnotherContractQuestion"),
                 array('type' => 'select', 'name' => 'newcid', 'values' => $arraycontractid));
 
-                $formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion);
+                $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&lineid=".GETPOST('rowid'),$langs->trans("MoveToAnotherContract"),$langs->trans("ConfirmMoveToAnotherContract"),"confirm_move",$formquestion);
                 print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
             }
 
@@ -1723,7 +1723,7 @@ else
                 $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
                 $dateactend   = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
                 $comment      = GETPOST('comment');
-                $formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1);
+                $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment),$langs->trans("ActivateService"),$langs->trans("ConfirmActivateService",dol_print_date($dateactstart,"%A %d %B %Y")),"confirm_active", '', 0, 1);
                 print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
             }
 
@@ -1735,7 +1735,7 @@ else
                 $dateactstart = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
                 $dateactend   = dol_mktime(12, 0, 0, GETPOST('endmonth'), GETPOST('endday'), GETPOST('endyear'));
                 $comment      = GETPOST('comment');
-                $formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1);
+                $form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id."&ligne=".GETPOST('ligne')."&date=".$dateactstart."&dateend=".$dateactend."&comment=".urlencode($comment), $langs->trans("CloseService"), $langs->trans("ConfirmCloseService",dol_print_date($dateactend,"%A %d %B %Y")), "confirm_closeline", '', 0, 1);
                 print '<table class="notopnoleftnoright" width="100%"><tr '.$bc[$var].' height="6"><td></td></tr></table>';
             }
 
@@ -1824,11 +1824,11 @@ else
 
                 print '<tr '.$bc[$var].'>';
                 print '<td class="nohover">'.$langs->trans("DateServiceActivate").'</td><td class="nohover">';
-                print Form::selectDate($dateactstart,'',$usehm,$usehm,'',"active",1,0,1);
+                print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1);
                 print '</td>';
 
                 print '<td class="nohover">'.$langs->trans("DateEndPlanned").'</td><td class="nohover">';
-                print Form::selectDate($dateactend,"end",$usehm,$usehm,'',"active",1,0,1);
+                print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1);
                 print '</td>';
 
                 print '<td align="center nohover" rowspan="2" valign="middle" class="nohover">';
@@ -1881,7 +1881,7 @@ else
                     if ($objp->statut == 4)
                     {
                         print $langs->trans("DateEndReal").' ';
-                        print Form::selectDate($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1,1);
+                        print $form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",1,1,1);
                     }
                 }
                 print '</td>';
diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php
index e526b840af8f1b44227334250bc87e8896250fa9..cd070f6078d4d25a347bf8f1014890d001ae2aab 100644
--- a/htdocs/contrat/contact.php
+++ b/htdocs/contrat/contact.php
@@ -143,7 +143,7 @@ if ($id > 0 || ! empty($ref))
 
 		// Reference du contrat
 		print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 		print "</td></tr>";
 
 		// Customer
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 148abdb0ed15ccea63c4274179a347365231856e..49466c7fcb0fed3692e960becc855d05cf9fc2d9 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -110,7 +110,7 @@ if ($object->id)
     $linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
 
     // Reference
-	print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '').'</td></tr>';
+	print '<tr><td width="30%">'.$langs->trans('Ref').'</td><td colspan="3">'.$form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '').'</td></tr>';
 
     // Societe
     print '<tr><td>'.$langs->trans("Customer").'</td>';
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 93fe5547fec90c4e73f5b1fcd28fad57607ec7e9..df6e0007023870695de9de6899c58bc77bd1ebad 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -267,7 +267,7 @@ if ($resql)
     print '<td class="liste_titre">&nbsp;</td>';
     print '<td class="liste_titre" colspan="5" align="right"></td>';
     print '<td>';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     print "</tr>\n";
diff --git a/htdocs/contrat/note.php b/htdocs/contrat/note.php
index be39c90de575e01b1ff4efe453a2c4f90ff5d32b..502b354ee69b85d15e9271eba145c36f57e9c3b9 100644
--- a/htdocs/contrat/note.php
+++ b/htdocs/contrat/note.php
@@ -78,7 +78,7 @@ if ($id > 0 || ! empty($ref))
     $linkback = '<a href="'.DOL_URL_ROOT.'/contrat/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
 
     // Reference
-	print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">'.Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '').'</td></tr>';
+	print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="5">'.$form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '').'</td></tr>';
 
     // Societe
     print '<tr><td>'.$langs->trans("Customer").'</td>';
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index dff703c042af0f877ec0e7ee70b02c9bd3f42191..2f1c36970588ce6d3e3fa422854e49c16ae9a5da 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -219,14 +219,14 @@ if ($resql)
 	print $form->selectarray('filter_op1',$arrayofoperators,$filter_op1,1);
 	print ' ';
 	$filter_date1=dol_mktime(0,0,0,$op1month,$op1day,$op1year);
-	print Form::selectDate($filter_date1,'op1',0,0,1,'',1,0,1);
+	print $form->select_date($filter_date1,'op1',0,0,1,'',1,0,1);
 	print '</td>';
 	print '<td class="liste_titre" align="center">';
 	$arrayofoperators=array('<'=>'<','>'=>'>');
 	print $form->selectarray('filter_op2',$arrayofoperators,$filter_op2,1);
 	print ' ';
 	$filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year);
-	print Form::selectDate($filter_date2,'op2',0,0,1,'',1,0,1);
+	print $form->select_date($filter_date2,'op2',0,0,1,'',1,0,1);
 	print '</td>';
 	print '<td align="right">';
 	$arrayofstatus=array(
@@ -239,7 +239,7 @@ if ($resql)
 	print $form->selectarray('search_status',$arrayofstatus,(strstr($search_status, ',')?-1:$search_status),1);
 	print '</td>';
 	print '<td class="liste_titre" align="right">';
-	$searchpitco=Form::showFilterAndCheckAddButtons();
+	$searchpitco=$form->showFilterAndCheckAddButtons(0);
 	print $searchpitco;
 	print '</td>';
     print "</tr>\n";
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 3a0c6d05ff4fd5eaaceda4618523b82753976461..997e27adb2030b9c7d5654beaa2d521e2d4897af 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -241,7 +241,7 @@ if ($section)
 		$useglobalvars=1;
 		$form = new Form($db);
 		$formquestion=array('urlfile'=>array('type'=>'hidden','value'=>$urlfile,'name'=>'urlfile'));
-		print Form::formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0));
+		print $form->formconfirm($url,$langs->trans("DeleteFile"),$langs->trans("ConfirmDeleteFile"),'confirm_deletefile',$formquestion,"no",($useajax?'deletefile':0));
 	}
 
 	if ($useajax)
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 2de07969918dc89cada9431802f5876482da8b11..97645487d451363d9c0c5d3faf077add2b33a3f3 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -694,7 +694,7 @@ class ExtraFields
 
 			$showtime = in_array($type,array('datetime')) ? 1 : 0;
 
-			// Do not show current date when field not required (see selectDate() method)
+			// Do not show current date when field not required (see select_date() method)
 			if (!$required && $value == '') $value = '-1';
 
 			require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
@@ -702,7 +702,7 @@ class ExtraFields
 			if (! is_object($form)) $form=new Form($this->db);
 
 			// TODO Must also support $moreparam
-			$out = Form::selectDate($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
+			$out = $form->select_date($value, $keysuffix.'options_'.$key.$keyprefix, $showtime, $showtime, $required, '', 1, 1, 1, 0, 1);
 		}
 		elseif (in_array($type,array('int')))
 		{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a6161ba4fed44e461dc6a9f47b5e7816a7fceceb..d06677d97af6ef6699dbd3962c897cf2b46b944f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -74,15 +74,14 @@ class Form
      *
      * @param   string	$text			Text of label or key to translate
      * @param   string	$htmlname		Name of select field ('edit' prefix will be added)
-     * @param   string	$value          Value to show/edit (not used in this function)
+     * @param   string	$preselected	Name of Value to show/edit (not used in this function)
      * @param	object	$object			Object
      * @param	boolean	$perm			Permission to allow button to edit parameter. Set it to 0 to have a not edited field.
      * @param	string	$typeofdata		Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'day' or 'datepicker', 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...)
-     * @param	string	$moreparam		More param to add on a href URL*
-     * @param   int     $fieldrequired  1 if we want to show field as mandatory using the fieldrequired CSS.
+     * @param	string	$moreparam		More param to add on a href URL
      * @return	string					HTML edit field
      */
-    function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='', $fieldrequired=0)
+    function editfieldkey($text, $htmlname, $preselected, $object, $perm, $typeofdata='string', $moreparam='')
     {
         global $conf,$langs;
 
@@ -95,24 +94,18 @@ class Form
             {
                 $tmp=explode(':',$typeofdata);
                 $ret.= '<div class="editkey_'.$tmp[0].(! empty($tmp[1]) ? ' '.$tmp[1] : '').'" id="'.$htmlname.'">';
-	            if ($fieldrequired) $ret.='<span class="fieldrequired">';
                 $ret.= $langs->trans($text);
-	            if ($fieldrequired) $ret.='</span>';
                 $ret.= '</div>'."\n";
             }
             else
             {
-	            if ($fieldrequired) $ret.='<span class="fieldrequired">';
                 $ret.= $langs->trans($text);
-	            if ($fieldrequired) $ret.='</span>';
             }
         }
         else
 		{
             if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<table class="nobordernopadding" width="100%"><tr><td class="nowrap">';
-	        if ($fieldrequired) $ret.='<span class="fieldrequired">';
             $ret.=$langs->trans($text);
-	        if ($fieldrequired) $ret.='</span>';
             if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</td>';
             if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=edit'.$htmlname.'&amp;id='.$object->id.$moreparam.'">'.img_edit($langs->trans('Edit'),1).'</a></td>';
             if (GETPOST('action') != 'edit'.$htmlname && $perm) $ret.='</tr></table>';
@@ -202,14 +195,15 @@ class Form
                     $ret.=$doleditor->Create(1);
                 }
                 $ret.='</td>';
-               	
-                $ret.='<td align="left">';
-               	$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
-               	if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='<br>'."\n";
-               	$ret.='<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
-               	$ret.='</td>';
-
-               	$ret.='</tr></table>'."\n";
+                //if ($typeofdata != 'day' && $typeofdata != 'dayhour' && $typeofdata != 'datepicker' && $typeofdata != 'datehourpicker')
+                //{
+                	$ret.='<td align="left">';
+                	$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
+                	if (preg_match('/ckeditor|textarea/',$typeofdata)) $ret.='<br>'."\n";
+                	$ret.='<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
+                	$ret.='</td>';
+                //}
+                $ret.='</tr></table>'."\n";
                 $ret.='</form>'."\n";
             }
             else
@@ -3641,7 +3635,7 @@ class Form
      *    @param    int			$displaymin		Display minutes selector
      *    @param	int			$nooutput		1=No print output, return string
      *    @return	void
-     *    @see		selectDate
+     *    @see		select_date
      */
     function form_date($page, $selected, $htmlname, $displayhour=0, $displaymin=0, $nooutput=0)
     {
@@ -3968,7 +3962,6 @@ class Form
      *    @param	string	$selected    preselected currency code
      *    @param    string	$htmlname    name of HTML select list
      *    @return	void
-     * @deprecated use Form::selectCurrency
      */
     function select_currency($selected='',$htmlname='currency_id')
     {
@@ -4279,10 +4272,10 @@ class Form
      * 	@param	int			$nooutput		Do not output html string but return it
      * 	@param 	int			$disabled		Disable input fields
      *  @param  int			$fullday        When a checkbox with this html name is on, hour and day are set with 00:00 or 23:59
-     *  @param	string		$addplusone		Add a link "+1 hour". Value must be name of another selectDate field.
+     *  @param	string		$addplusone		Add a link "+1 hour". Value must be name of another select_date field.
      *  @param  datetime    $adddateof      Add a link "Date of invoice" using the following date.
      * 	@return	mixed						Nothing or string if nooutput is 1
-     *  @see	formDate
+     *  @see	form_date
      */
     function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1, $addnowlink=0, $nooutput=0, $disabled=0, $fullday='', $addplusone='', $adddateof='')
     {
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 239369b2a1c1a0bebc61a400b7f9ef450d990ba0..339ba9c6b5e8d4057395db411d467fc2227ed33f 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1,7 +1,7 @@
 <?php
 /* Copyright (C) 2008-2013	Laurent Destailleur	<eldy@users.sourceforge.net>
  * Copyright (C) 2010-2014	Regis Houssin		<regis.houssin@capnetworks.com>
- * Copyright (C) 2010-2016	Juanjo Menent		<jmenent@2byte.es>
+ * Copyright (C) 2010		Juanjo Menent		<jmenent@2byte.es>
  * Copyright (C) 2013		Charles-Fr BENKE	<charles.fr@benke.fr>
  * Copyright (C) 2013		Cédric Salvador		<csalvador@gpcsolutions.fr>
  * Copyright (C) 2014		Marcos García		<marcosgdf@gmail.com>
@@ -445,7 +445,7 @@ class FormFile
                 if (is_array($genallowed)) $modellist=$genallowed;
                 else
                 {
-                    include_once DOL_DOCUMENT_ROOT.'/core/modules/cheque/modules_chequereceipts.php';
+                    include_once DOL_DOCUMENT_ROOT.'/core/modules/cheque/pdf/modules_chequereceipts.php';
                     $modellist=ModeleChequeReceipts::liste_modeles($this->db);
                 }
             }
diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php
index 7fc7297469d958df1481126d256dd9c80a4f4808..9d540a37bb66c0714681914defc2698a026cbbcd 100644
--- a/htdocs/core/class/html.formmail.class.php
+++ b/htdocs/core/class/html.formmail.class.php
@@ -562,7 +562,7 @@ class FormMail extends Form
 					if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_SUPPLIER_PROPOSAL) && ! empty($this->param['models']) && $this->param['models'] == 'supplier_proposal_send') $defaultvaluefordeliveryreceipt=1;
         			if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_ORDER) && ! empty($this->param['models']) && $this->param['models'] == 'order_send') $defaultvaluefordeliveryreceipt=1;
         			if (! empty($conf->global->MAIL_FORCE_DELIVERY_RECEIPT_INVOICE) && ! empty($this->param['models']) && $this->param['models'] == 'facture_send') $defaultvaluefordeliveryreceipt=1;
-        			$out.= Form::selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1);
+        			$out.= $form->selectyesno('deliveryreceipt', (isset($_POST["deliveryreceipt"])?$_POST["deliveryreceipt"]:$defaultvaluefordeliveryreceipt), 1);
         		}
 
         		$out.= "</td></tr>\n";
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 2b36f3f9a31f51d7d1d6ec3d31dd951fdf43afb9..5c6b9613c17e4fa2dfeb76135bb3c59507a5942e 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1179,7 +1179,7 @@ function form_constantes($tableau,$strictw3c=0)
                 }
                 else if ($obj->type == 'yesno')
                 {
-                    print Form::selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1);
+                    print $form->selectyesno('constvalue'.(empty($strictw3c)?'':'[]'),$obj->value,1);
                     print '<input type="hidden" name="consttype'.(empty($strictw3c)?'':'[]').'" value="yesno">';
                 }
                 else
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index ce75a6ccc05810fb464e97e464a972ff5bdd5c45..12c759a67d67c1e7b8d5271607cfda01bec09e25 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -910,7 +910,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
 	{
         if ($showimage) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showphoto($modulepart,$object,0,0,0,'photoref','small',1,0,$maxvisiblephotos).'</div>';
 	}
-	if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.Form::showbarcode($object).'</div>';
+	if ($showbarcode) $morehtmlleft.='<div class="floatleft inline-block valignmiddle divphotoref">'.$form->showbarcode($object).'</div>';
 	if ($object->element == 'societe' && ! empty($conf->use_javascript_ajax) && $user->rights->societe->creer && ! empty($conf->global->MAIN_DIRECT_STATUS_UPDATE)) {
 		$morehtmlright.=ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
 	} 
@@ -947,7 +947,7 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
 		$morehtmlref.=$langs->trans("TechnicalID").': '.$object->id;
 		$morehtmlref.='</div>';
 	}
-	print Form::showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright);
+	print $form->showrefnav($object, $paramid, $morehtml, $shownav, $fieldid, $fieldref, $morehtmlref, $moreparam, $nodbprefix, $morehtmlleft, $morehtmlright);
 	print '</div>';
 	print '<div class="underrefbanner clearboth"></div>';
 }
@@ -958,7 +958,6 @@ function dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='r
  * @param	string	$langkey		Translation key
  * @param 	string	$fieldkey		Key of the html select field the text refers to
  * @param	int		$fieldrequired	1=Field is mandatory
- * @deprecated Form::editfieldkey
  */
 function fieldLabel($langkey, $fieldkey, $fieldrequired=0)
 {
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index 4587d58c7602055c554cd7ac74dcf1a5c0e5ea66..a952159b8744fd0028c365d7e5f2a544d5fd8302 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -9,7 +9,7 @@
  * Copyright (C) 2012-2015  Raphaël Doursenaud      <rdoursenaud@gpcsolutions.fr>
  * Copyright (C) 2014		Cedric GROSS			<c.gross@kreiz-it.fr>
  * Copyright (C) 2014		Teddy Andreotti			<125155@supinfo.com>
- * Copyright (C) 2015-2016  Marcos García           <marcosgdf@gmail.com>
+ * Copyright (C) 2015       Marcos García           <marcosgdf@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
  *	@param		Translate	$outputlangs		Output lang to use to autodetect output format if setup not done
  *  @return     array							Array('width'=>w,'height'=>h,'unit'=>u);
  */
-function pdf_getFormat(Translate $outputlangs = null)
+function pdf_getFormat($outputlangs='')
 {
 	global $conf,$db;
 
@@ -77,7 +77,7 @@ function pdf_getFormat(Translate $outputlangs = null)
  *      @param	string		$format         Array(width,height). Keep empty to use default setup.
  *      @param	string		$metric         Unit of format ('mm')
  *      @param  string		$pagetype       'P' or 'l'
- *      @return TCPDF						PDF object
+ *      @return TPDF						PDF object
  */
 function pdf_getInstance($format='',$metric='mm',$pagetype='P')
 {
@@ -230,7 +230,7 @@ function pdf_getInstance($format='',$metric='mm',$pagetype='P')
  *      @param	Translate	$outputlangs    Output langs object
  *      @return string          			Name of font to use
  */
-function pdf_getPDFFont(Translate $outputlangs)
+function pdf_getPDFFont($outputlangs)
 {
 	global $conf;
 
@@ -253,7 +253,7 @@ function pdf_getPDFFont(Translate $outputlangs)
  *      @param	Translate	$outputlangs     Output langs object
  *      @return int				             Size of font to use
  */
-function pdf_getPDFFontSize(Translate $outputlangs)
+function pdf_getPDFFontSize($outputlangs)
 {
 	$size=10;                   // By default, for FPDI or ISO language on TCPDF
 	if (class_exists('TCPDF'))  // If TCPDF on, we can use an UTF8 one like DejaVuSans if required (slower)
@@ -295,10 +295,9 @@ function pdf_getHeightForLogo($logo, $url = false)
  * 
  * @param TCPDF     $pdf            PDF initialized object
  * @param string    $htmlcontent    HTML Contect
- * @return int
  * @see getStringHeight
  */
-function pdfGetHeightForHtmlContent(TCPDF $pdf, $htmlcontent)
+function pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
 {
     // store current object
     $pdf->startTransaction();
@@ -378,7 +377,7 @@ function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includeali
  *      @param  Object      $object             Object we want to build document for
  * 		@return	string							String with full address
  */
-function pdf_build_address(Translate $outputlangs, Societe $sourcecompany,$targetcompany='',$targetcontact='',$usecontact=0,$mode='source',$object=null)
+function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$targetcontact='',$usecontact=0,$mode='source',$object=null)
 {
 	global $conf, $hookmanager;
 
@@ -531,12 +530,12 @@ function pdf_build_address(Translate $outputlangs, Societe $sourcecompany,$targe
 /**
  *   	Show header of page for PDF generation
  *
- *   	@param      TCPDF			$pdf     		Object PDF
+ *   	@param      PDF			$pdf     		Object PDF
  *      @param      Translate	$outputlangs	Object lang for output
  * 		@param		int			$page_height	Height of page
  *      @return	void
  */
-function pdf_pagehead(TCPDF $pdf, Translate $outputlangs,$page_height)
+function pdf_pagehead(&$pdf,$outputlangs,$page_height)
 {
 	global $conf;
 
@@ -552,7 +551,7 @@ function pdf_pagehead(TCPDF $pdf, Translate $outputlangs,$page_height)
 /**
  *      Add a draft watermark on PDF files
  *
- *      @param	TCPDF      	$pdf           Object PDF
+ *      @param	PDF      	$pdf           Object PDF
  *      @param  Translate	$outputlangs	Object lang
  *      @param  int		    $h		        Height of PDF
  *      @param  int		    $w		        Width of PDF
@@ -560,7 +559,7 @@ function pdf_pagehead(TCPDF $pdf, Translate $outputlangs,$page_height)
  *      @param  string		$text           Text to show
  *      @return	void
  */
-function pdf_watermark(TCPDF $pdf, Translate $outputlangs, $h, $w, $unit, $text)
+function pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
 {
 	// Print Draft Watermark
 	if ($unit=='pt') $k=1;
@@ -592,7 +591,7 @@ function pdf_watermark(TCPDF $pdf, Translate $outputlangs, $h, $w, $unit, $text)
 /**
  *  Show bank informations for PDF generation
  *
- *  @param	TCPDF			$pdf            		Object PDF
+ *  @param	PDF			$pdf            		Object PDF
  *  @param  Translate	$outputlangs     		Object lang
  *  @param  int			$curx            		X
  *  @param  int			$cury            		Y
@@ -601,7 +600,7 @@ function pdf_watermark(TCPDF $pdf, Translate $outputlangs, $h, $w, $unit, $text)
  *  @param	int			$default_font_size		Default font size
  *  @return	float                               The Y PDF position
  */
-function pdf_bank(TCPDF $pdf, Translate $outputlangs,$curx,$cury, Account $account,$onlynumber=0,$default_font_size=10)
+function pdf_bank(&$pdf,$outputlangs,$curx,$cury,$account,$onlynumber=0,$default_font_size=10)
 {
 	global $mysoc, $conf;
 
@@ -784,19 +783,19 @@ function pdf_bank(TCPDF $pdf, Translate $outputlangs,$curx,$cury, Account $accou
 /**
  *  Show footer of page for PDF generation
  *
- *	@param	TCPDF			$pdf     		The PDF factory
+ *	@param	PDF			$pdf     		The PDF factory
  *  @param  Translate	$outputlangs	Object lang for output
  * 	@param	string		$paramfreetext	Constant name of free text
  * 	@param	Societe		$fromcompany	Object company
  * 	@param	int			$marge_basse	Margin bottom we use for the autobreak
  * 	@param	int			$marge_gauche	Margin left (no more used)
  * 	@param	int			$page_hauteur	Page height (no more used)
- * 	@param	object		$object			Object shown in PDF
+ * 	@param	Object		$object			Object shown in PDF
  * 	@param	int			$showdetails	Show company details into footer. This param seems to not be used by standard version. (1=Show address, 2=Show managers, 3=Both)
  *  @param	int			$hidefreetext	1=Hide free text, 0=Show free text
  * 	@return	int							Return height of bottom margin including footer text
  */
-function pdf_pagefoot(TCPDF $pdf, Translate $outputlangs,$paramfreetext, Societe $fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0,$hidefreetext=0)
+function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_basse,$marge_gauche,$page_hauteur,$object,$showdetails=0,$hidefreetext=0)
 {
 	global $conf,$user;
 
@@ -1016,7 +1015,7 @@ function pdf_pagefoot(TCPDF $pdf, Translate $outputlangs,$paramfreetext, Societe
 /**
  *	Show linked objects for PDF generation
  *
- *	@param	TCPDF			$pdf				Object PDF
+ *	@param	PDF			$pdf				Object PDF
  *	@param	object		$object				Object
  *	@param  Translate	$outputlangs		Object lang
  *	@param  int			$posx				X
@@ -1027,7 +1026,7 @@ function pdf_pagefoot(TCPDF $pdf, Translate $outputlangs,$paramfreetext, Societe
  *	@param	string		$default_font_size	Font size
  *	@return	float                           The Y PDF position
  */
-function pdf_writeLinkedObjects(TCPDF $pdf,$object, Translate $outputlangs,$posx,$posy,$w,$h,$align,$default_font_size)
+function pdf_writeLinkedObjects(&$pdf,$object,$outputlangs,$posx,$posy,$w,$h,$align,$default_font_size)
 {
 	$linkedobjects = pdf_getLinkedObjects($object,$outputlangs);
 	if (! empty($linkedobjects))
@@ -1053,8 +1052,8 @@ function pdf_writeLinkedObjects(TCPDF $pdf,$object, Translate $outputlangs,$posx
 /**
  *	Output line description into PDF
  *
- *  @param  TCPDF				$pdf               PDF object
- *	@param	object			$object				Object
+ *  @param  PDF				$pdf               PDF object
+ *	@param	Object			$object				Object
  *	@param	int				$i					Current line number
  *  @param  Translate		$outputlangs		Object lang for output
  *  @param  int				$w					Width
@@ -1066,7 +1065,7 @@ function pdf_writeLinkedObjects(TCPDF $pdf,$object, Translate $outputlangs,$posx
  * 	@param	int				$issupplierline		Is it a line for a supplier object ?
  * 	@return	string
  */
-function pdf_writelinedesc(TCPDF $pdf,$object,$i, Translate $outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0)
+function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref=0,$hidedesc=0,$issupplierline=0)
 {
 	global $db, $conf, $langs, $hookmanager;
 
@@ -1096,7 +1095,7 @@ function pdf_writelinedesc(TCPDF $pdf,$object,$i, Translate $outputlangs,$w,$h,$
 /**
  *  Return line description translated in outputlangs and encoded into htmlentities and with <br>
  *
- *  @param  object		$object              Object
+ *  @param  Object		$object              Object
  *  @param  int			$i                   Current line number (0 = first line, 1 = second line, ...)
  *  @param  Translate	$outputlangs         Object langs for output
  *  @param  int			$hideref             Hide reference
@@ -1104,7 +1103,7 @@ function pdf_writelinedesc(TCPDF $pdf,$object,$i, Translate $outputlangs,$w,$h,$
  *  @param  int			$issupplierline      Is it a line for a supplier object ?
  *  @return string       				     String with line
  */
-function pdf_getlinedesc($object,$i, Translate $outputlangs,$hideref=0,$hidedesc=0,$issupplierline=0)
+function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issupplierline=0)
 {
 	global $db, $conf, $langs;
 
@@ -1283,13 +1282,13 @@ function pdf_getlinedesc($object,$i, Translate $outputlangs,$hideref=0,$hidedesc
 /**
  *	Return line num
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlinenum($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlinenum($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1316,13 +1315,13 @@ function pdf_getlinenum($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line product ref
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineref($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineref($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1348,13 +1347,13 @@ function pdf_getlineref($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line ref_supplier
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineref_supplier($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineref_supplier($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1380,13 +1379,13 @@ function pdf_getlineref_supplier($object,$i, Translate $outputlangs,$hidedetails
 /**
  *	Return line vat rate
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlinevatrate($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1413,13 +1412,13 @@ function pdf_getlinevatrate($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line unit price excluding tax
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineupexcltax($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $conf, $hookmanager;
 
@@ -1453,13 +1452,13 @@ function pdf_getlineupexcltax($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line unit price including tax
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide value (0 = no,	1 = yes, 2 = just special lines)
  *  @return	string
  */
-function pdf_getlineupwithtax($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1486,13 +1485,13 @@ function pdf_getlineupwithtax($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line quantity
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  *  @return	string
  */
-function pdf_getlineqty($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1520,13 +1519,13 @@ function pdf_getlineqty($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line quantity asked
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineqty_asked($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1554,13 +1553,13 @@ function pdf_getlineqty_asked($object,$i, Translate $outputlangs,$hidedetails=0)
 /**
  *	Return line quantity shipped
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineqty_shipped($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1588,13 +1587,13 @@ function pdf_getlineqty_shipped($object,$i, Translate $outputlangs,$hidedetails=
 /**
  *	Return line keep to ship quantity
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineqty_keeptoship($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1622,14 +1621,14 @@ function pdf_getlineqty_keeptoship($object,$i, Translate $outputlangs,$hidedetai
 /**
  *	Return line unit
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  *  @param	HookManager	$hookmanager		Hook manager instance
  *  @return	void
  */
-function pdf_getlineunit($object, $i, Translate $outputlangs, $hidedetails = 0, $hookmanager = false)
+function pdf_getlineunit($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = false)
 {
 	global $langs;
 	
@@ -1665,13 +1664,13 @@ function pdf_getlineunit($object, $i, Translate $outputlangs, $hidedetails = 0,
 /**
  *	Return line remise percent
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string
  */
-function pdf_getlineremisepercent($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1701,14 +1700,14 @@ function pdf_getlineremisepercent($object,$i, Translate $outputlangs,$hidedetail
 /**
  * Return line percent
  *
- * @param object $object Object
+ * @param Object $object Object
  * @param int $i Current line number
  * @param Translate $outputlangs Object langs for output
  * @param int $hidedetails Hide details (0=no, 1=yes, 2=just special lines)
  * @param HookManager $hookmanager Hook manager instance
  * @return string
  */
-function pdf_getlineprogress($object, $i, Translate $outputlangs, $hidedetails = 0, HookManager $hookmanager = null)
+function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookmanager = null)
 {
 	$reshook=0;
     $result='';
@@ -1734,13 +1733,13 @@ function pdf_getlineprogress($object, $i, Translate $outputlangs, $hidedetails =
 /**
  *	Return line total excluding tax
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param  Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide details (0=no, 1=yes, 2=just special lines)
  * 	@return	string							Return total of line excl tax
  */
-function pdf_getlinetotalexcltax($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $conf, $hookmanager;
 
@@ -1778,13 +1777,13 @@ function pdf_getlinetotalexcltax($object,$i, Translate $outputlangs,$hidedetails
 /**
  *	Return line total including tax
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	int			$i					Current line number
  *  @param 	Translate	$outputlangs		Object langs for output
  *  @param	int			$hidedetails		Hide value (0 = no, 1 = yes, 2 = just special lines)
  *  @return	string							Return total of line incl tax
  */
-function pdf_getlinetotalwithtax($object,$i, Translate $outputlangs,$hidedetails=0)
+function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
 {
 	global $hookmanager;
 
@@ -1815,12 +1814,12 @@ function pdf_getlinetotalwithtax($object,$i, Translate $outputlangs,$hidedetails
 /**
  *	Return total quantity of products and/or services
  *
- *	@param	object		$object				Object
+ *	@param	Object		$object				Object
  *	@param	string		$type				Type
  *  @param  Translate	$outputlangs		Object langs for output
  * 	@return	integer
  */
-function pdf_getTotalQty($object,$type, Translate $outputlangs)
+function pdf_getTotalQty($object,$type,$outputlangs)
 {
 	global $hookmanager;
 
@@ -1867,7 +1866,7 @@ function pdf_getTotalQty($object,$type, Translate $outputlangs)
  * 	@param	Translate	$outputlangs	Object lang for output
  * 	@return	array                       Linked objects
  */
-function pdf_getLinkedObjects($object, Translate $outputlangs)
+function pdf_getLinkedObjects($object,$outputlangs)
 {
 	global $hookmanager;
 
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index dd3df558c01b05e86d7a257232f2e515f4f6f713..92229a72d237730399e5c01d1afefe598a611a41 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -636,7 +636,7 @@ function projectLinesPerDay(&$inc, $parent, $lines, &$level, &$projectsrole, &$t
 
 				// Form to add new time
 				print '<td class="nowrap" align="center">';
-				$tableCell=Form::selectDate($preselectedday,$lines[$i]->id,1,1,2,"addtime",0,0,1,$disabledtask);
+				$tableCell=$form->select_date($preselectedday,$lines[$i]->id,1,1,2,"addtime",0,0,1,$disabledtask);
 				print $tableCell;
 				print '</td><td align="right">';
 
diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql
index fdbce72eec88eafde071233cf940e234894385e3..0c154e031d86db6c3c1fe95c980d2ef734e846c4 100644
--- a/htdocs/core/menus/init_menu_auguria.sql
+++ b/htdocs/core/menus/init_menu_auguria.sql
@@ -26,7 +26,7 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$user->admin', __HANDLER__, 'left', 100__+MAX_llx_menu__, 'home', 'setup', 1__+MAX_llx_menu__, '/admin/index.php?leftmenu=setup', 'Setup', 0, 'admin', '', '', 2, 1, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 101__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/company.php?leftmenu=setup', 'MenuCompanySetup', 1, 'admin', '', '', 2, 1, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 102__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/ihm.php?leftmenu=setup', 'GUISetup', 1, 'admin', '', '', 2, 4, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup" && $conf->accounting->enabled', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 4, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->accounting->enabled', __HANDLER__, 'left', 115__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/accountancy/admin/fiscalyear.php?mainmenu=setup', 'Fiscalyear', 1, 'admin', '', '', 2, 4, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 114__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/translation.php?leftmenu=setup', 'Translation', 1, 'admin', '', '', 2, 4, __ENTITY__);
 
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="setup"', __HANDLER__, 'left', 103__+MAX_llx_menu__, 'home', '', 100__+MAX_llx_menu__, '/admin/modules.php?leftmenu=setup', 'Modules', 1, 'admin', '', '', 2, 2, __ENTITY__);
@@ -322,24 +322,19 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5200__+MAX_llx_menu__, 'members', 'cat', 13__+MAX_llx_menu__, '/categories/index.php?leftmenu=cat&amp;type=3', 'MembersCategoriesShort', 0, 'categories', '$user->rights->categorie->lire', '', 2, 3, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->adherent->enabled && $conf->categorie->enabled', __HANDLER__, 'left', 5201__+MAX_llx_menu__, 'members', '', 5200__+MAX_llx_menu__, '/categories/card.php?action=create&amp;type=3', 'NewCategory', 1, 'categories', '$user->rights->categorie->creer', '', 2, 0, __ENTITY__);
 -- HRM - Employee
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/index.php?leftmenu=hrm&amp;mode=employee', 'Employees', 0, 'hrm', '$user->rights->hrm->employee->read', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?action=create&amp;leftmenu=hrm', 'NewEmployee', 1, 'hrm', '$user->rights->hrm->employee->write', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/index.php?leftmenu=hrm&amp;mode=employee', 'List', 1, 'hrm', '$user->rights->hrm->employee->read', '', 0, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4600__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/user/index.php?&leftmenu=hrm&mode=employee', 'Employees', 0, 'hrm', '$user->rights->hrm->employee->read', '', 0, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4601__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/card.php?&action=create', 'NewEmployee', 1, 'hrm', '$user->rights->hrm->employee->write', '', 0, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->hrm->enabled', __HANDLER__, 'left', 4602__+MAX_llx_menu__, 'hrm', '', 4600__+MAX_llx_menu__, '/user/index.php?$leftmenu=hrm&mode=employee', 'List', 1, 'hrm', '$user->rights->hrm->employee->read', '', 0, 2, __ENTITY__);
 -- HRM - Holiday
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'holiday', 15__+MAX_llx_menu__, '/holiday/list.php?leftmenu=holiday', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?action=request&amp;leftmenu=holiday', 'MenuAddCP', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/list.php?leftmenu=holiday', 'List', 1, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?select_statut=2&amp;leftmenu=holiday', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?action=request&amp;leftmenu=holiday', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?action=request&amp;leftmenu=holiday', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 3, __ENTITY__);
--- HRM - Trips and expenses (old module)
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5000__+MAX_llx_menu__, 'hrm', 'hrm', 15__+MAX_llx_menu__, '/holiday/list.php?&leftmenu=hrm', 'CPTitreMenu', 0, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5001__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/card.php?&action=request', 'MenuAddCP', 1, 'holiday', '$user->rights->holiday->write', '', 0, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5002__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/list.php?&leftmenu=hrm', 'List', 1, 'holiday', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5003__+MAX_llx_menu__, 'hrm', '', 5002__+MAX_llx_menu__, '/holiday/list.php?select_statut=2&leftmenu=hrm', 'ListToApprove', 2, 'trips', '$user->rights->holiday->read', '', 0, 1, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5004__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/define_holiday.php?&action=request', 'MenuConfCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 2, __ENTITY__);
+insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->holiday->enabled', __HANDLER__, 'left', 5005__+MAX_llx_menu__, 'hrm', '', 5000__+MAX_llx_menu__, '/holiday/view_log.php?&action=request', 'MenuLogCP', 1, 'holiday', '$user->rights->holiday->define_holiday', '', 0, 3, __ENTITY__);
+-- HRM - Expense reports
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2100__+MAX_llx_menu__, 'accountancy', 'tripsandexpenses', 15__+MAX_llx_menu__, '/compta/deplacement/index.php?leftmenu=tripsandexpenses', 'TripsAndExpenses', 0, 'trips', '$user->rights->deplacement->lire', '', 0, 5, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2101__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/card.php?action=create&amp;leftmenu=tripsandexpenses', 'New', 1, 'trips', '$user->rights->deplacement->creer', '', 0, 1, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2102__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/list.php?leftmenu=tripsandexpenses', 'List', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__);
 insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->deplacement->enabled', __HANDLER__, 'left', 2103__+MAX_llx_menu__, 'accountancy', '', 2100__+MAX_llx_menu__, '/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses', 'Statistics', 1, 'trips', '$user->rights->deplacement->lire', '', 0, 2, __ENTITY__);
--- HRM - Expense reports
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5300__+MAX_llx_menu__, 'hrm', 'expensereport', 15__+MAX_llx_menu__, '/expensereport/index.php?leftmenu=expensereport', 'TripsAndExpenses', 0, 'trips', '$user->rights->expensereport->lire', '', 0, 5, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5301__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/card.php?action=create&amp;leftmenu=expensereport', 'New', 1, 'trips', '$user->rights->expensereport->creer', '', 0, 1, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5302__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/list.php?leftmenu=expensereport', 'List', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5303__+MAX_llx_menu__, 'hrm', '', 5302__+MAX_llx_menu__, '/expensereport/list.php?search_status=2&amp;leftmenu=expensereport', 'ListToApprove', 2, 'trips', '$user->rights->expensereport->approve', '', 0, 2, __ENTITY__);
-insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->expensereport->enabled', __HANDLER__, 'left', 5304__+MAX_llx_menu__, 'hrm', '', 5300__+MAX_llx_menu__, '/expensereport/stats/index.php?leftmenu=expensereport', 'Statistics', 1, 'trips', '$user->rights->expensereport->lire', '', 0, 2, __ENTITY__);
+
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 018b0b4346b073ae29e394723b8e54b2a9cbb310..bcbcf3b154e7469f248d7f279fb2067626dbd1a7 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1233,17 +1233,6 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
 				$newmenu->add("/compta/deplacement/list.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("List"), 1, $user->rights->deplacement->lire);
 				$newmenu->add("/compta/deplacement/stats/index.php?leftmenu=tripsandexpenses&amp;mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->deplacement->lire);
 			}
-
-			// Expense report
-			if (! empty($conf->expensereport->enabled))
-			{
-				$langs->load("trips");
-				$newmenu->add("/expensereport/index.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("TripsAndExpenses"), 0, $user->rights->expensereport->lire, '', $mainmenu, 'expensereport');
-				$newmenu->add("/expensereport/card.php?action=create&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("New"), 1, $user->rights->expensereport->creer);
-				$newmenu->add("/expensereport/list.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("List"), 1, $user->rights->expensereport->lire);
-				$newmenu->add("/expensereport/list.php?search_status=2&amp;leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("ListToApprove"), 2, $user->rights->expensereport->approve);
-				$newmenu->add("/expensereport/stats/index.php?leftmenu=expensereport&amp;mainmenu=hrm", $langs->trans("Statistics"), 1, $user->rights->expensereport->lire);
-			}
 		}
 
 
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 10115d342892d1a8c3f6e6c646b63eb2c88689fb..b6d4df5657f0f296167415e35a0f43a6af8f18d2 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -101,6 +101,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -142,26 +144,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->COMMANDE_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=count($listoffiles);
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
+		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-		}
-		
 		$texte.= '</td>';
 
 		$texte.= '<td valign="top" rowspan="2" class="hideonsmartphone">';
diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php
index 8ffafabc163ff863fb5a31723a4f07c7c59fada0..1996717e5069783136cb6ddaf48d585023eabb10 100644
--- a/htdocs/core/modules/commande/mod_commande_saphir.php
+++ b/htdocs/core/modules/commande/mod_commande_saphir.php
@@ -49,6 +49,8 @@ class mod_commande_saphir extends ModeleNumRefCommandes
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php
index fe88ea375af124c61b7506efc27670ae26adc990..54da8fc55c4ec290d390b5a7e2be089772eee513 100644
--- a/htdocs/core/modules/contract/mod_contract_magre.php
+++ b/htdocs/core/modules/contract/mod_contract_magre.php
@@ -45,6 +45,8 @@ class mod_contract_magre extends ModelNumRefContracts
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index a37b3677be780072e8b15dc052b83324495ec0d2..a2ddb144e6d542b566d8908345331b936e202214 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -102,6 +102,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -143,24 +145,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->EXPEDITION_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=count($listoffiles);
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-		}
+		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
 		$texte.= '</td>';
 
diff --git a/htdocs/core/modules/expedition/mod_expedition_ribera.php b/htdocs/core/modules/expedition/mod_expedition_ribera.php
index 1bec082349bfcd1607c54cc6eb5eafb22f935fb5..c92ea93e6a2fd925b4bdcdbc59e38c782d4b4e78 100644
--- a/htdocs/core/modules/expedition/mod_expedition_ribera.php
+++ b/htdocs/core/modules/expedition/mod_expedition_ribera.php
@@ -44,6 +44,8 @@ class mod_expedition_ribera extends ModelNumRefExpedition
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index ee8caf019339b537df622a64402dd15358680eb6..6065de505c66a68ee876f58e2aebec9b61314ada 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -101,6 +101,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -142,24 +144,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->FACTURE_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=count($listoffiles);
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-		}
+		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
 		$texte.= '</td>';
 
diff --git a/htdocs/core/modules/facture/mod_facture_mercure.php b/htdocs/core/modules/facture/mod_facture_mercure.php
index 8d05db0093fe14af9ef5dc33b4710cb671a5ec6d..2c873412da5fcccc8eb563e413c8ce2f57b59f82 100644
--- a/htdocs/core/modules/facture/mod_facture_mercure.php
+++ b/htdocs/core/modules/facture/mod_facture_mercure.php
@@ -49,6 +49,8 @@ class mod_facture_mercure extends ModeleNumRefFactures
 
         $langs->load("bills");
 
+        $form = new Form($this->db);
+
         $texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
         $texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
         $texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php
index 886d395a6a7cd6788cdbeee6ce298d700aeeb661..278e20ae7de828b3b00fdeb253513a7e0bc699e9 100644
--- a/htdocs/core/modules/fichinter/mod_arctic.php
+++ b/htdocs/core/modules/fichinter/mod_arctic.php
@@ -48,6 +48,8 @@ class mod_arctic extends ModeleNumRefFicheinter
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/livraison/mod_livraison_saphir.php
index 977ed4739e9dff5b5655ffbe3d7358b7ac63ad6c..1192656bf8d013dca01d5a2c700c8e3d16c38b49 100644
--- a/htdocs/core/modules/livraison/mod_livraison_saphir.php
+++ b/htdocs/core/modules/livraison/mod_livraison_saphir.php
@@ -47,6 +47,8 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/mailings/fraise.modules.php b/htdocs/core/modules/mailings/fraise.modules.php
index cf4985f3038534b6c84c52435a524645cf8a7e57..42f59e7c2fb814e24c86fc6b15f99ff5c27960c4 100644
--- a/htdocs/core/modules/mailings/fraise.modules.php
+++ b/htdocs/core/modules/mailings/fraise.modules.php
@@ -154,9 +154,9 @@ class mailing_fraise extends MailingTargets
         $s.='</select>';
         $s.='<br>';
         $s.=$langs->trans("DateEndSubscription").': &nbsp;';
-        $s.=$langs->trans("After").' > '.Form::selectDate(-1,'subscriptionafter',0,0,1,'fraise',1,0,1,0);
+        $s.=$langs->trans("After").' > '.$form->select_date(-1,'subscriptionafter',0,0,1,'fraise',1,0,1,0);
         $s.=' &nbsp; ';
-        $s.=$langs->trans("Before").' < '.Form::selectDate(-1,'subscriptionbefore',0,0,1,'fraise',1,0,1,0);
+        $s.=$langs->trans("Before").' < '.$form->select_date(-1,'subscriptionbefore',0,0,1,'fraise',1,0,1,0);
 
         return $s;
     }
diff --git a/htdocs/core/modules/modExpenseReport.class.php b/htdocs/core/modules/modExpenseReport.class.php
index d813cae0f54ba9b3ef1cd7afe64d92ff126cd77b..c02d7942b5bf35dacf567bd98a74f6a9eb4e4133 100644
--- a/htdocs/core/modules/modExpenseReport.class.php
+++ b/htdocs/core/modules/modExpenseReport.class.php
@@ -212,6 +212,113 @@ class modExpenseReport extends DolibarrModules
 		$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'projet as p ON ed.fk_projet = p.rowid';
 		$this->export_sql_end[$r] .=' WHERE ed.fk_expensereport = d.rowid AND d.fk_user_author = u.rowid';
 		$this->export_sql_end[$r] .=' AND d.entity IN ('.getEntity('expensereport',1).')';
+
+
+
+		// Main menu entries
+		$this->menu = array();			// List of menus to add
+		$r=0;
+
+		// Example to declare a Left Menu entry: fk_mainmenu=home,fk_leftmenu=admintools
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'TripsAndExpenses',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport',
+									'url'=>'/expensereport/index.php',
+									'langs'=>'trips',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->expensereport->enabled',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->lire',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
+
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'New',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport_detailnew',
+									'url'=>'/expensereport/card.php?action=create',
+									'langs'=>'trips',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->expensereport->enabled',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->creer',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
+
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'List',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport_detaillist',
+									'url'=>'/expensereport/list.php',
+									'langs'=>'trips',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->expensereport->enabled',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->lire',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
+
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport_detaillist',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'ListToApprove',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport_detaillist_approve',
+									'url'=>'/expensereport/list.php?search_status=2',
+									'langs'=>'trips',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->expensereport->enabled',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->approve',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
+
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'Statistics',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport_detail',
+									'url'=>'/expensereport/stats/index.php',
+									'langs'=>'trips',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->expensereport->enabled',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->lire',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
+
+
+		// Disabled, not yet stable
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'ExportTripCSV',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport_detail',
+									'url'=>'/expensereport/export_csv.php',
+									'langs'=>'expensereport',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->lire',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
+
+		$this->menu[$r]=array(	'fk_menu'=>'fk_mainmenu=hrm,fk_leftmenu=expensereport',		// Use r=value where r is index key used for the parent menu entry (higher parent must be a top menu entry)
+									'type'=>'left',			// This is a Left menu entry
+									'titre'=>'Synchro_Compta',
+									'mainmenu'=>'hrm',
+									'leftmenu'=>'expensereport_detail',
+									'url'=>'/expensereport/synchro_compta.php',
+									'langs'=>'expensereport',	// Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
+									'position'=>100,
+									'enabled'=>'$conf->global->DEPLACEMENT_TO_CLEAN',			// Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
+									'perms'=>'$user->rights->expensereport->lire',			// Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
+									'target'=>'',
+									'user'=>2);				// 0=Menu for internal users, 1=external users, 2=both
+		$r++;
 	}
 
 	/**
diff --git a/htdocs/core/modules/payment/mod_payment_ant.php b/htdocs/core/modules/payment/mod_payment_ant.php
index 6ed483462811f88d505552bf6405e7bb9168c671..a09ad2355e49c9632207721f06499ce9b3264d00 100644
--- a/htdocs/core/modules/payment/mod_payment_ant.php
+++ b/htdocs/core/modules/payment/mod_payment_ant.php
@@ -46,6 +46,8 @@ class mod_payment_ant extends ModeleNumRefPayments
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index 2428fa90edc0b56275c021804469e37d5e6c9ab5..3ea28a1bd8167bd0d38b1559ff4ca89ff5000707 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -314,6 +314,8 @@ class doc_generic_project_odt extends ModelePDFProjects
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -355,25 +357,7 @@ class doc_generic_project_odt extends ModelePDFProjects
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->PROJECT_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=$nbofiles;
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
-
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-		}
+		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
 		$texte.= '</td>';
 
diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php
index 8c2118e87a51e40ea617065da3ec3601f72b2805..e76ed349b46ca9fff152a6be6420c871d8f5a3c7 100644
--- a/htdocs/core/modules/project/mod_project_universal.php
+++ b/htdocs/core/modules/project/mod_project_universal.php
@@ -48,6 +48,8 @@ class mod_project_universal extends ModeleNumRefProjects
 		$langs->load("projects");
 		$langs->load("admin");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index 30c32afc11ab05fc4435d9453b4f7847287f37d3..caebf1d78d4647ba21eefa44de81b61cb2ae74bc 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -315,6 +315,8 @@ class doc_generic_task_odt extends ModelePDFTask
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -356,25 +358,7 @@ class doc_generic_task_odt extends ModelePDFTask
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->PROJECT_TASK_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=$nbofiles;
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
-
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-		}
+		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
 		$texte.= '</td>';
 
diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php
index d2df9cf090da5b5dcc09b8e3177f2e0efd477c0e..529814079c1c945c6b3822f7950dac3d028a89da 100644
--- a/htdocs/core/modules/project/task/mod_task_universal.php
+++ b/htdocs/core/modules/project/task/mod_task_universal.php
@@ -48,6 +48,8 @@ class mod_task_universal extends ModeleNumRefTask
 		$langs->load("projects");
 		$langs->load("admin");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 917b8b5cbc03d19ea8d6d16a9221df2d5a47071b..f651c56e0282defd0036a28c19660e8b55acbabe 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -100,6 +100,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -147,25 +149,10 @@ class doc_generic_proposal_odt extends ModelePDFPropales
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->PROPALE_ADDON_PDF_ODT_PATH))
+		if (count($listofdir))
 		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=count($listoffiles);
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
+			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-    			
 			if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0)
 			{
 				// Model for creation
diff --git a/htdocs/core/modules/propale/mod_propale_saphir.php b/htdocs/core/modules/propale/mod_propale_saphir.php
index 7b53b75849272a0bd4ea8fed1619d4938eec9f6d..25ccecb253cc40138879846cf98f0ae1fa23e510 100644
--- a/htdocs/core/modules/propale/mod_propale_saphir.php
+++ b/htdocs/core/modules/propale/mod_propale_saphir.php
@@ -49,6 +49,8 @@ class mod_propale_saphir extends ModeleNumRefPropales
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index bd60509076ed96f904a46fa8d13f2e38a6ff64d3..3c66bd5f11df6a45f22dfbc03db065ffb3dfb9f0 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -87,6 +87,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -129,26 +131,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
         $texte.= '</table>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->COMPANY_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=$nbofiles;
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
+		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
-		if ($nbofiles)
-		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
-		}
-		
 		$texte.= '</td>';
 
 		$texte.= '<td valign="top" rowspan="2" class="hideonsmartphone">';
diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
index dd399de70d1ae7e4df49170845d8f49d7e6d79da..ba31d9798640fa7cb5337c377c390ade9017db36 100644
--- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
+++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
@@ -52,6 +52,8 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
 		$langs->load("bills");
 		$langs->load("admin");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
index b4a32fbd15dfb28b2f62f02df3a19fde1e312ec2..37b8adab22ee364e522a009653879e9b549fb343 100644
--- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
+++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
@@ -49,6 +49,8 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
 		$langs->load("bills");
 		$langs->load("admin");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php
index bf220f233b4f63795707cf80972c9054cce5716d..fb06c028aeda6ca6757dff30bc15ccb08cb1ccbe 100644
--- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php
+++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php
@@ -46,6 +46,8 @@ class mod_supplier_payment_brodator extends ModeleNumRefPayments
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index c7f9b1211855d0c5b710c54219309a2f450a714f..ab906617b070bff203f4a50d3c5fca2567a265fd 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -100,6 +100,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
 		$langs->load("companies");
 		$langs->load("errors");
 
+		$form = new Form($this->db);
+
 		$texte = $this->description.".<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -147,24 +149,9 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
 		$texte.= '<br></div></div>';
 
 		// Scan directories
-		$nbofiles=count($listoffiles);
-		if (! empty($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF_ODT_PATH))
-		{
-			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>';
-			//$texte.=$nbofiles?'<a id="a_'.get_class($this).'" href="#">':'';
-			$texte.=count($listoffiles);
-			//$texte.=$nbofiles?'</a>':'';
-			$texte.='</b>';
-		}
-
-		if ($nbofiles)
+		if (count($listofdir))
 		{
-   			$texte.='<div id="div_'.get_class($this).'" class="hidden">';
-   			foreach($listoffiles as $file)
-   			{
-                $texte.=$file['name'].'<br>';
-   			}
-   			$texte.='<div id="div_'.get_class($this).'">';
+			$texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
 			if ($conf->global->MAIN_SUPPLIER_PROPOSAL_CHOOSE_ODT_DOCUMENT > 0)
 			{
diff --git a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php
index 3b5889d2c09c72dd8852751794900fa86f4f7f36..8781628917f2b5f677fe9e0578db61b2a86843d8 100644
--- a/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php
+++ b/htdocs/core/modules/supplier_proposal/mod_supplier_proposal_saphir.php
@@ -49,6 +49,8 @@ class mod_supplier_proposal_saphir extends ModeleNumRefSupplierProposal
 
 		$langs->load("bills");
 
+		$form = new Form($this->db);
+
 		$texte = $langs->trans('GenericNumRefModelDesc')."<br>\n";
 		$texte.= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
 		$texte.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php
index 3a162aa09016c6a302dfe2676de69e5ee119c7e5..a983bf7f36e2c3011000219a621c7addbea5de83 100644
--- a/htdocs/core/tpl/document_actions_post_headers.tpl.php
+++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php
@@ -29,7 +29,7 @@ if (empty($relativepathwithnofile)) $relativepathwithnofile='';
 if ($action == 'delete')
 {
 	$langs->load("companies");	// Need for string DeleteFile+ConfirmDeleteFiles
-	$ret = $formForm::formconfirm(
+	$ret = $form->form_confirm(
 			$_SERVER["PHP_SELF"] . '?id=' . $object->id . '&urlfile=' . urlencode(GETPOST("urlfile")) . '&linkid=' . GETPOST('linkid', 'int') . (empty($param)?'':$param),
 			$langs->trans('DeleteFile'),
 			$langs->trans('ConfirmDeleteFile'),
diff --git a/htdocs/core/tpl/notes.tpl.php b/htdocs/core/tpl/notes.tpl.php
index 8812a3dd708fb99230c91e1850251bf8aa62b977..c68aa599310840e4816aef9c6326b71ede653557 100644
--- a/htdocs/core/tpl/notes.tpl.php
+++ b/htdocs/core/tpl/notes.tpl.php
@@ -69,13 +69,13 @@ else $typeofdata='textarea:12:100';
 <!-- BEGIN PHP TEMPLATE NOTES -->
 <div class="border table-border centpercent">
 	<div class="table-border-row">
-		<div class="table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo Form::editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?></div>
-		<div class="table-val-border-col"><?php echo Form::editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
+		<div class="table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, $moreparam); ?></div>
+		<div class="table-val-border-col"><?php echo $form->editfieldval("NotePublic", $note_public, $value_public, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
 	</div>
 <?php if (empty($user->societe_id)) { ?>
 	<div class="table-border-row">
-		<div class="table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo Form::editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?></div>
-		<div class="table-val-border-col"><?php echo Form::editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
+		<div class="table-key-border-col<?php echo (empty($cssclass)?'':' '.$cssclass); ?>"<?php echo ($colwidth ? ' style="width: '.$colwidth.'%"' : ''); ?>><?php echo $form->editfieldkey("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, $moreparam); ?></div>
+		<div class="table-val-border-col"><?php echo $form->editfieldval("NotePrivate", $note_private, $value_private, $object, $permission, $typeofdata, '', null, null, $moreparam); ?></div>
 	</div>
 <?php } ?>
 </div>
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index 98c028b5735b2a40878b212fb8a855188bbb58c4..39de2604a0d16a02c20dd018bfa1742ecdf1181e 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -382,16 +382,16 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
 	if (! empty($object->element) && $object->element == 'contrat')
 	{
 		print $langs->trans("DateStartPlanned").' ';
-		Form::selectDate($date_start,"date_start",$usehm,$usehm,1,"addproduct");
+		$form->select_date($date_start,"date_start",$usehm,$usehm,1,"addproduct");
 		print ' &nbsp; '.$langs->trans("DateEndPlanned").' ';
-		Form::selectDate($date_end,"date_end",$usehm,$usehm,1,"addproduct");
+		$form->select_date($date_end,"date_end",$usehm,$usehm,1,"addproduct");
 	}
 	else
 	{
 		echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
-		echo Form::selectDate($date_start,'date_start',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct",1,0,1);
+		echo $form->select_date($date_start,'date_start',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct",1,0,1);
 		echo ' '.$langs->trans('to').' ';
-		echo Form::selectDate($date_end,'date_end',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct",1,0,1);
+		echo $form->select_date($date_end,'date_end',empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,empty($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?0:1,1,"addproduct",1,0,1);
 	};
 	print '<script type="text/javascript">';
 	if (!$date_start) {
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index a9d6464d2180d615d9a9c7e475e62d44c877d3c1..a88f1bc210c8007f8efb9d1f4b3c742725e97e0f 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -226,9 +226,9 @@ $coldisplay=-1; // We remove first td
 	<td colspan="11"><?php echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' '; ?>
 	<?php
 	$hourmin=(isset($conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE)?$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE:'');
-	echo Form::selectDate($line->date_start,'date_start',$hourmin,$hourmin,$line->date_start?0:1,"updateligne",1,0,1);
+	echo $form->select_date($line->date_start,'date_start',$hourmin,$hourmin,$line->date_start?0:1,"updateligne",1,0,1);
 	echo ' '.$langs->trans('to').' ';
-	echo Form::selectDate($line->date_end,'date_end',$hourmin,$hourmin,$line->date_end?0:1,"updateligne",1,0,1);
+	echo $form->select_date($line->date_end,'date_end',$hourmin,$hourmin,$line->date_end?0:1,"updateligne",1,0,1);
 	print '<script type="text/javascript">';
 	if (!$line->date_start) {
 		if (isset($conf->global->MAIN_DEFAULT_DATE_START_HOUR)) {
diff --git a/htdocs/core/tpl/resource_add.tpl.php b/htdocs/core/tpl/resource_add.tpl.php
index 0489ff162ec0c41fc6e0cae9756ee547fc8499ff..e2add5fb26663a98ee2d0bca5531d59445d04a71 100644
--- a/htdocs/core/tpl/resource_add.tpl.php
+++ b/htdocs/core/tpl/resource_add.tpl.php
@@ -22,8 +22,8 @@ $events=array();
 $out .= $formresources->select_resource_list('','fk_resource','',1,1,0,$events,'',2);
 $out .= '</div>';
 
-$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.Form::selectyesno('busy',(isset($_POST['busy'])?$_POST['busy']:1),1).'</div>';
-$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.Form::selectyesno('mandatory',(isset($_POST['mandatory'])?$_POST['mandatory']:0),1).'</div>';
+$out .= '<div class="tagtd"><label>'.$langs->trans('Busy').'</label> '.$form->selectyesno('busy',(isset($_POST['busy'])?$_POST['busy']:1),1).'</div>';
+$out .= '<div class="tagtd"><label>'.$langs->trans('Mandatory').'</label> '.$form->selectyesno('mandatory',(isset($_POST['mandatory'])?$_POST['mandatory']:0),1).'</div>';
 
 $out .= '<div class="tagtd" align="right">';
 $out .='<input type="submit" id="add-resource-place" class="button" value="'.$langs->trans("Add").'"/>';
diff --git a/htdocs/core/tpl/resource_view.tpl.php b/htdocs/core/tpl/resource_view.tpl.php
index 8bbc96881d44cd8ec4737c9bd075d186c51405c0..dd775662db6b4fc968eec39d34b7aaacb16feee6 100644
--- a/htdocs/core/tpl/resource_view.tpl.php
+++ b/htdocs/core/tpl/resource_view.tpl.php
@@ -52,8 +52,8 @@ if( (array) $linked_resources && count($linked_resources) > 0)
 
 			print '<div class="tagtd">'.$object_resource->getNomUrl(1).'</div>';
 			print '<div class="tagtd">'.$object_resource->type_label.'</div>';
-			print '<div class="tagtd" align="center">'.Form::selectyesno('busy',$linked_resource['busy']?1:0,1).'</div>';
-			print '<div class="tagtd" align="center">'.Form::selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'</div>';
+			print '<div class="tagtd" align="center">'.$form->selectyesno('busy',$linked_resource['busy']?1:0,1).'</div>';
+			print '<div class="tagtd" align="center">'.$form->selectyesno('mandatory',$linked_resource['mandatory']?1:0,1).'</div>';
 			print '<div class="tagtd" align="right"><input type="submit" class="button" value="'.$langs->trans("Update").'"></div>';
 			print '</form>';
 
diff --git a/htdocs/cron/card.php b/htdocs/cron/card.php
index ab38d30e843bdb0bc35e038b7bf297d35db7151a..90a5dd0f2edbae3a10a15161ed50cf24776ee00a 100644
--- a/htdocs/cron/card.php
+++ b/htdocs/cron/card.php
@@ -278,13 +278,13 @@ if ($conf->use_javascript_ajax)
 
 if ($action == 'delete')
 {
-	print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
+	print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
 
 	$action='';
 }
 
 if ($action == 'execute'){
-	print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
+	print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
 
 	$action='';
 }
@@ -460,11 +460,11 @@ if (($action=="create") || ($action=="edit"))
 	print $langs->trans('CronDtStart')."</td><td>";
 	if(!empty($object->datestart))
 	{
-	    Form::selectDate($object->datestart,'datestart',1,1,'',"cronform");
+	    $form->select_date($object->datestart,'datestart',1,1,'',"cronform");
 	}
 	else
 	{
-	    Form::selectDate('','datestart',1,1,'',"cronform");
+	    $form->select_date('','datestart',1,1,'',"cronform");
 	}
 	print "</td>";
 	print "<td>";
@@ -474,10 +474,10 @@ if (($action=="create") || ($action=="edit"))
 	print "<tr><td>";
 	print $langs->trans('CronDtEnd')."</td><td>";
 	if(!empty($object->dateend)){
-	    Form::selectDate($object->dateend,'dateend',1,1,'',"cronform");
+	    $form->select_date($object->dateend,'dateend',1,1,'',"cronform");
 	}
 	else{
-	    Form::selectDate(-1,'dateend',1,1,1,"cronform");
+	    $form->select_date(-1,'dateend',1,1,1,"cronform");
 	}
 	print "</td>";
 	print "<td>";
@@ -514,11 +514,11 @@ if (($action=="create") || ($action=="edit"))
 	print "</td><td>";
 	if(!empty($object->datenextrun))
 	{
-	    Form::selectDate($object->datenextrun,'datenextrun',1,1,'',"cronform");
+	    $form->select_date($object->datenextrun,'datenextrun',1,1,'',"cronform");
 	}
 	else
 	{
-	    Form::selectDate(-1,'datenextrun',1,1,'',"cronform");
+	    $form->select_date(-1,'datenextrun',1,1,'',"cronform");
 	}	
 	print "</td>";
     print "<td>";
@@ -554,7 +554,7 @@ else
 
 	print '<tr><td width="30%">';
 	print $langs->trans('CronId')."</td>";
-	print "<td>".Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'id', '', '', 0);
+	print "<td>".$form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'id', '', '', 0);
 	print "</td></tr>\n";
 
 	print '<tr><td>';
diff --git a/htdocs/cron/list.php b/htdocs/cron/list.php
index 770e130380365ef16ef54da2c0e04e738ab2199d..eb365dbd5b800d3299c3b997b841740e835606f7 100644
--- a/htdocs/cron/list.php
+++ b/htdocs/cron/list.php
@@ -160,13 +160,13 @@ $stringcurrentdate = $langs->trans("CurrentHour").': '.dol_print_date(dol_now(),
 
 if ($action == 'delete')
 {
-    print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
+    print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronDelete"),$langs->trans("CronConfirmDelete"),"confirm_delete",'','',1);
 
 }
 
 if ($action == 'execute')
 {
-    print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
+    print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id.'&status='.$status,$langs->trans("CronExecute"),$langs->trans("CronConfirmExecute"),"confirm_execute",'','',1);
 
 }
 
diff --git a/htdocs/don/card.php b/htdocs/don/card.php
index 49db9df37b71152bb807315fe1664a8237c33542..ac12c46b8794632edb9aa7348b5628c39fc9fef6 100644
--- a/htdocs/don/card.php
+++ b/htdocs/don/card.php
@@ -3,7 +3,7 @@
  * Copyright (C) 2004-2015	Laurent Destailleur		<eldy@users.sourceforge.net>
  * Copyright (C) 2005-2012	Regis Houssin			<regis.houssin@capnetworks.com>
  * Copyright (C) 2013       Florian Henry		  	<florian.henry@open-concept.pro>
- * Copyright (C) 2015-2016  Alexandre Spangaro	  	<aspangaro.dolibarr@gmail.com>
+ * Copyright (C) 2015       Alexandre Spangaro	  	<aspangaro.dolibarr@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -308,14 +308,14 @@ if ($action == 'create')
 
     // Date
 	print '<tr><td class="fieldrequired" width="25%">'.$langs->trans("Date").'</td><td>';
-	Form::selectDate($donation_date?$donation_date:-1,'','','','',"add",1,1);
+	$form->select_date($donation_date?$donation_date:-1,'','','','',"add",1,1);
 	print '</td>';
 
     // Amount
     print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.GETPOST("amount").'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
 
 	print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
-	print Form::selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
+	print $form->selectyesno("public",isset($_POST["public"])?$_POST["public"]:1,1);
 	print "</td></tr>\n";
 
 	print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.GETPOST("societe").'" size="40"></td></tr>';
@@ -430,7 +430,7 @@ if (! empty($id) && $action == 'edit')
 
 	// Date
 	print "<tr>".'<td width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td>';
-	Form::selectDate($object->date,'','','','',"update");
+	$form->select_date($object->date,'','','','',"update");
 	print '</td>';
 
 	// Amount
@@ -446,7 +446,7 @@ if (! empty($id) && $action == 'edit')
 	}
 
 	print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
-	print Form::selectyesno("public",1,1);
+	print $form->selectyesno("public",1,1);
 	print "</td>";
 	print "</tr>\n";
 
@@ -523,7 +523,7 @@ if (! empty($id) && $action != 'edit')
     if ($action == 'delete')
     {
         $text=$langs->trans("ConfirmDeleteADonation");
-        print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteADonation"),$text,"confirm_delete",'','',1);
+        print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteADonation"),$text,"confirm_delete",'','',1);
     }
 
 	$result=$object->fetch($id);
@@ -551,7 +551,7 @@ if (! empty($id) && $action != 'edit')
 
 	// Ref
 	print "<tr>".'<td>'.$langs->trans("Ref").'</td><td colspan="2">';
-	print Form::showrefnav($object, 'rowid', $linkback, 1, 'rowid', 'ref', '');
+	print $form->showrefnav($object, 'rowid', $linkback, 1, 'rowid', 'ref', '');
 	print '</td>';
 	print '</tr>';
 
@@ -680,7 +680,7 @@ if (! empty($id) && $action != 'edit')
 			$projettmp=new Project($db);
 			$projettmp->id=$object->fk_projet;
 			$projettmp->ref=$object->project;
-			if(! empty($object->fk_projet)) print $projettmp->getNomUrl(1);
+			print $projettmp->getNomUrl(1);
 		print '</td>';
 		print '</tr>';
     }
diff --git a/htdocs/don/document.php b/htdocs/don/document.php
index 0036ef9c189a641197fe83d1813494e34d33eb81..793bdadd3b1cdf91e35c65fca6a17f1a395fca7b 100644
--- a/htdocs/don/document.php
+++ b/htdocs/don/document.php
@@ -108,7 +108,7 @@ if ($object->id)
 
 	// Ref
 	print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+	print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
 	print '</td></tr>';
 
 	// Societe
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 02a9b2225b98c912f700cd15f00270ee234fe5a9..8c7f5b987bef030d842adfeac62581d6d1b1ff15 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -192,7 +192,7 @@ if ($resql)
     print '<td class="liste_titre" align="right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
     print '<td class="liste_titre" align="right"></td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/don/payment/card.php b/htdocs/don/payment/card.php
index 7918206fe946f61105dd9b7f79ff3ea64b998c97..fc0b4ae0c7844c47bfeda65937ba999e29397058 100644
--- a/htdocs/don/payment/card.php
+++ b/htdocs/don/payment/card.php
@@ -133,7 +133,7 @@ dol_fiche_head($head, $hselected, $langs->trans("DonationPayment"), 0, 'payment'
  */
 if ($action == 'delete')
 {
-	print Form::formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
+	print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
 	
 }
 
@@ -143,7 +143,7 @@ if ($action == 'delete')
 if ($action == 'valide')
 {
 	$facid = $_GET['facid'];
-	print Form::formconfirm('card.php?id='.$payment->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
+	print $form->formconfirm('card.php?id='.$payment->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
 	
 }
 
@@ -153,7 +153,7 @@ print '<table class="border" width="100%">';
 // Ref
 print '<tr><td valign="top" width="20%">'.$langs->trans('Ref').'</td>';
 print '<td colspan="3">';
-print Form::showrefnav($payment,'id','',1,'rowid','id');
+print $form->showrefnav($payment,'id','',1,'rowid','id');
 print '</td></tr>';
 
 // Date
diff --git a/htdocs/don/payment/payment.php b/htdocs/don/payment/payment.php
index bd5b83be7906d2550aff3980ce70c7a73e2206f7..a0062632770b3991200f49587e3e540a78f9369a 100644
--- a/htdocs/don/payment/payment.php
+++ b/htdocs/don/payment/payment.php
@@ -205,7 +205,7 @@ if (GETPOST("action") == 'create')
 	print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
 	$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 	$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaid):0;
-	Form::selectDate($datepayment,'','','','',"add_payment",1,1);
+	$form->select_date($datepayment,'','','','',"add_payment",1,1);
 	print "</td>";
 	print '</tr>';
 
diff --git a/htdocs/ecm/docdir.php b/htdocs/ecm/docdir.php
index 46ca0c320870559efb23f55be53fc6717f968416..7cd3a235c6be6e9dd8d59aed4318a70c12811f5f 100644
--- a/htdocs/ecm/docdir.php
+++ b/htdocs/ecm/docdir.php
@@ -208,7 +208,7 @@ if (empty($action) || $action == 'delete_section')
 	// Confirmation de la suppression d'une ligne categorie
 	if ($action == 'delete_section')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection');
 		
 	}
 
diff --git a/htdocs/ecm/docfile.php b/htdocs/ecm/docfile.php
index 03dbba662e5827476b95dfbd973d4284a8cd37d0..ce4bf4806683ab0738a036c9d1742fa338b88c15 100644
--- a/htdocs/ecm/docfile.php
+++ b/htdocs/ecm/docfile.php
@@ -253,7 +253,7 @@ print '</div>';
 // Confirmation de la suppression d'une ligne categorie
 if ($_GET['action'] == 'delete_file')
 {
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.urlencode($_GET["section"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile',$urlfile), 'confirm_deletefile', '', 1, 1);
 
 }
 
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php
index 5374473cefc155e8181b03505410cc62044d77c9..ae4e6c6b08c2b3b47d9d75b09fdd65d2418a4b7c 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/docmine.php
@@ -334,7 +334,7 @@ if ($action != 'edit' && $action != 'delete')
 // Confirm remove file
 if ($action == 'delete')
 {
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"].'&amp;urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
 	
 }
 
@@ -342,7 +342,7 @@ if ($action == 'delete')
 if ($action == 'delete_dir')
 {
 	$relativepathwithoutslash=preg_replace('/[\/]$/','',$relativepath);
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$_REQUEST["section"], $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$relativepathwithoutslash), 'confirm_deletedir', '', 1, 1);
 	
 }
 
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
index c77795e13ff0a6d131d50e4f16165f7e8f923d98..addf559e01c18b326127ad8df82dfba7e0b6d51a 100644
--- a/htdocs/ecm/docother.php
+++ b/htdocs/ecm/docother.php
@@ -110,7 +110,7 @@ print load_fiche_titre($langs->trans("ECMAutoOrg"));
  */
 if ($_GET['action'] == 'delete_file')
 {
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
 
 }
 
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 82088799bcee66d7f7241665a6eb7a8c86b43066..e3fa4ece95d4213b83d04b880c5b01972ccc1708 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -427,7 +427,7 @@ print '</div>';
 // Confirm remove file (for non javascript users)
 if ($action == 'delete' && empty($conf->use_javascript_ajax))
 {
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
 
 }
 
@@ -481,7 +481,7 @@ print '</div>';
 // Confirmation de la suppression d'une ligne categorie
 if ($action == 'delete_section')
 {
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
 
 }
 // End confirm
@@ -530,7 +530,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
     	// Show filemanager tree
 	    print '<div id="filetree" class="ecmfiletree"></div>';
 
-	    if ($action == 'deletefile') print Form::formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile');
+	    if ($action == 'deletefile') print $form->formconfirm('eeeee', $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', '', 'deletefile');
 
 	    print '</td></tr>';
     }
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index b629309a51ffe98d7522a9e92c45e65bd649e4e6..76ce04235e44147976fe67e7ab38d1b2f2e30a77 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -433,7 +433,7 @@ print '</div>';
 // Confirm remove file (for non javascript users)
 if ($action == 'delete' && empty($conf->use_javascript_ajax))
 {
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
 
 }
 
@@ -475,7 +475,7 @@ print '</div>';
 // Confirmation de la suppression d'une ligne categorie
 if ($action == 'delete_section')
 {
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?section='.$section, $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
 }
 // End confirm
 
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 668e8618e97c4a15aea140dc20cdfa195729b33c..4c71256baf334c060d0d7457defdc4fd38eff916 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -638,7 +638,7 @@ if ($action == 'create')
             print '<td colspan="3">';
             //print dol_print_date($object->date_livraison,"day");	// date_livraison come from order and will be stored into date_delivery planed.
             $date_delivery = ($date_delivery?$date_delivery:$object->date_livraison); // $date_delivery comes from GETPOST
-            print Form::selectDate($date_delivery?$date_delivery:-1,'date_delivery',1,1,1);
+            print $form->select_date($date_delivery?$date_delivery:-1,'date_delivery',1,1,1);
             print "</td>\n";
             print '</tr>';
 
@@ -1210,7 +1210,7 @@ else if ($id || $ref)
 		*/
 		if ($action == 'delete')
 		{
-			print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
+			print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteSending'),$langs->trans("ConfirmDeleteSending",$object->ref),'confirm_delete','',0,1);
 
 		}
 
@@ -1239,7 +1239,7 @@ else if ($id || $ref)
 				$text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid, $object);
 			}
 
-			print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
+			print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
 
 		}
 		/*
@@ -1247,7 +1247,7 @@ else if ($id || $ref)
 		 */
 		if ($action == 'annuler')
 		{
-			print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
+			print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('CancelSending'),$langs->trans("ConfirmCancelSending",$object->ref),'confirm_cancel','',0,1);
 
 		}
 
@@ -1265,7 +1265,7 @@ else if ($id || $ref)
 		// Ref
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 		print '<td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 		print '</td></tr>';
 
 		// Customer
@@ -1321,7 +1321,7 @@ else if ($id || $ref)
 			print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
 			print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 			print '<input type="hidden" name="action" value="setdate_livraison">';
-			print Form::selectDate($object->date_delivery?$object->date_delivery:-1,'liv_',1,1,'',"setdate_livraison",1,0,1);
+			print $form->select_date($object->date_delivery?$object->date_delivery:-1,'liv_',1,1,'',"setdate_livraison",1,0,1);
 			print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
 			print '</form>';
 		}
@@ -1334,7 +1334,7 @@ else if ($id || $ref)
 
 		// Weight
 		print '<tr><td>';
-		print Form::editfieldkey("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer);
+		print $form->editfieldkey("Weight",'trueWeight',$object->trueWeight,$object,$user->rights->expedition->creer);
 		print '</td><td colspan="3">';
 
 		if ($action=='edittrueWeight')
@@ -1368,13 +1368,13 @@ else if ($id || $ref)
 		print '</td></tr>';
 
 		// Width
-		print '<tr><td>'.Form::editfieldkey("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
-		print Form::editfieldval("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer);
+		print '<tr><td>'.$form->editfieldkey("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
+		print $form->editfieldval("Width",'trueWidth',$object->trueWidth,$object,$user->rights->expedition->creer);
 		print ($object->trueWidth && $object->width_units!='')?' '.measuring_units_string($object->width_units,"size"):'';
 		print '</td></tr>';
 
 		// Height
-		print '<tr><td>'.Form::editfieldkey("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
+		print '<tr><td>'.$form->editfieldkey("Height",'trueHeight',$object->trueHeight,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
 		if($action=='edittrueHeight')
 		{
 			print '<form name="settrueHeight" action="'.$_SERVER["PHP_SELF"].'" method="post">';
@@ -1397,8 +1397,8 @@ else if ($id || $ref)
 		print '</td></tr>';
 
 		// Depth
-		print '<tr><td>'.Form::editfieldkey("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
-		print Form::editfieldval("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer);
+		print '<tr><td>'.$form->editfieldkey("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
+		print $form->editfieldval("Depth",'trueDepth',$object->trueDepth,$object,$user->rights->expedition->creer);
 		print ($object->trueDepth && $object->depth_units!='')?' '.measuring_units_string($object->depth_units,"size"):'';
 		print '</td></tr>';
 
@@ -1473,8 +1473,8 @@ else if ($id || $ref)
 		print '</tr>';
 
 		// Tracking Number
-		print '<tr><td>'.Form::editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
-		print Form::editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
+		print '<tr><td>'.$form->editfieldkey("TrackingNumber",'trackingnumber',$object->tracking_number,$object,$user->rights->expedition->creer).'</td><td colspan="3">';
+		print $form->editfieldval("TrackingNumber",'trackingnumber',$object->tracking_url,$object,$user->rights->expedition->creer,'string',$object->tracking_number);
 		print '</td></tr>';
 
 		// Incoterms
diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php
index 3346a4f4257140da5476c787ff106bf0c18d3c33..039af2cd0ece84c4b1a43d2c899b47ad1b858983 100644
--- a/htdocs/expedition/contact.php
+++ b/htdocs/expedition/contact.php
@@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref))
 
 	// Ref
 	print '<tr><td width="18%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print "</td></tr>";
 
 	// Customer
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index d27afcd23eb206acd8647e56c47e28db581bab42..288a1b92f3799608b98858788f6c421d3090dc6b 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -219,7 +219,7 @@ if ($resql)
 	print $form->selectarray('viewstatut', array('0'=>$langs->trans('StatusSendingDraftShort'),'1'=>$langs->trans('StatusSendingValidatedShort'),'2'=>$langs->trans('StatusSendingProcessedShort')),$viewstatut,1);
 	print '</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/expedition/note.php b/htdocs/expedition/note.php
index 2160b0a2732d3b0ba32c38fd8c90487c4693dfad..652b09453f7865d73e3fa80c5a1bba3714dbdf13 100644
--- a/htdocs/expedition/note.php
+++ b/htdocs/expedition/note.php
@@ -106,7 +106,7 @@ if ($id > 0 || ! empty($ref))
 	// Ref
 	print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 	print '<td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td></tr>';
 
 	// Customer
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index 2aa767f49e927cd637d7b5dbb1a8a1d08c7a897f..66f9582cfc0ab84a262dd5609477d28ba51a6e43 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -187,7 +187,7 @@ if ($id > 0 || ! empty($ref))
 		 */
 		if ($action == 'cloture')
 		{
-			print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture");
+			print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$id,$langs->trans("CloseShipment"),$langs->trans("ConfirmCloseShipment"),"confirm_cloture");
 
 		}
 
@@ -200,7 +200,7 @@ if ($id > 0 || ! empty($ref))
 		// Ref
 		print '<tr><td width="18%">'.$langs->trans('Ref').'</td>';
 		print '<td colspan="3">';
-		print Form::showrefnav($commande,'ref','',1,'ref','ref');
+		print $form->showrefnav($commande,'ref','',1,'ref','ref');
 		print '</td>';
 		print '</tr>';
 
@@ -287,7 +287,7 @@ if ($id > 0 || ! empty($ref))
 			print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$commande->id.'" method="post">';
 			print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 			print '<input type="hidden" name="action" value="setdatedelivery">';
-			Form::selectDate($commande->date_livraison>0?$commande->date_livraison:-1,'liv_','','','',"setdatedelivery");
+			$form->select_date($commande->date_livraison>0?$commande->date_livraison:-1,'liv_','','','',"setdatedelivery");
 			print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
 			print '</form>';
 		}
diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php
index 8660336a4cd33f539ba863edc851381551b733b8..be9d8ab49bdd39504b30548d2a750dbe393fb142 100644
--- a/htdocs/expensereport/card.php
+++ b/htdocs/expensereport/card.php
@@ -1117,13 +1117,13 @@ if ($action == 'create')
 	print '<tr>';
 	print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td>';
 	print '<td>';
-	Form::selectDate($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1);
+	$form->select_date($date_start?$date_start:-1,'date_debut',0,0,0,'',1,1);
 	print '</td>';
 	print '</tr>';
 	print '<tr>';
 	print '<td class="fieldrequired">'.$langs->trans("DateEnd").'</td>';
 	print '<td>';
-	Form::selectDate($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1);
+	$form->select_date($date_end?$date_end:-1,'date_fin',0,0,0,'',1,1);
 	print '</td>';
 	print '</tr>';
 	print '<tr>';
@@ -1231,19 +1231,19 @@ else
 
             	// Ref
             	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
-            	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+            	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
             	print '</td></tr>';
 
 				print '<tr>';
 				print '<td>'.$langs->trans("DateStart").'</td>';
 				print '<td>';
-				Form::selectDate($object->date_debut,'date_debut');
+				$form->select_date($object->date_debut,'date_debut');
 				print '</td>';
 				print '</tr>';
 				print '<tr>';
 				print '<td>'.$langs->trans("DateEnd").'</td>';
 				print '<td>';
-				Form::selectDate($object->date_fin,'date_fin');
+				$form->select_date($object->date_fin,'date_fin');
 				print '</td>';
 				print '</tr>';
 
@@ -1335,56 +1335,56 @@ else
 
 				if ($action == 'save')
 				{
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_validate","","",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'save_from_refuse')
 				{
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("SaveTrip"),$langs->trans("ConfirmSaveTrip"),"confirm_save_from_refuse","","",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'delete')
 				{
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteTrip"),$langs->trans("ConfirmDeleteTrip"),"confirm_delete","","",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'validate')
 				{
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("ValideTrip"),$langs->trans("ConfirmValideTrip"),"confirm_approve","","",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'paid')
 				{
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("PaidTrip"),$langs->trans("ConfirmPaidTrip"),"confirm_paid","","",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'cancel')
 				{
 					$array_input = array('text'=>$langs->trans("ConfirmCancelTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_cancel",'size'=>"50",'value'=>""));
-					$ret=$formForm::formconfirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1);
+					$ret=$form->form_confirm($_SEVER["PHP_SELF"]."?id=".$id,$langs->trans("Cancel"),"","confirm_cancel",$array_input,"",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'brouillonner'):
-				$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1);
+				$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("BrouillonnerTrip"),$langs->trans("ConfirmBrouillonnerTrip"),"confirm_brouillonner","","",1);
 				if ($ret == 'html') print '<br>';
 				endif;
 
 				if ($action == 'refuse')		// Deny
 				{
 					$array_input = array('text'=>$langs->trans("ConfirmRefuseTrip"), array('type'=>"text",'label'=>$langs->trans("Comment"),'name'=>"detail_refuse",'size'=>"50",'value'=>""));
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("Deny"),'',"confirm_refuse",$array_input,"yes",1);
 					if ($ret == 'html') print '<br>';
 				}
 
 				if ($action == 'delete_line')
 				{
-					$ret=$formForm::formconfirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1);
+					$ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$id."&rowid=".GETPOST('rowid'),$langs->trans("DeleteLine"),$langs->trans("ConfirmDeleteLine"),"confirm_delete_line",'','yes',1);
 					if ($ret == 'html') print '<br>';
 				}
 
@@ -1394,7 +1394,7 @@ else
 
             	// Ref
             	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="2">';
-            	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+            	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
             	print '</td></tr>';
 
 				print '<tr>';
@@ -1728,7 +1728,7 @@ else
 
 									// Select date
 									print '<td style="text-align:center;">';
-									Form::selectDate($objp->date,'date');
+									$form->select_date($objp->date,'date');
 									print '</td>';
 
 									// Select project
@@ -1812,7 +1812,7 @@ else
 						
 						// Select date
 						print '<td style="text-align:center;">';
-						Form::selectDate($date?$date:-1,'date');
+						$form->select_date($date?$date:-1,'date');
 						print '</td>';
 
 						// Select project
diff --git a/htdocs/expensereport/document.php b/htdocs/expensereport/document.php
index bcd392eb656aadb483679952f54f116442bb34d7..f16d6ca14e14449b77e1ddb63f83c860b67a062a 100644
--- a/htdocs/expensereport/document.php
+++ b/htdocs/expensereport/document.php
@@ -108,7 +108,7 @@ if ($object->id)
 
 	// Ref
 	print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 	print '</td></tr>';
 
 	// Societe
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index b8db432baad945ce0ddcc4388763b21e99dfce28..b7f5be644552ab7f8a9d6b94b182bc5647c8add2 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -266,7 +266,7 @@ if ($resql)
 	print '</td>';
 
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 
diff --git a/htdocs/expensereport/payment/card.php b/htdocs/expensereport/payment/card.php
index b4ff6f99f784ac76e909bacfd731809bd46c628a..19d5b3206f70512d5097b9071dc98cefd0fa6b01 100644
--- a/htdocs/expensereport/payment/card.php
+++ b/htdocs/expensereport/payment/card.php
@@ -133,7 +133,7 @@ dol_fiche_head($head, $hselected, $langs->trans("ExpenseReportPayment"), 0, 'pay
  */
 if ($action == 'delete')
 {
-	print Form::formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
+	print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
 	
 }
 
@@ -143,7 +143,7 @@ if ($action == 'delete')
 if ($action == 'valide')
 {
 	$facid = $_GET['facid'];
-	print Form::formconfirm('card.php?id='.$payment->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
+	print $form->formconfirm('card.php?id='.$payment->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);
 	
 }
 
@@ -153,7 +153,7 @@ print '<table class="border" width="100%">';
 // Ref
 print '<tr><td valign="top" width="20%">'.$langs->trans('Ref').'</td>';
 print '<td colspan="3">';
-print Form::showrefnav($payment,'id','',1,'rowid','id');
+print $form->showrefnav($payment,'id','',1,'rowid','id');
 print '</td></tr>';
 
 // Date
diff --git a/htdocs/expensereport/payment/payment.php b/htdocs/expensereport/payment/payment.php
index da5ab4ed8120ed52224d5137700e851f876a3ee9..b7d40b2e65b109adc9cdffce939e7e04e41aea71 100644
--- a/htdocs/expensereport/payment/payment.php
+++ b/htdocs/expensereport/payment/payment.php
@@ -210,7 +210,7 @@ if (GETPOST("action") == 'create')
 	print '<tr><td class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
 	$datepaid = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
 	$datepayment=empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaid):0;
-	Form::selectDate($datepayment,'','','','',"add_payment",1,1);
+	$form->select_date($datepayment,'','','','',"add_payment",1,1);
 	print "</td>";
 	print '</tr>';
 
diff --git a/htdocs/expensereport/synchro_compta.php b/htdocs/expensereport/synchro_compta.php
index 38e1858b18e581d99534b455ae3f667fedfd433c..59a6b8926fe1228d48e6a5da5d39a98d3ef5b970 100644
--- a/htdocs/expensereport/synchro_compta.php
+++ b/htdocs/expensereport/synchro_compta.php
@@ -108,13 +108,13 @@ dol_fiche_head('');
 
 if ($_GET["action"] == 'ndfTOaccount'):
 	$idTrip = $_GET['idTrip'];
-	$ret=$htmlForm::formconfirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1);
+	$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("ndfToAccount"),$langs->trans("ConfirmNdfToAccount"),"confirm_ndf_to_account","","",1);
 	if ($ret == 'html') print '<br />';
 endif;
 
 if ($_GET["action"] == 'accountTOndf'):
 	$idTrip = $_GET['idTrip'];
-	$ret=$htmlForm::formconfirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1);
+	$ret=$html->form_confirm($_SERVER["PHP_SELF"]."?idTrip=".$idTrip."&account=".$idAccount,$langs->trans("AccountToNdf"),$langs->trans("ConfirmAccountToNdf"),"confirm_account_to_ndf","","",1);
 	if ($ret == 'html') print '<br />';
 endif;
 
diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php
index b0f58f593c98698609035b6a07150302771877e2..c1db488f78d9627e92e53c9bb4c3ff206ce0551c 100644
--- a/htdocs/exports/export.php
+++ b/htdocs/exports/export.php
@@ -1056,7 +1056,7 @@ if ($step == 5 && $datatoexport)
      */
     if ($action == 'remove_file')
     {
-    	print Form::formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
+    	print $form->formconfirm($_SERVER["PHP_SELF"].'?step=5&datatoexport='.$datatoexport.'&file='.urlencode(GETPOST("file")), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
 
     }
 
diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php
index c10177fdc7a8885ff10a89d57d8ff06e417ea6a7..899ecaf9805752dd9a1e1d220c286bd944455915 100644
--- a/htdocs/fichinter/apercu.php
+++ b/htdocs/fichinter/apercu.php
@@ -76,7 +76,7 @@ if ($id > 0 || ! empty($ref))
     
     	// Ref
     	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-    	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+    	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
     	print '</td></tr>';
 
 		$nbrow=3;
diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php
index 3db9ecf15bd55479cdb17568c39fa4d523167a1c..71fec22413798a4152c7afedbb93e4193b3005ba 100644
--- a/htdocs/fichinter/card.php
+++ b/htdocs/fichinter/card.php
@@ -1208,7 +1208,7 @@ else if ($id > 0 || ! empty($ref))
 	// Confirm deletion of intervention
 	if ($action == 'delete')
 	{
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteIntervention'), $langs->trans('ConfirmDeleteIntervention'), 'confirm_delete','',0,1);
 	}
 
 	// Confirm validation
@@ -1231,19 +1231,19 @@ else if ($id > 0 || ! empty($ref))
 		}
 		$text=$langs->trans('ConfirmValidateIntervention',$numref);
 
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',1,1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',1,1);
 	}
 
 	// Confirm back to draft
 	if ($action == 'modify')
 	{
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ModifyIntervention'), $langs->trans('ConfirmModifyIntervention'), 'confirm_modify','',0,1);
 	}
 
 	// Confirm deletion of line
 	if ($action == 'ask_deleteline')
 	{
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&line_id='.$lineid, $langs->trans('DeleteInterventionLine'), $langs->trans('ConfirmDeleteInterventionLine'), 'confirm_deleteline','',0,1);
 	}
 
 	if (!$formconfirm)
@@ -1269,7 +1269,7 @@ else if ($id > 0 || ! empty($ref))
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td></tr>';
 
 	// Third party
@@ -1309,9 +1309,9 @@ else if ($id > 0 || ! empty($ref))
 
 	// Description (must be a textarea and not html must be allowed (used in list view)
 	print '<tr><td>';
-	print Form::editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea');
+	print $form->editfieldkey("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea');
 	print '</td><td colspan="3">';
-	print Form::editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea:8:80');
+	print $form->editfieldval("Description",'description',$object->description,$object,$user->rights->ficheinter->creer,'textarea:8:80');
 	print '</td>';
 	print '</tr>';
 
@@ -1549,7 +1549,7 @@ else if ($id > 0 || ! empty($ref))
 
 					// Date d'intervention
 					print '<td align="center" class="nowrap">';
-					Form::selectDate($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
+					$form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
 					print '</td>';
                         
                     // Duration
@@ -1616,7 +1616,7 @@ else if ($id > 0 || ! empty($ref))
 				$timearray=dol_getdate($now);
 				if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
 				else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
-				Form::selectDate($timewithnohour,'di',1,1,0,"addinter");
+				$form->select_date($timewithnohour,'di',1,1,0,"addinter");
 				print '</td>';
 
                 // Duration
diff --git a/htdocs/fichinter/contact.php b/htdocs/fichinter/contact.php
index 6a2ead722f71a993383e92c742a8976b32637c93..b92c1442d14906ecb62f644d6c1960d42ba4aa11 100644
--- a/htdocs/fichinter/contact.php
+++ b/htdocs/fichinter/contact.php
@@ -129,7 +129,7 @@ if ($id > 0 || ! empty($ref))
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-    print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+    print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print "</td></tr>";
 
 	// Customer
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index deb2f3cdea4edac69c99ac22a8f20c9924689d60..2acf7d3909397ebd73b396eaca706e81044ae4d5 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -107,7 +107,7 @@ if ($object->id)
 
 	// Ref
 	print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td></tr>';
 
 	// Societe
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 1f079c93da32029db292f8d9448587b6ea413b3a..d86c2b86274b2817632cb53f3eec9b2e04f95566 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -201,7 +201,7 @@ if ($result)
 	print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1);
 	print '</td>';
 	print '<td class="liste_titre" align="right">';
-	$searchpitco=Form::showFilterAndCheckAddButtons();
+	$searchpitco=$form->showFilterAndCheckAddButtons(0);
 	print $searchpitco;
 	print '</td>';
     print "</tr>\n";
diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php
index 52c1d408863bf0512f054ce41fc33af17ef15c0f..3c5fce7caa2294234ef4133a83fcf15c6eadad77 100644
--- a/htdocs/fichinter/note.php
+++ b/htdocs/fichinter/note.php
@@ -71,7 +71,7 @@ if ($id > 0 || ! empty($ref))
 		$linkback = '<a href="'.DOL_URL_ROOT.'/fichinter/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
 
 		print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 		print '</td></tr>';
 
 		// Company
diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php
index 91a8f43818c071f8530dabecbc81aea794b885e6..61c2d3862afa3255fdaf846786d781dad34021f3 100644
--- a/htdocs/fourn/card.php
+++ b/htdocs/fourn/card.php
@@ -160,9 +160,9 @@ if ($object->id > 0)
 		$langs->load('compta');
         print '<tr>';
         print '<td>';
-        print Form::editfieldkey("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer);
+        print $form->editfieldkey("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer);
         print '</td><td colspan="3">';
-        print Form::editfieldval("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer);
+        print $form->editfieldval("SupplierAccountancyCode",'supplieraccountancycode',$object->code_compta_fournisseur,$object,$user->rights->societe->creer);
         print '</td>';
         print '</tr>';
 	}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index f74a8ca9d5fb40fb9c54c6a444a18a29b93542da..6c7d3ef1b3570b15f4ea5a0f544c589f196de573 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1596,7 +1596,7 @@ if ($action=='create')
 	print '<td>';
 	$usehourmin=0;
 	if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin=1;
-	Form::selectDate($datelivraison?$datelivraison:-1,'liv_',$usehourmin,$usehourmin,'',"set");
+	$form->select_date($datelivraison?$datelivraison:-1,'liv_',$usehourmin,$usehourmin,'',"set");
 	print '</td></tr>';
 
     // Bank Account
@@ -1733,7 +1733,7 @@ elseif (! empty($object->id))
 	 */
 	if ($action	== 'delete')
 	{
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 2);
 
 	}
 
@@ -1745,7 +1745,7 @@ elseif (! empty($object->id))
 				//array('type' => 'checkbox', 'name' => 'update_prices',   'label' => $langs->trans("PuttingPricesUpToDate"),   'value' => 1)
 		);
 		// Paiement incomplet. On demande si motif = escompte ou autre
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneOrder'),$langs->trans('ConfirmCloneOrder',$object->ref),'confirm_clone',$formquestion,'yes',1);
 
 	}
 
@@ -1779,7 +1779,7 @@ elseif (! empty($object->id))
 				$text.=$notify->confirmMessage('ORDER_SUPPLIER_VALIDATE', $object->socid, $object);
 			}
 
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_valid', '', 0, 1);
 		}
 	}
 
@@ -1820,7 +1820,7 @@ elseif (! empty($object->id))
 			$text.=$notify->confirmMessage('ORDER_SUPPLIER_APPROVE', $object->socid, $object);
 		}
 
-		$formconfirm = Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ApproveThisOrder"), $text, "confirm_".$action, $formquestion, 1, 1, 240);
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id, $langs->trans("ApproveThisOrder"), $text, "confirm_".$action, $formquestion, 1, 1, 240);
 	}
 
 	/*
@@ -1828,7 +1828,7 @@ elseif (! empty($object->id))
 	 */
 	if ($action	== 'refuse')
 	{
-		$formconfirm = Form::formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("DenyingThisOrder"),$langs->trans("ConfirmDenyingThisOrder",$object->ref),"confirm_refuse", '', 0, 1);
 
 	}
 
@@ -1837,7 +1837,7 @@ elseif (! empty($object->id))
 	 */
 	if ($action	== 'cancel')
 	{
-		$formconfirm = Form::formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=$object->id",$langs->trans("Cancel"),$langs->trans("ConfirmCancelThisOrder",$object->ref),"confirm_cancel", '', 0, 1);
 
 	}
 
@@ -1847,14 +1847,14 @@ elseif (! empty($object->id))
 	if ($action	== 'commande')
 	{
 		$date_com = dol_mktime(GETPOST('rehour'),GETPOST('remin'),GETPOST('resec'),GETPOST("remonth"),GETPOST("reday"),GETPOST("reyear"));
-		$formconfirm = Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2);
+		$formconfirm = $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id."&datecommande=".$date_com."&methode=".$_POST["methodecommande"]."&comment=".urlencode($_POST["comment"]), $langs->trans("MakeOrder"),$langs->trans("ConfirmMakeOrder",dol_print_date($date_com,'day')),"confirm_commande",'',0,2);
 
 	}
 
 	// Confirmation to delete line
 	if ($action == 'ask_deleteline')
 	{
-		 $formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
+		 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 	}
 
 	if (!$formconfirm)
@@ -1885,15 +1885,15 @@ elseif (! empty($object->id))
 	// Ref
 	print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 	print '<td colspan="2">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td>';
 	print '</tr>';
 
 	// Ref supplier
 	print '<tr><td>';
-	print Form::editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
+	print $form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
 	print '</td><td colspan="2">';
-	print Form::editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
+	print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,$user->rights->fournisseur->commande->creer);
 	print '</td></tr>';
 
 	// Fournisseur
@@ -2042,7 +2042,7 @@ elseif (! empty($object->id))
 		print '<input type="hidden" name="action" value="setdate_livraison">';
 		$usehourmin=0;
 		if (! empty($conf->global->SUPPLIER_ORDER_USE_HOUR_FOR_DELIVERY_DATE)) $usehourmin=1;
-		Form::selectDate($object->date_livraison?$object->date_livraison:-1,'liv_',$usehourmin,$usehourmin,'',"setdate_livraison");
+		$form->select_date($object->date_livraison?$object->date_livraison:-1,'liv_',$usehourmin,$usehourmin,'',"setdate_livraison");
 		print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
 		print '</form>';
 	}
@@ -2364,9 +2364,9 @@ elseif (! empty($object->id))
 
             print '<br>';
             print $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
-            print Form::selectDate($date_start,'date_start'.$date_pf,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,'',1,0,1);
+            print $form->select_date($date_start,'date_start'.$date_pf,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,'',1,0,1);
             print ' '.$langs->trans('to').' ';
-            print Form::selectDate($date_end,'date_end'.$date_pf,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,'',1,0,1);
+            print $form->select_date($date_end,'date_end'.$date_pf,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE,1,'',1,0,1);
 
 			print '</td>';
 			print '<td>';
@@ -2978,7 +2978,7 @@ elseif (! empty($object->id))
 			//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("ToOrder").'</td></tr>';
 			print '<tr><td>'.$langs->trans("OrderDate").'</td><td>';
 			$date_com = dol_mktime(0, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
-			print Form::selectDate($date_com,'',1,1,'',"commande",1,0,1);
+			print $form->select_date($date_com,'',1,1,'',"commande",1,0,1);
 			print '</td></tr>';
 
 			print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
@@ -3005,7 +3005,7 @@ elseif (! empty($object->id))
 			print '<table class="border" width="100%">';
 			//print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Receive").'</td></tr>';
 			print '<tr><td>'.$langs->trans("DeliveryDate").'</td><td>';
-			print Form::selectDate('','',1,1,'',"commande",1,0,1);
+			print $form->select_date('','',1,1,'',"commande",1,0,1);
 			print "</td></tr>\n";
 
 			print "<tr><td>".$langs->trans("Delivery")."</td><td>\n";
diff --git a/htdocs/fourn/commande/contact.php b/htdocs/fourn/commande/contact.php
index 49ee75991e357c0308e462906a05ca84a691d272..8ced1e9844ce767784f40575e3d8598569750e67 100644
--- a/htdocs/fourn/commande/contact.php
+++ b/htdocs/fourn/commande/contact.php
@@ -151,7 +151,7 @@ if ($id > 0 || ! empty($ref))
 		// Ref
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 		print '<td colspan="2">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 		print '</td>';
 		print '</tr>';
 
diff --git a/htdocs/fourn/commande/dispatch.php b/htdocs/fourn/commande/dispatch.php
index 5ecbee4377631c39d22090e526f78572a10c4d65..34dd4ad180fa6b669ee4746909a18500bf3ab393 100644
--- a/htdocs/fourn/commande/dispatch.php
+++ b/htdocs/fourn/commande/dispatch.php
@@ -286,7 +286,7 @@ if ($id > 0 || ! empty($ref))
 		// Ref
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 		print '<td colspan="2">';
-		print Form::showrefnav($commande,'ref','',1,'ref','ref');
+		print $form->showrefnav($commande,'ref','',1,'ref','ref');
 		print '</td>';
 		print '</tr>';
 
@@ -510,11 +510,11 @@ if ($id > 0 || ! empty($ref))
 								print '</td>';
 								print '<td>';
 								$dlcdatesuffix=dol_mktime(0, 0, 0, GETPOST('dlc'.$suffix.'month'), GETPOST('dlc'.$suffix.'day'), GETPOST('dlc'.$suffix.'year'));
-								Form::selectDate($dlcdatesuffix,'dlc'.$suffix,'','',1,"");
+								$form->select_date($dlcdatesuffix,'dlc'.$suffix,'','',1,"");
 								print '</td>';
 								print '<td>';
 								$dluodatesuffix=dol_mktime(0, 0, 0, GETPOST('dluo'.$suffix.'month'), GETPOST('dluo'.$suffix.'day'), GETPOST('dluo'.$suffix.'year'));
-								Form::selectDate($dluodatesuffix,'dluo'.$suffix,'','',1,"");
+								$form->select_date($dluodatesuffix,'dluo'.$suffix,'','',1,"");
 								print '</td>';
 								print '<td colspan="2">&nbsp</td>';		// Qty ordered + qty already dispatached
 							}
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 3209e8c88a6bff6e71371b38153aa94f366a146e..2949aedcf141382f5504981e285c51ef36a8e710 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -115,7 +115,7 @@ if ($object->id > 0)
 	// Ref
 	print '<tr><td width="35%">'.$langs->trans("Ref").'</td>';
 	print '<td colspan="2">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td>';
 	print '</tr>';
 
diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php
index 10cbfdecd8ff937e901046c6d60722e8babf256f..c864dce3b88d711ff116bfc967b6d7e6533d20e2 100644
--- a/htdocs/fourn/commande/history.php
+++ b/htdocs/fourn/commande/history.php
@@ -81,7 +81,7 @@ if ($id > 0 || ! empty($ref))
 		// Ref
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
 		print '<td colspan="2">';
-		print Form::showrefnav($commande, 'ref', $linkback, 1, 'ref', 'ref');
+		print $form->showrefnav($commande, 'ref', $linkback, 1, 'ref', 'ref');
 		print '</td>';
 		print '</tr>';
 
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 6d711c60b0e95e0748abcacbdf7fae61eea13541..b2d6668266feadc9ea3173736d6eca84ea3e5199 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -269,10 +269,10 @@ if ($resql)
 	$formorder->selectSupplierOrderStatus((strstr($search_status, ',')?-1:$search_status),1,'search_status');
 	print '</td>';
 	print '<td align="center">';
-	print Form::selectyesno('billed', $billed, 1, 0, 1);
+	print $form->selectyesno('billed', $billed, 1, 0, 1);
 	print '</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/fourn/commande/note.php b/htdocs/fourn/commande/note.php
index 2be8b83288cfed746232da9f8aeb9bba2a801c42..6a1c6cfe80ead003117161d3b405f003148e5be7 100644
--- a/htdocs/fourn/commande/note.php
+++ b/htdocs/fourn/commande/note.php
@@ -96,7 +96,7 @@ if ($id > 0 || ! empty($ref))
         // Ref
         print '<tr><td width="20%">'.$langs->trans("Ref").'</td>';
         print '<td colspan="2">';
-        print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+        print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
         print '</td>';
         print '</tr>';
 
diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php
index 02c9ad951a4471b9cd463d3676092dbdd5f03833..3f75bca3a357087024de21c2ba5201aead1e6c2b 100644
--- a/htdocs/fourn/commande/orderstoinvoice.php
+++ b/htdocs/fourn/commande/orderstoinvoice.php
@@ -323,7 +323,7 @@ if ($action == 'create' && !$error) {
 
 	// Date invoice
 	print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
-	Form::selectDate('', '', '', '', '', "add", 1, 1);
+	$html->select_date('', '', '', '', '', "add", 1, 1);
 	print '</td></tr>';
 	// Payment term
 	print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">';
@@ -469,8 +469,8 @@ if (($action != 'create' && $action != 'add') && !$error) {
 		$num = $db->num_rows($resql);
 		print load_fiche_titre($title);
 		$i = 0;
-		$period = Form::selectDate($date_start, 'date_start', 0, 0, 1, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 1, '', 1, 0, 1);
-		$periodely = Form::selectDate($date_starty, 'date_start_dely', 0, 0, 1, '', 1, 0, 1) . ' - ' . Form::selectDate($date_endy, 'date_end_dely', 0, 0, 1, '', 1, 0, 1);
+		$period = $html->select_date($date_start, 'date_start', 0, 0, 1, '', 1, 0, 1) . ' - ' . $html->select_date($date_end, 'date_end', 0, 0, 1, '', 1, 0, 1);
+		$periodely = $html->select_date($date_starty, 'date_start_dely', 0, 0, 1, '', 1, 0, 1) . ' - ' . $html->select_date($date_endy, 'date_end_dely', 0, 0, 1, '', 1, 0, 1);
 
 		if (! empty($socid)) {
 			// Company
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 9c2e6699fed284f1ce80a7b2b3fcce50cf60567b..5dad9e2f706a1efdb2f7c99110f065c4f30f7887 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -1483,12 +1483,12 @@ if ($action == 'create')
 
     // Date invoice
     print '<tr><td class="fieldrequired">'.$langs->trans('DateInvoice').'</td><td>';
-    Form::selectDate($dateinvoice,'','','','',"add",1,1);
+    $form->select_date($dateinvoice,'','','','',"add",1,1);
     print '</td></tr>';
 
     // Due date
     print '<tr><td>'.$langs->trans('DateMaxPayment').'</td><td>';
-    Form::selectDate($datedue,'ech','','','',"add",1,1);
+    $form->select_date($datedue,'ech','','','',"add",1,1);
     print '</td></tr>';
 
 	// Payment term
@@ -1711,7 +1711,7 @@ else
             //array('type' => 'checkbox', 'name' => 'clone_content',   'label' => $langs->trans("CloneMainAttributes"),   'value' => 1)
             );
             // Paiement incomplet. On demande si motif = escompte ou autre
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneInvoice'),$langs->trans('ConfirmCloneInvoice',$object->ref),'confirm_clone',$formquestion,'yes', 1);
         }
 
         // Confirmation de la validation
@@ -1761,28 +1761,28 @@ else
                 array('type' => 'other', 'name' => 'idwarehouse',   'label' => $langs->trans("SelectWarehouseForStockIncrease"),   'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse'),'idwarehouse','',1)));
             }
 
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateBill'), $text, 'confirm_valid', $formquestion, 1, 1, 240);
 
         }
 
         // Confirmation set paid
         if ($action == 'paid')
         {
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ClassifyPaid'), $langs->trans('ConfirmClassifyPaidBill', $object->ref), 'confirm_paid', '', 0, 1);
 
         }
 
         // Confirmation de la suppression de la facture fournisseur
         if ($action == 'delete')
         {
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteBill'), $langs->trans('ConfirmDeleteBill'), 'confirm_delete', '', 0, 1);
 
         }
 
        	// Confirmation to delete line
 		if ($action == 'ask_deleteline')
 		{
-			$formconfirm=Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
+			$formconfirm=$form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 		}
 
         if (!$formconfirm) {
@@ -1805,13 +1805,13 @@ else
 
         // Ref
         print '<tr><td class="nowrap" width="20%">'.$langs->trans("Ref").'</td><td colspan="4">';
-        print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+        print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
         print '</td>';
         print "</tr>\n";
 
         // Ref supplier
-        print '<tr><td>'.Form::editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer)).'</td><td colspan="4">';
-        print Form::editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer));
+        print '<tr><td>'.$form->editfieldkey("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer)).'</td><td colspan="4">';
+        print $form->editfieldval("RefSupplier",'ref_supplier',$object->ref_supplier,$object,($object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer));
         print '</td></tr>';
 
         // Third party
@@ -1859,8 +1859,8 @@ else
         print '</td></tr>';
 
         // Label
-        print '<tr><td>'.Form::editfieldkey("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
-        print '<td colspan="3">'.Form::editfieldval("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
+        print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
+        print '<td colspan="3">'.$form->editfieldval("Label",'label',$object->label,$object,($user->rights->fournisseur->facture->creer)).'</td>';
 
         /*
          * List of payments
@@ -1965,13 +1965,13 @@ else
 	    $form_permission = $object->statut<FactureFournisseur::STATUS_CLOSED && $user->rights->fournisseur->facture->creer && $object->getSommePaiement() <= 0;
 
         // Date
-        print '<tr><td>'.Form::editfieldkey("Date",'datef',$object->datep,$object,$form_permission,'datepicker').'</td><td colspan="3">';
-        print Form::editfieldval("Date",'datef',$object->datep,$object,$form_permission,'datepicker');
+        print '<tr><td>'.$form->editfieldkey("Date",'datef',$object->datep,$object,$form_permission,'datepicker').'</td><td colspan="3">';
+        print $form->editfieldval("Date",'datef',$object->datep,$object,$form_permission,'datepicker');
         print '</td>';
 
         // Due date
-        print '<tr><td>'.Form::editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker').'</td><td colspan="3">';
-        print Form::editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker');
+        print '<tr><td>'.$form->editfieldkey("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker').'</td><td colspan="3">';
+        print $form->editfieldval("DateMaxPayment",'date_lim_reglement',$object->date_echeance,$object,$form_permission,'datepicker');
         if ($action != 'editdate_lim_reglement' && $object->hasDelay()) {
 	        print img_warning($langs->trans('Late'));
         }
diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php
index b106d769f633744b92f8c23c68576d89b7f8bcfa..664101848a637ddad30860cf7fe4ae7ea0ae6cee 100644
--- a/htdocs/fourn/facture/contact.php
+++ b/htdocs/fourn/facture/contact.php
@@ -145,7 +145,7 @@ if ($id > 0 || ! empty($ref))
 
 		// Reference du facture
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td colspan="3">';
-		print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+		print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
 		print "</td></tr>";
 
         // Ref supplier
@@ -196,8 +196,8 @@ if ($id > 0 || ! empty($ref))
 		print '</td></tr>';
 
 		// Label
-		print '<tr><td>'.Form::editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
-		print Form::editfieldval("Label",'label',$object->label,$object,0);
+		print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
+		print $form->editfieldval("Label",'label',$object->label,$object,0);
 		print '</td></tr>';
 
         // Status
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index 63a14f95f491d0f0d57b262dde06dcdbcfae316b..7b36ec62c375a5c75d3a3eb414772f92993fa7bf 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -101,7 +101,7 @@ if ($object->id > 0)
 	 */
 	if ($action == 'delete')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&urlfile='.urlencode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
 
 	}
 
@@ -111,7 +111,7 @@ if ($object->id > 0)
 
 	// Ref
 	print '<tr><td width="30%" class="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td>';
 	print "</tr>\n";
 
@@ -164,8 +164,8 @@ if ($object->id > 0)
 	print '</td></tr>';
 
 	// Label
-	print '<tr><td>'.Form::editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
-	print Form::editfieldval("Label",'label',$object->label,$object,0);
+	print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
+	print $form->editfieldval("Label",'label',$object->label,$object,0);
 	print '</td>';
 
 	// Status
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 089fae1c371ec8dd414a343c578168422dff1c2c..a5ea3b88286777d08256602064c9fa5c087d9832 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -216,7 +216,7 @@ if ($user->rights->fournisseur->facture->lire)
 		print '<input class="flat" type="text" size="8" name="search_amount_all_tax" value="'.$search_amount_all_tax.'">';
 		print '</td>';
         print '<td class="liste_titre" align="right">';
-        $searchpitco=Form::showFilterAndCheckAddButtons();
+        $searchpitco=$form->showFilterAndCheckAddButtons(0);
         print $searchpitco;
         print '</td>';
 		print "</tr>\n";
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index e6e9d7c4125af67813cf794c1f2456138ab63d44..dafe95e419dd65575abf3f79f93f2ca8a7cc7437 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -341,7 +341,7 @@ if ($resql)
 	print $form->selectarray('filtre', $liststatus, $search_status, 1);
 	print '</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print "</tr>\n";
diff --git a/htdocs/fourn/facture/note.php b/htdocs/fourn/facture/note.php
index 2ede6e6976f83652c3e819fb36deada24e8b0d47..3a4528d827e303e2f11f195760aa0ed22a872c52 100644
--- a/htdocs/fourn/facture/note.php
+++ b/htdocs/fourn/facture/note.php
@@ -84,7 +84,7 @@ if ($object->id > 0)
 
 	// Ref
 	print '<tr><td width="20%" class="nowrap">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
 	print '</td>';
 	print "</tr>\n";
 
@@ -135,8 +135,8 @@ if ($object->id > 0)
 	print '</td></tr>';
 
 	// Label
-	print '<tr><td>'.Form::editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
-	print Form::editfieldval("Label",'label',$object->label,$object,0);
+	print '<tr><td>'.$form->editfieldkey("Label",'label',$object->label,$object,0).'</td><td colspan="3">';
+	print $form->editfieldval("Label",'label',$object->label,$object,0);
 	print '</td></tr>';
 
 	// Status
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index ae4020e4a04f30e4cfab38a13a142ad636234062..dd9d8fae87ff20cf38bad1c9bd80a99070047638 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -355,7 +355,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
             print $supplierstatic->getNomUrl(1,'supplier');
             print '</td></tr>';
             print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
-            Form::selectDate($dateinvoice,'','','','',"addpaiement",1,1,0,0,'','',$object->date);
+            $form->select_date($dateinvoice,'','','','',"addpaiement",1,1,0,0,'','',$object->date);
             print '</td>';
             print '<td>'.$langs->trans('Comments').'</td></tr>';
             print '<tr><td class="fieldrequired">'.$langs->trans('PaymentMode').'</td><td>';
@@ -537,7 +537,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
 	                $text.='<br>'.$langs->trans("AllCompletelyPayedInvoiceWillBeClosed");
 	                print '<input type="hidden" name="closepaidinvoices" value="'.GETPOST('closepaidinvoices').'">';
 	            }
-	            print Form::formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('PayedSuppliersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
+	            print $form->formconfirm($_SERVER['PHP_SELF'].'?facid='.$facture->id.'&socid='.$facture->socid.'&type='.$facture->type,$langs->trans('PayedSuppliersPayments'),$text,'confirm_paiement',$formquestion,$preselectedchoice);
 	        }
 
             print '</form>';
@@ -642,7 +642,7 @@ if (empty($action))
         print '<input class="flat" type="text" size="4" name="search_amount" value="'.$search_amount.'">';
         print '</td>';
         print '<td class="liste_titre" align="right">';
-        $searchpitco=Form::showFilterAndCheckAddButtons();
+        $searchpitco=$form->showFilterAndCheckAddButtons(0);
         print $searchpitco;
         print '</td>';
         print "</tr>\n";
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index ab2d4ed0f249f1b9ce32ebf4ce6faca74740000c..3b93eb85cc9aed55794ebcea2c6bbd919d4c524e 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -155,7 +155,7 @@ if ($result > 0)
 	 */
 	if ($action == 'delete')
 	{
-		print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
+		print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete');
 
 	}
 
@@ -164,7 +164,7 @@ if ($result > 0)
 	 */
 	if ($action == 'valide')
 	{
-		print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
+		print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide');
 
 	}
 
@@ -172,12 +172,12 @@ if ($result > 0)
 
 	print '<tr>';
 	print '<td width="20%" colspan="2">'.$langs->trans('Ref').'</td><td colspan="3">';
-    print Form::showrefnav($object,'id','',1,'rowid','ref');
+    print $form->showrefnav($object,'id','',1,'rowid','ref');
 	print '</td></tr>';
 
 	// Date payment
-    print '<tr><td colspan="2">'.Form::editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
-    print Form::editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
+    print '<tr><td colspan="2">'.$form->editfieldkey("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
+    print $form->editfieldval("Date",'datep',$object->date,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'datepicker','',null,$langs->trans('PaymentDateUpdateSucceeded'));
     print '</td></tr>';
 
 	// Payment mode
@@ -185,8 +185,8 @@ if ($result > 0)
 	print '<tr><td colspan="2">'.$langs->trans('PaymentMode').'</td><td colspan="3">'.$labeltype.'</td></tr>';
 
 	// Payment numero
-    print '<tr><td colspan="2">'.Form::editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
-    print Form::editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
+    print '<tr><td colspan="2">'.$form->editfieldkey("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
+    print $form->editfieldval("Numero",'num_paiement',$object->numero,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
     print '</td></tr>';
 
 	// Amount
@@ -198,8 +198,8 @@ if ($result > 0)
 	}
 
 	// Note
-    print '<tr><td colspan="2">'.Form::editfieldkey("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
-    print Form::editfieldval("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer,'textarea');
+    print '<tr><td colspan="2">'.$form->editfieldkey("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer).'</td><td colspan="3">';
+    print $form->editfieldval("Note",'note',$object->note,$object,$user->rights->fournisseur->facture->creer,'textarea');
     print '</td></tr>';
 
 	$allow_delete = 1 ;
diff --git a/htdocs/ftp/admin/ftpclient.php b/htdocs/ftp/admin/ftpclient.php
index d0fd41578d46e2a3e61a27f45ca6395ba1095c34..b0d6b4affa2b5c826f282ac7dc7087d642d82645 100644
--- a/htdocs/ftp/admin/ftpclient.php
+++ b/htdocs/ftp/admin/ftpclient.php
@@ -192,7 +192,7 @@ else
 	print '<td>'.$langs->trans("FTPPassiveMode").'</td>';
 	$defaultpassive=GETPOST("FTP_PASSIVE_" . ($lastftpentry+1));
 	if (! isset($_POST["FTP_PASSIVE_" . ($lastftpentry+1)])) $defaultpassive=empty($conf->global->FTP_SUGGEST_PASSIVE_BYDEFAULT)?0:1;
-	print '<td>'.Form::selectyesno('FTP_PASSIVE_'.($lastftpentry+1), $defaultpassive, 2).'</td>';
+	print '<td>'.$form->selectyesno('FTP_PASSIVE_'.($lastftpentry+1), $defaultpassive, 2).'</td>';
 	print '<td>'.$langs->trans("No").'</td>';
 	print '</tr>';
 	
@@ -273,7 +273,7 @@ else
 			$var=!$var;
 			print "<tr ".$bc[$var].">";
 			print "<td width=\"100\">".$langs->trans("FTPPassiveMode")."</td>";
-			print '<td>'.Form::selectyesno('FTP_PASSIVE_'.$idrss, @constant("FTP_PASSIVE_" . $idrss), 1).'</td>';
+			print '<td>'.$form->selectyesno('FTP_PASSIVE_'.$idrss, @constant("FTP_PASSIVE_" . $idrss), 1).'</td>';
 			print "</tr>";
 
 			print "<tr>";
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 377d003baec25c0b05a4f1cbd7840c02b2c8265e..62bb22bf328f61b68385842658d5bab23a7c5b98 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -410,14 +410,14 @@ else
 		// Confirm remove file
 		if ($action == 'delete')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
+			print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile','','',1);
 			
 		}
 
 		// Confirmation de la suppression d'une ligne categorie
 		if ($action == 'delete_section')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
+			print $form->formconfirm($_SERVER["PHP_SELF"].'?numero_ftp='.$numero_ftp.'&section='.urlencode($_REQUEST["section"]).'&file='.urlencode($_GET["file"]), $langs->trans('DeleteSection'), $langs->trans('ConfirmDeleteSection',$ecmdir->label), 'confirm_deletesection','','',1);
 			
 		}
 
diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php
index 928e17665d87245ee75703cbea3d040309f3cb8b..8cae95920335802197c0a620763d7ab5af980005 100644
--- a/htdocs/holiday/card.php
+++ b/htdocs/holiday/card.php
@@ -823,10 +823,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
         print '<td>';
         // Si la demande ne vient pas de l'agenda
         if (! GETPOST('date_debut_')) {
-            Form::selectDate(-1,'date_debut_');
+            $form->select_date(-1,'date_debut_');
         } else {
             $tmpdate = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year'));
-            Form::selectDate($tmpdate,'date_debut_');
+            $form->select_date($tmpdate,'date_debut_');
         }
         print ' &nbsp; &nbsp; ';
         print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):'morning'));
@@ -839,10 +839,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create
         print '<td>';
         // Si la demande ne vient pas de l'agenda
         if (! GETPOST('date_fin_')) {
-            Form::selectDate(-1,'date_fin_');
+            $form->select_date(-1,'date_fin_');
         } else {
             $tmpdate = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year'));
-            Form::selectDate($tmpdate,'date_fin_');
+            $form->select_date($tmpdate,'date_fin_');
         }
         print ' &nbsp; &nbsp; ';
         print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):'afternoon'));
@@ -949,33 +949,33 @@ else
                 {
                     if ($user->rights->holiday->delete)
                     {
-                        print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1);
+                        print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleDeleteCP"),$langs->trans("ConfirmDeleteCP"),"confirm_delete", '', 0, 1);
                     }
                 }
 
                 // Si envoi en validation
                 if ($action == 'sendToValidate' && $cp->statut == 1)
                 {
-                    print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1);
+                    print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleToValidCP"),$langs->trans("ConfirmToValidCP"),"confirm_send", '', 1, 1);
                 }
 
                 // Si validation de la demande
                 if ($action == 'valid')
                 {
-                    print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1);
+                    print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleValidCP"),$langs->trans("ConfirmValidCP"),"confirm_valid", '', 1, 1);
                 }
 
                 // Si refus de la demande
                 if ($action == 'refuse')
                 {
                     $array_input = array(array('type'=>"text",'label'=> $langs->trans('DetailRefusCP'),'name'=>"detail_refuse",'size'=>"50",'value'=>""));
-                    print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0);
+                    print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id."&action=confirm_refuse", $langs->trans("TitleRefuseCP"), $langs->trans('ConfirmRefuseCP'), "confirm_refuse", $array_input, 1, 0);
                 }
 
                 // Si annulation de la demande
                 if ($action == 'cancel')
                 {
-                    print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1);
+                    print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$cp->id,$langs->trans("TitleCancelCP"),$langs->trans("ConfirmCancelCP"),"confirm_cancel", '', 1, 1);
                 }
 
                 $head=holiday_prepare_head($cp);
@@ -999,7 +999,7 @@ else
                 print '<tr>';
                 print '<td width="25%">'.$langs->trans("Ref").'</td>';
                 print '<td>';
-                print Form::showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref');
+                print $form->showrefnav($cp, 'id', $linkback, 1, 'rowid', 'ref');
                 print '</td>';
                 print '</tr>';
 
@@ -1035,7 +1035,7 @@ else
                     print '<tr>';
                     print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
                     print '<td>';
-                    Form::selectDate($cp->date_debut,'date_debut_');
+                    $form->select_date($cp->date_debut,'date_debut_');
 			        print ' &nbsp; &nbsp; ';
         			print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):$starthalfday));
                     print '</td>';
@@ -1057,7 +1057,7 @@ else
                     print '<tr>';
                     print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
                     print '<td>';
-                    Form::selectDate($cp->date_fin,'date_fin_');
+                    $form->select_date($cp->date_fin,'date_fin_');
 			        print ' &nbsp; &nbsp; ';
         			print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):$endhalfday));
                     print '</td>';
diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php
index 47cc909bc1ab4dfd8d0d8bc03aceb1a1398ee6ab..63d07cebddfacf91ba265f6636f3a4b3c49c13b2 100644
--- a/htdocs/holiday/document.php
+++ b/htdocs/holiday/document.php
@@ -115,7 +115,7 @@ if ($object->id)
     print '<tr>';
     print '<td width="25%">'.$langs->trans("Ref").'</td>';
     print '<td>';
-    print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref');
+    print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref');
     print '</td>';
     print '</tr>';
 
@@ -151,7 +151,7 @@ if ($object->id)
     	print '<tr>';
     	print '<td>'.$langs->trans('DateDebCP').' ('.$langs->trans("FirstDayOfHoliday").')</td>';
     	print '<td>';
-    	Form::selectDate($object->date_debut,'date_debut_');
+    	$form->select_date($object->date_debut,'date_debut_');
     	print ' &nbsp; &nbsp; ';
     	print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):$starthalfday));
     	print '</td>';
@@ -173,7 +173,7 @@ if ($object->id)
     	print '<tr>';
     	print '<td>'.$langs->trans('DateFinCP').' ('.$langs->trans("LastDayOfHoliday").')</td>';
     	print '<td>';
-    	Form::selectDate($object->date_fin,'date_fin_');
+    	$form->select_date($object->date_fin,'date_fin_');
     	print ' &nbsp; &nbsp; ';
     	print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):$endhalfday));
     	print '</td>';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index d298ac9bc0b7964758606fdc417d78d2f577a6d9..46883f11a2657f21ecb0104fc7843efd3a0113e0 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -369,7 +369,7 @@ print '</td>';
 
 // ACTION
 print '<td class="liste_titre" align="right">';
-$searchpitco=Form::showFilterAndCheckAddButtons();
+$searchpitco=$form->showFilterAndCheckAddButtons(0);
 print $searchpitco;
 print '</td>';
 
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index b9fc872a5930f0d9069702f7d89fbd086b207d07..fb6f41f4f3939aa76f4b18776168951660ccb69c 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -318,7 +318,7 @@ else if ($id)
              */
             if ($action == 'delete')
             {
-                print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete");
+                print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$id,$langs->trans("DeleteEstablishment"),$langs->trans("ConfirmDeleteEstablishment"),"confirm_delete");
 
             }
 
diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php
index bf39e85c08b30de5d7ed2296bed4fe3cd5f63458..23d5a61415bf4bf23b2f4258cd60bb2e46155962 100644
--- a/htdocs/imports/import.php
+++ b/htdocs/imports/import.php
@@ -491,7 +491,7 @@ if ($step == 3 && $datatoimport)
 	 */
 	if ($action == 'delete')
 	{
-		print Form::formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
+		print $form->formconfirm($_SERVER["PHP_SELF"].'?urlfile='.urlencode(GETPOST('urlfile')).'&step=3'.$param, $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile', '', 0, 1);
 
 	}
 
diff --git a/htdocs/includes/odtphp/Segment.php b/htdocs/includes/odtphp/Segment.php
index f7c250be5a26cf4bb44ba511d9d12e8ea5ef2fdb..c3e23ee9aec63ba108847fed67d5bee0fc119898 100644
--- a/htdocs/includes/odtphp/Segment.php
+++ b/htdocs/includes/odtphp/Segment.php
@@ -76,61 +76,12 @@ class Segment implements IteratorAggregate, Countable
     /**
      * Replace variables of the template in the XML code
      * All the children are also called
-     * Complete the current segment with new line
      *
      * @return string
      */
     public function merge()
     {
-        // To provide debug information on line number processed 
-        global $count;
-        if (empty($count)) $count=1;
-        else $count++;
-        
-        if (empty($this->savxml)) $this->savxml = $this->xml;       // Sav content of line at first line merged, so we will reuse original for next steps
-        $this->xml = $this->savxml;
-        $tmpvars = $this->vars;                                     // Store into $tmpvars so we won't modify this->vars when completing data with empty values
-        
-        // Search all tags fou into condition to complete $tmpvars, so we will proceed all tests even if not defined
-        $reg='@\[!--\sIF\s([{}a-zA-Z0-9\.\,_]+)\s--\]@smU';
-        preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
-        //var_dump($tmpvars);exit;
-        foreach($matches as $match)   // For each match, if there is no entry into this->vars, we add it
-        {
-            if (! empty($match[1]) && ! isset($tmpvars[$match[1]]))
-            {
-                $tmpvars[$match[1]] = '';     // Not defined, so we set it to '', we just need entry into this->vars for next loop
-            }
-        }
-        
-        // Conditionals substitution
-        // Note: must be done before static substitution, else the variable will be replaced by its value and the conditional won't work anymore
-        foreach($tmpvars as $key => $value)
-        {
-            // If value is true (not 0 nor false nor null nor empty string)
-            if ($value)
-            {
-                // Remove the IF tag
-                $this->xml = str_replace('[!-- IF '.$key.' --]', '', $this->xml);
-                // Remove everything between the ELSE tag (if it exists) and the ENDIF tag
-                $reg = '@(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
-                $this->xml = preg_replace($reg, '', $this->xml);
-            }
-            // Else the value is false, then two cases: no ELSE and we're done, or there is at least one place where there is an ELSE clause, then we replace it
-            else
-            {
-                // Find all conditional blocks for this variable: from IF to ELSE and to ENDIF
-                $reg = '@\[!--\sIF\s' . $key . '\s--\](.*)(\[!--\sELSE\s' . $key . '\s--\](.*))?\[!--\sENDIF\s' . $key . '\s--\]@smU'; // U modifier = all quantifiers are non-greedy
-                preg_match_all($reg, $this->xml, $matches, PREG_SET_ORDER);
-                foreach($matches as $match) { // For each match, if there is an ELSE clause, we replace the whole block by the value in the ELSE clause
-                    if (!empty($match[3])) $this->xml = str_replace($match[0], $match[3], $this->xml);
-                }
-                // Cleanup the other conditional blocks (all the others where there were no ELSE clause, we can just remove them altogether)
-                $this->xml = preg_replace($reg, '', $this->xml);
-            }
-        }
-        
-        $this->xmlParsed .= str_replace(array_keys($tmpvars), array_values($tmpvars), $this->xml);
+        $this->xmlParsed .= str_replace(array_keys($this->vars), array_values($this->vars), $this->xml);
         if ($this->hasChildren()) {
             foreach ($this->children as $child) {
                 $this->xmlParsed = str_replace($child->xml, ($child->xmlParsed=="")?$child->merge():$child->xmlParsed, $this->xmlParsed);
@@ -149,7 +100,6 @@ class Segment implements IteratorAggregate, Countable
 			}
         }
         $this->file->close();
-        
         return $this->xmlParsed;
     }
     /**
@@ -183,7 +133,7 @@ class Segment implements IteratorAggregate, Countable
     public function setVars($key, $value, $encode = true, $charset = 'ISO-8859')
     {
         if (strpos($this->xml, $this->odf->getConfig('DELIMITER_LEFT') . $key . $this->odf->getConfig('DELIMITER_RIGHT')) === false) {
-            //throw new SegmentException("var $key not found in {$this->getName()}");
+            throw new SegmentException("var $key not found in {$this->getName()}");
         }
 
 		$value=$this->odf->htmlToUTFAndPreOdf($value);
diff --git a/htdocs/includes/odtphp/odf.php b/htdocs/includes/odtphp/odf.php
index 15b766e6d4144da13f7f234cca09bd101e85e3d0..52750352afa81f7ffd9e1511a7b3533ead4e1cb9 100644
--- a/htdocs/includes/odtphp/odf.php
+++ b/htdocs/includes/odtphp/odf.php
@@ -107,8 +107,6 @@ class Odf
 
 		copy($filename, $this->tmpfile);
 
-		// Now file has been loaded, we must move the [!-- BEGIN and [!-- END tags outside the 
-		// <table:table-row tag
 		$this->_moveRowSegments();
 	}
 
@@ -383,8 +381,7 @@ IMG;
 	}
 
 	/**
-	 * Declare a segment in order to use it in a loop.
-	 * Extract the segment and store it into $this->segments[]. Return it for next call.
+	 * Declare a segment in order to use it in a loop
 	 *
 	 * @param string $segment
 	 * @throws OdfException
diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
index 3fa7d67c7ec39de51fd6615ad52072299e2eafb5..c30a3da50f0bb1d67c47d394df2a32e6693315eb 100644
--- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
+++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql
@@ -322,18 +322,4 @@ ALTER TABLE llx_expensereport_det ADD COLUMN multicurrency_total_ttc double(24,8
 
 ALTER TABLE llx_product_lang ADD COLUMN import_key varchar(14) DEFAULT NULL;
 
-ALTER TABLE llx_actioncomm MODIFY COLUMN elementtype varchar(255) DEFAULT NULL;
-
-DELETE FROM llx_menu where module='expensereport';
-
-CREATE TABLE llx_c_accountancy_category (
-  rowid 		integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
-  code 			varchar(16) NOT NULL,
-  label 		varchar(255) NOT NULL,
-  range 		varchar(255) NOT NULL,
-  position    	integer DEFAULT 0,
-  fk_country 	integer DEFAULT NULL,			-- This category is dedicated to a country
-  active 		integer DEFAULT 1
-) ENGINE=innodb;
-
-ALTER TABLE llx_c_accountancy_category ADD UNIQUE INDEX uk_c_accountancy_category(code);
\ No newline at end of file
+ALTER TABLE llx_actioncomm MODIFY COLUMN elementtype varchar(255) DEFAULT NULL;
\ No newline at end of file
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index cb3e19dbf79cddd3cfd5512b400132f042c85c9c..d0d13aa35fcf34c8821f2b018786840c0e4e49d1 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -176,7 +176,4 @@ Options=Options
 OptionModeProductSell=Mode sales
 OptionModeProductBuy=Mode purchases
 OptionModeProductSellDesc=Show all products with no accounting account defined for sales.
-OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases.
-
-## Dictionary
-Range=Range of accounting account
\ No newline at end of file
+OptionModeProductBuyDesc=Show all products with no accounting account defined for purchases.
\ No newline at end of file
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index b98081154852d73d7c7c0019e34a19c4bb24288f..9860b3506da16b41eaeb18d1c94b8c65c3990864 100755
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -831,7 +831,7 @@ DictionaryStaff=Staff
 DictionaryAvailability=Delivery delay
 DictionaryOrderMethods=Ordering methods
 DictionarySource=Origin of proposals/orders
-DictionaryAccountancyCategory=Accounting categories
+DictionaryAccountancyplan=Chart of accounts
 DictionaryAccountancysystem=Models for chart of accounts
 DictionaryEMailTemplates=Emails templates
 DictionaryUnits=Units
diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang
index 62d6b7a6595a1a47b91c913e5703ca17b40e0dd5..36aa814dc5785fd3ba412894c8fe83e41fa494f9 100644
--- a/htdocs/langs/en_US/main.lang
+++ b/htdocs/langs/en_US/main.lang
@@ -284,7 +284,7 @@ Yesterday=Yesterday
 Tomorrow=Tomorrow
 Morning=Morning
 Afternoon=Afternoon
-Quadri=Quarter
+Quadri=Quadri
 MonthOfDay=Month of the day
 HourShort=H
 MinuteShort=mn
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index f3cc1084fa27ec976189a665d25c9405f282397d..8a815c31edb1d68206c81b7ccd7a9faed795ea24 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -556,7 +556,7 @@ else
 			if ($action == 'delete')
 			{
 				$expedition_id = GETPOST("expid");
-				print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&expid='.$expedition_id.'&backtopage='.urlencode($backtopage),$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$object->ref),'confirm_delete','','',1);
+				print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id.'&expid='.$expedition_id.'&backtopage='.urlencode($backtopage),$langs->trans("DeleteDeliveryReceipt"),$langs->trans("DeleteDeliveryReceiptConfirm",$object->ref),'confirm_delete','','',1);
 
 			}
 
@@ -565,7 +565,7 @@ else
 			 */
 			if ($action == 'valid')
 			{
-				print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$object->ref),'confirm_valid','','',1);
+				print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans("ValidateDeliveryReceipt"),$langs->trans("ValidateDeliveryReceiptConfirm",$object->ref),'confirm_valid','','',1);
 
 			}
 
@@ -585,8 +585,8 @@ else
 				print '<tr><td width="20%">'.$langs->trans("RefSending").'</td>';
 				print '<td colspan="3">';
 				// Nav is hidden because on a delivery receipt of a shipment, if we go on next shipment, we may find no tab (a shipment may not have delivery receipt yet)
-				//print Form::showrefnav($expedition, 'refshipment', $linkback, 1, 'ref', 'ref');
-				print Form::showrefnav($expedition, 'refshipment', $linkback, 0, 'ref', 'ref');
+				//print $form->showrefnav($expedition, 'refshipment', $linkback, 1, 'ref', 'ref');
+				print $form->showrefnav($expedition, 'refshipment', $linkback, 0, 'ref', 'ref');
 				print '</td></tr>';
 			}
 
@@ -647,7 +647,7 @@ else
 				print '<form name="setdate_livraison" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" method="post">';
 				print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
 				print '<input type="hidden" name="action" value="setdate_livraison">';
-				Form::selectDate($object->date_delivery?$object->date_delivery:-1,'liv_',1,1,'',"setdate_livraison");
+				$form->select_date($object->date_delivery?$object->date_delivery:-1,'liv_',1,1,'',"setdate_livraison");
 				print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
 				print '</form>';
 			}
diff --git a/htdocs/loan/card.php b/htdocs/loan/card.php
index 3ecbff2e311c7aff994f49ef885df2ebfebc3025..ee799284ea7fa962f8dc5491583945cb39e4c3cf 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -218,13 +218,13 @@ if ($action == 'create')
 	// Date Start
 	print "<tr>";
     print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
-    print Form::selectDate($datestart?$datestart:-1,'start','','','','add',1,1,1);
+    print $form->select_date($datestart?$datestart:-1,'start','','','','add',1,1,1);
     print '</td></tr>';
 
 	// Date End
 	print "<tr>";
     print '<td class="fieldrequired">'.$langs->trans("DateEnd").'</td><td>';
-    print Form::selectDate($dateend?$dateend:-1,'end','','','','add',1,1,1);
+    print $form->select_date($dateend?$dateend:-1,'end','','','','add',1,1,1);
     print '</td></tr>';
 
 	// Number of terms
@@ -312,13 +312,13 @@ if ($id > 0)
 		if ($action == 'paid')
 		{
 			$text=$langs->trans('ConfirmPayLoan');
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans('PayLoan'),$text,"confirm_paid",'','',2);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans('PayLoan'),$text,"confirm_paid",'','',2);
 		}
 
 		if ($action == 'delete')
 		{
 			$text=$langs->trans('ConfirmDeleteLoan');
-			print Form::formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteLoan'),$text,'confirm_delete','','',2);
+			print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('DeleteLoan'),$text,'confirm_delete','','',2);
 		}
 
 		if ($action == 'edit')
@@ -333,7 +333,7 @@ if ($id > 0)
 
 		// Ref
 		print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-		print Form::showrefnav($object,'id');
+		print $form->showrefnav($object,'id');
 		print "</td></tr>";
 
 		// Label
@@ -356,7 +356,7 @@ if ($id > 0)
 		print "<td>";
 		if ($action == 'edit')
 		{
-			print Form::selectDate($object->datestart, 'start', 0, 0, 0, 'update', 1, 0, 1);
+			print $form->select_date($object->datestart, 'start', 0, 0, 0, 'update', 1, 0, 1);
 		}
 		else
 		{
@@ -369,7 +369,7 @@ if ($id > 0)
 		print "<td>";
 		if ($action == 'edit')
 		{
-			print Form::selectDate($object->dateend, 'end', 0, 0, 0, 'update', 1, 0, 1);
+			print $form->select_date($object->dateend, 'end', 0, 0, 0, 'update', 1, 0, 1);
 		}
 		else
 		{
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 8db21b471cc6828df63c520b09079dbf2a91bbca..97d5c2265075b9bce7a13de5f207a2f3c977b3e8 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -100,7 +100,7 @@ if ($object->id)
 
     // Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>';
-	print Form::showrefnav($object,'id');
+	print $form->showrefnav($object,'id');
 	print "</td></tr>";
 
     // Label
@@ -123,7 +123,7 @@ if ($object->id)
     print "<td>";
     if ($action == 'edit')
     {
-        print Form::selectDate($object->datestart, 'start', 0, 0, 0, 'loan', 1, 0, 1);
+        print $form->select_date($object->datestart, 'start', 0, 0, 0, 'loan', 1, 0, 1);
     }
     else
     {
@@ -137,7 +137,7 @@ if ($object->id)
     print "<td>";
     if ($action == 'edit')
     {
-        print Form::selectDate($object->dateend, 'end', 0, 0, 0, 'loan', 1, 0, 1);
+        print $form->select_date($object->dateend, 'end', 0, 0, 0, 'loan', 1, 0, 1);
     }
     else
     {
diff --git a/htdocs/loan/note.php b/htdocs/loan/note.php
index e7d193d9c2d8e2ccdcdec44dbea2fdd6091da5f8..18b51c86fee981d6b28abb952e2ac7557414c63b 100644
--- a/htdocs/loan/note.php
+++ b/htdocs/loan/note.php
@@ -77,7 +77,7 @@ if ($id > 0)
     // Ref
     print '<tr><td width="25%">'.$langs->trans('Ref').'</td>';
     print '<td colspan="3">';
-    print Form::showrefnav($object,'id','','','rowid','ref');
+    print $form->showrefnav($object,'id','','','rowid','ref');
     print '</td></tr>';
     // Name
     print '<tr><td width="20%">'.$langs->trans("Name").'</td>';
diff --git a/htdocs/loan/payment/card.php b/htdocs/loan/payment/card.php
index 85802f20eca75ac22670f5a6df7a96c20bb1c821..6315264bad7569b55d7381dfbf01d9b44bb2070a 100644
--- a/htdocs/loan/payment/card.php
+++ b/htdocs/loan/payment/card.php
@@ -132,7 +132,7 @@ dol_fiche_head($head, $hselected, $langs->trans("PaymentLoan"), 0, 'payment');
  */
 if ($action == 'delete')
 {
-	print Form::formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
+	print $form->formconfirm('card.php?id='.$payment->id, $langs->trans("DeletePayment"), $langs->trans("ConfirmDeletePayment"), 'confirm_delete','',0,2);
 }
 
 /*
@@ -141,7 +141,7 @@ if ($action == 'delete')
 if ($action == 'valide')
 {
 	$facid = $_GET['facid'];
-	print Form::formconfirm('card.php?id='.$payment->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);	
+	print $form->formconfirm('card.php?id='.$payment->id.'&amp;facid='.$facid, $langs->trans("ValidatePayment"), $langs->trans("ConfirmValidatePayment"), 'confirm_valide','',0,2);	
 }
 
 
@@ -150,7 +150,7 @@ print '<table class="border" width="100%">';
 // Ref
 print '<tr><td valign="top" width="140">'.$langs->trans('Ref').'</td>';
 print '<td colspan="3">';
-print Form::showrefnav($payment,'id','',1,'rowid','id');
+print $form->showrefnav($payment,'id','',1,'rowid','id');
 print '</td></tr>';
 
 // Date
diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php
index 2e9e7b9ab46901de3cadb9af8e64388675589b5f..06061da5c2276e1edc601961a0fae79972cd0497 100644
--- a/htdocs/loan/payment/payment.php
+++ b/htdocs/loan/payment/payment.php
@@ -200,7 +200,7 @@ if ($_GET["action"] == 'create')
 	print '<tr><td  width="25%" class="fieldrequired">'.$langs->trans("Date").'</td><td colspan="2">';
 	$datepaid = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int'));
 	$datepayment = empty($conf->global->MAIN_AUTOFILL_DATE)?(empty($_POST["remonth"])?-1:$datepaye):0;
-	Form::selectDate($datepayment, '', '', '', '', "add_payment", 1, 1);
+	$form->select_date($datepayment, '', '', '', '', "add_payment", 1, 1);
 	print "</td>";
 	print '</tr>';
 
diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php
index e384a7b0acfdd8fcd246cca5818031cc27062711..f9189ed7e974f24768d2eaf37134f22d638caa56 100644
--- a/htdocs/margin/agentMargins.php
+++ b/htdocs/margin/agentMargins.php
@@ -101,11 +101,11 @@ if ($user->rights->margins->read->all) {
 // Start date
 print '<td>'.$langs->trans('StartDate').' ('.$langs->trans("DateValidation").')</td>';
 print '<td width="20%">';
-Form::selectDate($startdate,'startdate','','',1,"sel",1,1);
+$form->select_date($startdate,'startdate','','',1,"sel",1,1);
 print '</td>';
 print '<td width="20%">'.$langs->trans('EndDate').' ('.$langs->trans("DateValidation").')</td>';
 print '<td width="20%">';
-Form::selectDate($enddate,'enddate','','',1,"sel",1,1);
+$form->select_date($enddate,'enddate','','',1,"sel",1,1);
 print '</td>';
 print '<td style="text-align: center;">';
 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Launch')).'" />';
diff --git a/htdocs/margin/checkMargins.php b/htdocs/margin/checkMargins.php
index 004769f0773df67d41db48cdf885fbe470914106..ac53d079298bc7b667ae1977d7fba797100a33e3 100644
--- a/htdocs/margin/checkMargins.php
+++ b/htdocs/margin/checkMargins.php
@@ -126,11 +126,11 @@ print '<table class="border" width="100%">';
 // Start date
 print '<td>' . $langs->trans('StartDate') . ' (' . $langs->trans("DateValidation") . ')</td>';
 print '<td width="20%">';
-Form::selectDate($startdate, 'startdate', '', '', 1, "sel", 1, 1);
+$form->select_date($startdate, 'startdate', '', '', 1, "sel", 1, 1);
 print '</td>';
 print '<td width="20%">' . $langs->trans('EndDate') . ' (' . $langs->trans("DateValidation") . ')</td>';
 print '<td width="20%">';
-Form::selectDate($enddate, 'enddate', '', '', 1, "sel", 1, 1);
+$form->select_date($enddate, 'enddate', '', '', 1, "sel", 1, 1);
 print '</td>';
 print '<td style="text-align: center;">';
 print '<input type="submit" class="button" value="' . dol_escape_htmltag($langs->trans('Launch')) . '" name="button_search" />';
diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php
index 49b61c6bf0496981060c435860af015905b95416..93f3220d12cc6c22c70442937bdd06ccf6886246 100644
--- a/htdocs/margin/customerMargins.php
+++ b/htdocs/margin/customerMargins.php
@@ -122,11 +122,11 @@ if (! $sortfield)
 // Start date
 print '<td>'.$langs->trans('StartDate').' ('.$langs->trans("DateValidation").')</td>';
 print '<td width="20%">';
-Form::selectDate($startdate,'startdate','','',1,"sel",1,1);
+$form->select_date($startdate,'startdate','','',1,"sel",1,1);
 print '</td>';
 print '<td width="20%">'.$langs->trans('EndDate').' ('.$langs->trans("DateValidation").')</td>';
 print '<td width="20%">';
-Form::selectDate($enddate,'enddate','','',1,"sel",1,1);
+$form->select_date($enddate,'enddate','','',1,"sel",1,1);
 print '</td>';
 print '<td style="text-align: center;">';
 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Launch')).'" />';
diff --git a/htdocs/margin/productMargins.php b/htdocs/margin/productMargins.php
index 76acf3754bc608156aca6b06460dfcdd4612f929..e8483c90a34267074a872b078bc0ef40c2292fc7 100644
--- a/htdocs/margin/productMargins.php
+++ b/htdocs/margin/productMargins.php
@@ -124,11 +124,11 @@ else {
 // Start date
 print '<td>'.$langs->trans('StartDate').' ('.$langs->trans("DateValidation").')</td>';
 print '<td width="20%">';
-Form::selectDate($startdate,'startdate','','',1,"sel",1,1);
+$form->select_date($startdate,'startdate','','',1,"sel",1,1);
 print '</td>';
 print '<td width="20%">'.$langs->trans('EndDate').' ('.$langs->trans("DateValidation").')</td>';
 print '<td width="20%">';
-Form::selectDate($enddate,'enddate','','',1,"sel",1,1);
+$form->select_date($enddate,'enddate','','',1,"sel",1,1);
 print '</td>';
 print '<td style="text-align: center;">';
 print '<input type="submit" class="button" value="'.dol_escape_htmltag($langs->trans('Launch')).'" />';
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index 22147cde488b3496617df28024950e00a49a37d1..c419a8042103946fc3ed356f33ff0d6fa733c04c 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -198,7 +198,7 @@ $linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).'">'.$langs->tra
 // Ref
 print '<tr><td width="18%">'.$langs->trans('Ref').'</td>';
 print '<td colspan="3">';
-print Form::showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
+print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
 print '</td>';
 print '</tr>';
 
@@ -282,7 +282,7 @@ print '</td></tr>';
 
 // Expire date
 print '<tr><td>'.$langs->trans('ExpireDate').'</td><td colspan="2">';
-if ($action == 'edit') print Form::selectDate($expiredate?$expiredate:$object->date_fin,'expire',0,0,0,'',1,0,1);
+if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object->date_fin,'expire',0,0,0,'',1,0,1);
 else print dol_print_date($object->date_fin,'day');
 print '</td></tr>';
 
@@ -351,7 +351,7 @@ print '</div>';
 
 if ($action == 'delete')
 {
-	print Form::formconfirm($_SERVER["PHP_SELF"].'?&id='.$numsondage, $langs->trans("RemovePoll"), $langs->trans("ConfirmRemovalOfPoll",$id), 'delete_confirm', '', '', 1);
+	print $form->formconfirm($_SERVER["PHP_SELF"].'?&id='.$numsondage, $langs->trans("RemovePoll"), $langs->trans("ConfirmRemovalOfPoll",$id), 'delete_confirm', '', '', 1);
 }
 
 
diff --git a/htdocs/opensurvey/list.php b/htdocs/opensurvey/list.php
index 98e24e9c66f5793e37960b3e646062c76825844e..b440b5ee43e7930b0e6ecd313e23f097991c9cde 100644
--- a/htdocs/opensurvey/list.php
+++ b/htdocs/opensurvey/list.php
@@ -108,7 +108,7 @@ print '<td></td>';
 $arraystatus=array(''=>'&nbsp;','expired'=>$langs->trans("Expired"),'opened'=>$langs->trans("Opened"));
 print '<td align="center">'. $form->selectarray('status', $arraystatus, $status).'</td>';
 print '<td class="liste_titre" align="right">';
-$searchpitco=Form::showFilterAndCheckAddButtons();
+$searchpitco=$form->showFilterAndCheckAddButtons(0);
 print $searchpitco;
 print '</td>';
 print '</tr>'."\n";
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index fe91493711f933c578f583fbcb887bb401e85813..5c14a20de23cac5f722b5ea861b4d25efa3775e9 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -434,7 +434,7 @@ $linkback = '<a href="'.dol_buildpath('/opensurvey/list.php',1).(! empty($socid)
 // Ref
 print '<tr><td width="18%">'.$langs->trans('Ref').'</td>';
 print '<td colspan="3">';
-print Form::showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
+print $form->showrefnav($object, 'id', $linkback, 1, 'id_sondage', 'id_sondage');
 print '</td>';
 print '</tr>';
 
@@ -457,7 +457,7 @@ print '</td></tr>';
 
 // Expire date
 print '<tr><td>'.$langs->trans('ExpireDate').'</td><td colspan="2">';
-if ($action == 'edit') print Form::selectDate($expiredate?$expiredate:$object->date_fin,'expire',0,0,0,'',1,0,1);
+if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object->date_fin,'expire',0,0,0,'',1,0,1);
 else print dol_print_date($object->date_fin,'day');
 print '</td></tr>';
 
diff --git a/htdocs/opensurvey/wizard/create_survey.php b/htdocs/opensurvey/wizard/create_survey.php
index 29b9a89b1cf7a55f9cec93e8f5b6541ca11b708b..c9ba1324a70f583e5af61c73f713b8d7728756fd 100644
--- a/htdocs/opensurvey/wizard/create_survey.php
+++ b/htdocs/opensurvey/wizard/create_survey.php
@@ -156,7 +156,7 @@ print '</tr>'."\n";
 
 print '<tr><td class="fieldrequired">'.  $langs->trans("ExpireDate")  .'</td><td>';
 
-print Form::selectDate($champdatefin?$champdatefin:-1,'champdatefin','','','',"add",1,0,1);
+print $form->select_date($champdatefin?$champdatefin:-1,'champdatefin','','','',"add",1,0,1);
 
 print '</tr>'."\n";
 print '</table>'."\n";
diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php
index 5de5056b8a2a642a9c55501e057a6c560e7cb060..f794989c59ebe98c0728c391c000133dcbceb06e 100644
--- a/htdocs/paypal/admin/paypal.php
+++ b/htdocs/paypal/admin/paypal.php
@@ -131,7 +131,7 @@ print "</tr>\n";
 $var=!$var;
 print '<tr '.$bc[$var].'><td class="fieldrequired">';
 print $langs->trans("PAYPAL_API_SANDBOX").'</td><td>';
-print Form::selectyesno("PAYPAL_API_SANDBOX",$conf->global->PAYPAL_API_SANDBOX,1);
+print $form->selectyesno("PAYPAL_API_SANDBOX",$conf->global->PAYPAL_API_SANDBOX,1);
 print '</td></tr>';
 
 $var=!$var;
@@ -176,7 +176,7 @@ print '</td></tr>';
 /*$var=!$var;
 print '<tr '.$bc[$var].'><td>';
 print '<span class="fieldrequired">'.$langs->trans("PAYPAL_API_EXPRESS").'</span></td><td>';
-print Form::selectyesno("PAYPAL_API_EXPRESS",$conf->global->PAYPAL_API_EXPRESS);
+print $form->selectyesno("PAYPAL_API_EXPRESS",$conf->global->PAYPAL_API_EXPRESS);
 print '</td></tr>';
 */
 
@@ -197,7 +197,7 @@ print '</td></tr>';
 $var=!$var;
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("PAYPAL_ADD_PAYMENT_URL").'</td><td>';
-print Form::selectyesno("PAYPAL_ADD_PAYMENT_URL",$conf->global->PAYPAL_ADD_PAYMENT_URL,1);
+print $form->selectyesno("PAYPAL_ADD_PAYMENT_URL",$conf->global->PAYPAL_ADD_PAYMENT_URL,1);
 print '</td></tr>';
 
 $var=!$var;
@@ -238,7 +238,7 @@ print '</td></tr>';
 $var=!$var;
 print '<tr '.$bc[$var].'><td>';
 print $langs->trans("SecurityTokenIsUnique").'</td><td>';
-print Form::selectyesno("PAYPAL_SECURITY_TOKEN_UNIQUE",(empty($conf->global->PAYPAL_SECURITY_TOKEN)?0:$conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE),1);
+print $form->selectyesno("PAYPAL_SECURITY_TOKEN_UNIQUE",(empty($conf->global->PAYPAL_SECURITY_TOKEN)?0:$conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE),1);
 print '</td></tr>';
 
 print '</table>';
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index 85bc2f613554106b894e1e738f81d458e4303033..25e52079dc4e90761ee6da044b02934ab3d1204f 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -604,7 +604,7 @@ $var=!$var;
 print '<tr '.$bc[$var].'>';
 print '<td>'.$langs->trans("AssociatedProductsAbility").'</td>';
 print '<td width="60" align="right">';
-print Form::selectyesno("activate_sousproduits",$conf->global->PRODUIT_SOUSPRODUITS,1);
+print $form->selectyesno("activate_sousproduits",$conf->global->PRODUIT_SOUSPRODUITS,1);
 print '</td>';
 print '</tr>';
 
@@ -646,7 +646,7 @@ $var=!$var;
 print '<tr '.$bc[$var].'>';
 print '<td>'.$langs->trans("ViewProductDescInFormAbility").'</td>';
 print '<td width="60" align="right">';
-print Form::selectyesno("activate_viewProdDescInForm",$conf->global->PRODUIT_DESC_IN_FORM,1);
+print $form->selectyesno("activate_viewProdDescInForm",$conf->global->PRODUIT_DESC_IN_FORM,1);
 print '</td>';
 print '</tr>';
 
@@ -656,7 +656,7 @@ $var=!$var;
 print '<tr '.$bc[$var].'>';
 print '<td>'.$langs->trans("MergePropalProductCard").'</td>';
 print '<td width="60" align="right">';
-print Form::selectyesno("activate_mergePropalProductCard",$conf->global->PRODUIT_PDF_MERGE_PROPAL,1);
+print $form->selectyesno("activate_mergePropalProductCard",$conf->global->PRODUIT_PDF_MERGE_PROPAL,1);
 print '</td>';
 print '</tr>';
 */
@@ -667,7 +667,7 @@ $var=!$var;
 print '<tr '.$bc[$var].'>';
 print '<td>'.$langs->trans("UseUnits").'</td>';
 print '<td width="60" align="right">';
-print Form::selectyesno("activate_units",$conf->global->PRODUCT_USE_UNITS,1);
+print $form->selectyesno("activate_units",$conf->global->PRODUCT_USE_UNITS,1);
 print '</td>';
 print '</tr>';
 */
@@ -679,7 +679,7 @@ if (! empty($conf->global->MAIN_MULTILANGS))
 	print '<tr '.$bc[$var].'>';
 	print '<td>'.$langs->trans("ViewProductDescInThirdpartyLanguageAbility").'</td>';
 	print '<td width="60" align="right">';
-	print Form::selectyesno("activate_viewProdTextsInThirdpartyLanguage", (! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)?$conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE:0), 1);
+	print $form->selectyesno("activate_viewProdTextsInThirdpartyLanguage", (! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)?$conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE:0), 1);
 	print '</td>';
 	print '</tr>';
 }
diff --git a/htdocs/product/canvas/product/actions_card_product.class.php b/htdocs/product/canvas/product/actions_card_product.class.php
index 2efe4280ac7503b1665dc329204f6c72f6eb62c7..e32d31122dc7de0a86593535f3a716819c5d01b8 100644
--- a/htdocs/product/canvas/product/actions_card_product.class.php
+++ b/htdocs/product/canvas/product/actions_card_product.class.php
@@ -140,7 +140,7 @@ class ActionsCardProduct
 		{
             $head = product_prepare_head($this->object);
 
-            $this->tpl['showrefnav'] = Form::showrefnav($this->object,'ref','',1,'ref');
+            $this->tpl['showrefnav'] = $form->showrefnav($this->object,'ref','',1,'ref');
 
     		$titre=$langs->trans("CardProduct".$this->object->type);
     		$picto=($this->object->type==Product::TYPE_SERVICE?'service':'product');
@@ -148,12 +148,12 @@ class ActionsCardProduct
             $this->tpl['showend']=dol_get_fiche_end();
 
             // Accountancy buy code
-			$this->tpl['accountancyBuyCodeKey'] = Form::editfieldkey("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
-			$this->tpl['accountancyBuyCodeVal'] = Form::editfieldval("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
+			$this->tpl['accountancyBuyCodeKey'] = $form->editfieldkey("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
+			$this->tpl['accountancyBuyCodeVal'] = $form->editfieldval("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
 
 			// Accountancy sell code
-			$this->tpl['accountancySellCodeKey'] = Form::editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
-			$this->tpl['accountancySellCodeVal'] = Form::editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
+			$this->tpl['accountancySellCodeKey'] = $form->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
+			$this->tpl['accountancySellCodeVal'] = $form->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
 		}
 
 		$this->tpl['finished'] = $this->object->finished;
diff --git a/htdocs/product/canvas/product/tpl/list.tpl.php b/htdocs/product/canvas/product/tpl/list.tpl.php
index 2b4cadd7521fe3e64cf551ff4ccab9ee33d7c3dd..e57fd5adfabf1b7e4b22cf9b22e27ade5d8484d2 100644
--- a/htdocs/product/canvas/product/tpl/list.tpl.php
+++ b/htdocs/product/canvas/product/tpl/list.tpl.php
@@ -71,7 +71,7 @@
   				<td class="liste_titre" align="<?php echo $searchfield['align']; ?>"><input class="flat" type="text" name="s<?php echo $searchfield['alias']; ?>" value=""></td>
 	<?php } else if ($key == $num) { 
         print '<td class="liste_titre" align="right">';
-        $searchpitco=Form::showFilterAndCheckAddButtons();
+        $searchpitco=$form->showFilterAndCheckAddButtons(0);
         print $searchpitco;
         print '</td>';
 	} else { ?>
diff --git a/htdocs/product/canvas/service/actions_card_service.class.php b/htdocs/product/canvas/service/actions_card_service.class.php
index 04f37db5bc6752b1dd2220217c89f4348d3d5ac1..7bc04ecb42a5d312d08837d86b4e0d27fc297603 100644
--- a/htdocs/product/canvas/service/actions_card_service.class.php
+++ b/htdocs/product/canvas/service/actions_card_service.class.php
@@ -139,7 +139,7 @@ class ActionsCardService
 		{
             $head = product_prepare_head($this->object);
 
-            $this->tpl['showrefnav'] = Form::showrefnav($this->object,'ref','',1,'ref');
+            $this->tpl['showrefnav'] = $form->showrefnav($this->object,'ref','',1,'ref');
 
     		$titre=$langs->trans("CardProduct".$this->object->type);
     		$picto=($this->object->type==Product::TYPE_SERVICE?'service':'product');
@@ -147,12 +147,12 @@ class ActionsCardService
             $this->tpl['showend']=dol_get_fiche_end();
 
 			// Accountancy buy code
-			$this->tpl['accountancyBuyCodeKey'] = Form::editfieldkey("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
-			$this->tpl['accountancyBuyCodeVal'] = Form::editfieldval("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
+			$this->tpl['accountancyBuyCodeKey'] = $form->editfieldkey("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
+			$this->tpl['accountancyBuyCodeVal'] = $form->editfieldval("ProductAccountancyBuyCode",'productaccountancycodesell',$this->accountancy_code_sell,$this,$user->rights->produit->creer);
 
 			// Accountancy sell code
-			$this->tpl['accountancySellCodeKey'] = Form::editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
-			$this->tpl['accountancySellCodeVal'] = Form::editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
+			$this->tpl['accountancySellCodeKey'] = $form->editfieldkey("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
+			$this->tpl['accountancySellCodeVal'] = $form->editfieldval("ProductAccountancySellCode",'productaccountancycodebuy',$this->accountancy_code_buy,$this,$user->rights->produit->creer);
 		}
 
 		$this->tpl['finished'] = $this->object->finished;
diff --git a/htdocs/product/canvas/service/tpl/list.tpl.php b/htdocs/product/canvas/service/tpl/list.tpl.php
index 4d8005b64b706eadda23cf4da8346f9cc2585159..4fc875e15bfb9f3d6f8cc2d1b8d9792447c1f850 100644
--- a/htdocs/product/canvas/service/tpl/list.tpl.php
+++ b/htdocs/product/canvas/service/tpl/list.tpl.php
@@ -71,7 +71,7 @@
   				<td class="liste_titre" align="<?php echo $searchfield['align']; ?>"><input class="flat" type="text" name="s<?php echo $searchfield['alias']; ?>" value=""></td>
 	<?php } else if ($key == $num) { 	
         print '<td class="liste_titre" align="right">';
-        $searchpitco=Form::showFilterAndCheckAddButtons();
+        $searchpitco=$form->showFilterAndCheckAddButtons(0);
         print $searchpitco;
         print '</td>';
  			} else { ?>
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 63dbe9f38465c4d37bcbf5cf6fc7990ce2f07b6e..ef126a85b52ae4a6fe184a36d2953aa0f2abb5a8 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1424,8 +1424,8 @@ else
             {
             	// TODO change for compatibility with edit in place
             	$typeformat='select;0:'.$langs->trans("Product").',1:'.$langs->trans("Service");
-                print '<tr><td class="titlefield">'.Form::editfieldkey("Type",'fk_product_type',$object->type,$object,$user->rights->produit->creer||$user->rights->service->creer,$typeformat).'</td><td colspan="2">';
-                print Form::editfieldval("Type",'fk_product_type',$object->type,$object,$user->rights->produit->creer||$user->rights->service->creer,$typeformat);
+                print '<tr><td class="titlefield">'.$form->editfieldkey("Type",'fk_product_type',$object->type,$object,$user->rights->produit->creer||$user->rights->service->creer,$typeformat).'</td><td colspan="2">';
+                print $form->editfieldval("Type",'fk_product_type',$object->type,$object,$user->rights->produit->creer||$user->rights->service->creer,$typeformat);
                 print '</td></tr>';
             }
 
@@ -1705,14 +1705,14 @@ $formquestionclone=array(
 if (($action == 'delete' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile)))	// Output when action = clone if jmobile or no js
 	|| (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)))							// Always output when not jmobile nor js
 {
-    print Form::formconfirm("card.php?id=".$object->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,"action-delete");
+    print $form->formconfirm("card.php?id=".$object->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,"action-delete");
 }
 
 // Clone confirmation
 if (($action == 'clone' && (empty($conf->use_javascript_ajax) || ! empty($conf->dol_use_jmobile)))		// Output when action = clone if jmobile or no js
 	|| (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)))							// Always output when not jmobile nor js
 {
-    print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestionclone,'yes','action-clone',250,600);
+    print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestionclone,'yes','action-clone',250,600);
 }
 
 
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index bf02129f653830f2d3ec547771c1cef84e63234f..9686c4683ae4f05bf1074ebb6ebf42dcf7e576d1 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -200,7 +200,7 @@ if ($id > 0 || ! empty($ref))
 
 			// Reference
 			print '<td width="25%">'.$langs->trans("Ref").'</td><td>';
-			print Form::showrefnav($object,'ref','',1,'ref');
+			print $form->showrefnav($object,'ref','',1,'ref');
 			print '</td>';
 
 		print '</tr>';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 7a83d3bd579f46ff6ad05cd0571bac9899e2a928..f5fc8c8655c43c40374717f5e9cf37628a1d1615 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -315,7 +315,7 @@ if ($id > 0 || $ref)
 			$text=$form->textwithpicto($langs->trans("CostPrice"), $textdesc, 1, 'help', '');
             print $form->editfieldkey($text,'cost_price',$object->cost_price,$object,$user->rights->produit->creer||$user->rights->service->creer,'amount:6');
             print '</td><td colspan="2">';
-            print Form::editfieldval($text,'cost_price',$object->cost_price,$object,$user->rights->produit->creer||$user->rights->service->creer,'amount:6');
+            print $form->editfieldval($text,'cost_price',$object->cost_price,$object,$user->rights->produit->creer||$user->rights->service->creer,'amount:6');
             print '</td></tr>';
             
 			print '</table>';
diff --git a/htdocs/product/list.php b/htdocs/product/list.php
index 32d35b33dff7dd14fffca45ed468375289abf5cc..55413f7ed1d025dc05ce42a140fcd0bcd4c3a647 100644
--- a/htdocs/product/list.php
+++ b/htdocs/product/list.php
@@ -507,7 +507,7 @@ else
     			print '</td>';
     		}
     		// To batch
-			if (! empty($arrayfields['p.tobatch']['checked'])) print '<td class="liste_titre center">'.Form::selectyesno($search_tobatch, '', '', '', 1).'</td>';
+			if (! empty($arrayfields['p.tobatch']['checked'])) print '<td class="liste_titre center">'.$form->selectyesno($search_tobatch, '', '', '', 1).'</td>';
     		// Stock
 			if (! empty($arrayfields['p.stock']['checked'])) print '<td class="liste_titre">&nbsp;</td>';
     	    // Accountancy code sell
@@ -551,7 +551,7 @@ else
 	            print '</td>';
     		}
             print '<td class="liste_titre" align="right">';
-            $searchpitco=Form::showFilterAndCheckAddButtons();
+            $searchpitco=$form->showFilterAndCheckAddButtons(0);
             print $searchpitco;
             print '</td>';
 
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index f94164feaaa346eb40ef7e26ac7cfc0c66184947..857a6634bf6d671097efb2372a447421bfcb5107 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -1650,7 +1650,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES))
     		print '<td colspan="8">&nbsp;</td>';
     		// Print the search button
             print '<td class="liste_titre" align="right">';
-            $searchpitco=Form::showFilterAndCheckAddButtons();
+            $searchpitco=$form->showFilterAndCheckAddButtons(0);
             print $searchpitco;
             print '</td>';
     		print '</tr>';
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index aec1ceb14f95779e3b5da2a388c2b298354738ee..27f85cd90abff9d173a7ce9919234b40c8a30655 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -280,7 +280,7 @@ if ($resql)
 	print '<td class="liste_titre">&nbsp;</td>';
 	print '<td class="liste_titre">&nbsp;</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print '</tr>';
diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php
index de297a1c12e9140217c0f816c9c20c3174f5bc67..3b77f9c5ba7e31d76f96cdce242b2a679b009e05 100644
--- a/htdocs/product/reassortlot.php
+++ b/htdocs/product/reassortlot.php
@@ -293,7 +293,7 @@ if ($resql)
 	print '<td class="liste_titre">&nbsp;</td>';
 	print '<td class="liste_titre">&nbsp;</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	print '</tr>';
diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php
index b2ad9faae7b36535d4e37fdb06efe1d1de61a523..80d8bea62f757a3bc232ae7214e7f3fe89a0237a 100644
--- a/htdocs/product/stock/card.php
+++ b/htdocs/product/stock/card.php
@@ -255,7 +255,7 @@ else
 			// Confirm delete third party
 			if ($action == 'delete')
 			{
-				print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2);
+				print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAWarehouse"),$langs->trans("ConfirmDeleteWarehouse",$object->libelle),"confirm_delete",'',0,2);
 			}
 
 			print '<table class="border" width="100%">';
@@ -264,7 +264,7 @@ else
 
 			// Ref
 			print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-			print Form::showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle');
+			print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'libelle');
 			print '</td>';
 
 			print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$object->lieu.'</td></tr>';
diff --git a/htdocs/product/stock/fiche-valo.php b/htdocs/product/stock/fiche-valo.php
index aa74d3c9113339a52bd3a8906e31b879748b7c4b..8add246afa2adcf3f1d843c65611f57ec3cc7570 100644
--- a/htdocs/product/stock/fiche-valo.php
+++ b/htdocs/product/stock/fiche-valo.php
@@ -65,7 +65,7 @@ if ($_GET["id"])
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-	print Form::showrefnav($entrepot,'id','',1,'rowid','libelle');
+	print $form->showrefnav($entrepot,'id','',1,'rowid','libelle');
 	print '</td>';
 
 	print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php
index 78d09ea8a6b894564c3b58e7819cd87e5b4cb829..58f95625d949fff46a9da434151fd55eaf32cba6 100644
--- a/htdocs/product/stock/list.php
+++ b/htdocs/product/stock/list.php
@@ -157,7 +157,7 @@ if ($result)
 	print '</td>';
 
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 23a9e4074a1460c7ebfe64d07da6bc74dfa69750..190bf676c8a62ab75e209613f651fee92e1825ed 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -428,7 +428,7 @@ if ($resql)
 
         // Ref
         print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
-        print Form::showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle');
+        print $form->showrefnav($entrepot, 'id', $linkback, 1, 'rowid', 'libelle');
         print '</td>';
 
         print '<tr><td>'.$langs->trans("LocationSummary").'</td><td colspan="3">'.$entrepot->lieu.'</td></tr>';
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index bc297d081189295a042c8ff393045b3c45ce3186..42fadf549230fe05da2f6be649480c174e874dd3 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -471,13 +471,13 @@ if ($id > 0 || $ref)
 		}
 
         // Stock alert threshold
-        print '<tr><td>'.Form::editfieldkey("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).'</td><td colspan="2">';
-        print Form::editfieldval("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer);
+        print '<tr><td>'.$form->editfieldkey("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer).'</td><td colspan="2">';
+        print $form->editfieldval("StockLimit",'stocklimit',$object->seuil_stock_alerte,$object,$user->rights->produit->creer);
         print '</td></tr>';
 
         // Desired stock
-        print '<tr><td>'.Form::editfieldkey("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer).'</td><td colspan="2">';
-        print Form::editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer);
+        print '<tr><td>'.$form->editfieldkey("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer).'</td><td colspan="2">';
+        print $form->editfieldval("DesiredStock",'desiredstock',$object->desiredstock,$object,$user->rights->produit->creer);
         print '</td></tr>';
 
         // Real stock
@@ -737,10 +737,10 @@ if ($resql)
 			        print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST"><input type="hidden" name="pdluoid" value="'.$pdluo->id.'"><input type="hidden" name="action" value="updateline"><input type="hidden" name="id" value="'.$id.'"><table class="noborder" width="100%"><tr><td width="10%"></td>';
 			        print '<td align="right" width="10%"><input type="text" name="batch_number" value="'.$pdluo->batch.'"></td>';
 			        print '<td align="center" width="10%">';
-			        Form::selectDate($pdluo->eatby,'eatby','','',1,'',1,0,1);
+			        $form->select_date($pdluo->eatby,'eatby','','',1,'',1,0,1);
 			        print '</td>';
 			        print '<td align="center" width="10%">';
-			        Form::selectDate($pdluo->sellby,'sellby','','',1,'',1,0,1);
+			        $form->select_date($pdluo->sellby,'sellby','','',1,'',1,0,1);
 			        print '</td>';
 			        print '<td align="right" width="10%">'.$pdluo->qty.($pdluo->qty<0?' '.img_warning():'').'</td>';
 			        print '<td colspan="4"><input type="submit" class="button" id="savelinebutton" name="save" value="'.$langs->trans("Save").'">';
diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index bb21c3aa285ff4e16ad84f01ff49559654ba960c..c31699a12ef8b4e2a88de985dd2a2d6ded35fff3 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -472,7 +472,7 @@ print '<td class="liste_titre">&nbsp;</td>'.
 	'<td class="liste_titre" align="right">&nbsp;</td>'.
 	'<td class="liste_titre">&nbsp;</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 print '</tr>';
diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php
index a5255d4a1bedd8fccb0c08dc80a741129d8d003f..785760ef5111c69e8068069ae2027fb9069a001f 100644
--- a/htdocs/product/stock/replenishorders.php
+++ b/htdocs/product/stock/replenishorders.php
@@ -239,7 +239,7 @@ if ($resql)
          '<input type="text" class="flat" name="search_ttc" value="' . $sttc . '">'.
          '</td>'.
          '<td class="liste_titre">'.
-         Form::selectDate('', 'search_date', 0, 0, 1, '', 1, 0, 1, 0, '').
+         $form->select_date('', 'search_date', 0, 0, 1, '', 1, 0, 1, 0, '').
          '</td>'.
          '<td class="liste_titre" align="right">';
     $src = DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png';
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 63833c3a9b1ca587b4d97e4de5a6dd3eb5148acb..d9f02781fd55e5c08258861522d56339a98ca0c0 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -93,12 +93,12 @@
 			print '</tr><tr>';
 			print '<td colspan="2">'.$langs->trans("l_eatby").'</td><td>';
 			$eatbyselected=dol_mktime(0, 0, 0, GETPOST('eatbymonth'), GETPOST('eatbyday'), GETPOST('eatbyyear'));
-			Form::selectDate($eatbyselected,'eatby','','',1,"");
+			$form->select_date($eatbyselected,'eatby','','',1,"");
 			print '</td>';
 			print '<td></td>';
 			print '<td>'.$langs->trans("l_sellby").'</td><td>';
 			$sellbyselected=dol_mktime(0, 0, 0, GETPOST('sellbymonth'), GETPOST('sellbyday'), GETPOST('sellbyyear'));
-			Form::selectDate($sellbyselected,'sellby','','',1,"");
+			$form->select_date($sellbyselected,'sellby','','',1,"");
 			print '</td>';
 			print '</tr>';
 		}
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index b54796c8a320007b7b3739b641a8e5d8c67a12b9..1c0448192f1c2404a65b4499f7480d8ef19837c3 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -92,10 +92,10 @@
 			print '</td>';
 			print '</tr><tr>';
 			print '<td>'.$langs->trans("l_eatby").'</td><td>';
-			print Form::selectDate(($d_eatby?$d_eatby:$pdluo->eatby),'eatby','','',1,"", 1, 0, 1, ($pdluoid > 0 ? 1 : 0));		// If form was opened for a specific pdluoid, field is disabled
+			print $form->select_date(($d_eatby?$d_eatby:$pdluo->eatby),'eatby','','',1,"", 1, 0, 1, ($pdluoid > 0 ? 1 : 0));		// If form was opened for a specific pdluoid, field is disabled
 			print '</td>';
 			print '<td>'.$langs->trans("l_sellby").'</td><td>';
-			print Form::selectDate(($d_sellby?$d_sellby:$pdluo->sellby),'sellby','','',1,"", 1, 0, 1, ($pdluoid > 0 ? 1 : 0));		// If form was opened for a specific pdluoid, field is disabled
+			print $form->select_date(($d_sellby?$d_sellby:$pdluo->sellby),'sellby','','',1,"", 1, 0, 1, ($pdluoid > 0 ? 1 : 0));		// If form was opened for a specific pdluoid, field is disabled
 			print '</td>';
 			print '<td colspan="2"></td>';
 			print '</tr>';
diff --git a/htdocs/projet/activity/perday.php b/htdocs/projet/activity/perday.php
index 3902ef3f93a04e057491d51a3ba1f6a1d9a75a91..7e23fe123d0d6f8d3a29896c336d754986de3b50 100644
--- a/htdocs/projet/activity/perday.php
+++ b/htdocs/projet/activity/perday.php
@@ -296,7 +296,7 @@ $nav ="<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_
 $nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$month,$day,$year),"day")." </span>\n";
 $nav.="<a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
 $nav.=" &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
-$nav.='<br>'.Form::selectDate(-1,'',0,0,2,"addtime",1,0,1).' ';
+$nav.='<br>'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
 $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
 
 $picto='calendarweek';
diff --git a/htdocs/projet/activity/perweek.php b/htdocs/projet/activity/perweek.php
index 33d4c9aba4cefcc20e336768025ec35f3fdc38cc..57da487aee0f84455df43fc04cd5e6b8e7646114 100644
--- a/htdocs/projet/activity/perweek.php
+++ b/htdocs/projet/activity/perweek.php
@@ -274,7 +274,7 @@ $nav ="<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_
 $nav.=" <span id=\"month_name\">".dol_print_date(dol_mktime(0,0,0,$first_month,$first_day,$first_year),"%Y").", ".$langs->trans("Week")." ".$week." </span>\n";
 $nav.="<a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\">".img_next($langs->trans("Next"))."</a>\n";
 $nav.=" &nbsp; (<a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a>)";
-$nav.='<br>'.Form::selectDate(-1,'',0,0,2,"addtime",1,0,1).' ';
+$nav.='<br>'.$form->select_date(-1,'',0,0,2,"addtime",1,0,1).' ';
 $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
 
 $picto='calendarweek';
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index 3f2eddd577f9a498492361e9c1d1663764ce8a25..ca351f7d1bbc55a033066739aeabf96866c0127c 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -344,7 +344,7 @@ print '<td width="60" align="right">';
 $arrval=array('0'=>$langs->trans("No"),
 	'1'=>$langs->trans("Yes"),
 );
-print Form::selectyesno('PROJECT_USE_OPPORTUNITIES', $conf->global->PROJECT_USE_OPPORTUNITIES, 1);
+print $form->selectyesno('PROJECT_USE_OPPORTUNITIES', $conf->global->PROJECT_USE_OPPORTUNITIES, 1);
 print '</td><td align="right">';
 print '<input type="submit" class="button" name="modifyPROJECT_USE_OPPORTUNITIES" value="'.$langs->trans("Modify").'">';
 print "</td>";
@@ -357,7 +357,7 @@ print '<td width="60" align="right">';
 $arrval=array('0'=>$langs->trans("No"),
 	'1'=>$langs->trans("Yes"),
 );
-print Form::selectyesno('PROJECT_USE_TASKS', empty($conf->global->PROJECT_HIDE_TASKS)?1:0, 1);
+print $form->selectyesno('PROJECT_USE_TASKS', empty($conf->global->PROJECT_HIDE_TASKS)?1:0, 1);
 print '</td><td align="right">';
 print '<input type="submit" class="button" name="modifyPROJECT_USE_TASKS" value="'.$langs->trans("Modify").'">';
 print "</td>";
diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php
index fdb0e2cb00946d07d2574d2f9dbb2149ffd8985b..51b3477b2481c9b074aed027e0d18bb7e017bf97 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -492,12 +492,12 @@ if ($action == 'create' && $user->rights->projet->creer)
 
     // Date start
     print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-    print Form::selectDate(($date_start?$date_start:''),'projectstart',0,0,0,'',1,0,1);
+    print $form->select_date(($date_start?$date_start:''),'projectstart',0,0,0,'',1,0,1);
     print '</td></tr>';
 
     // Date end
     print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
-    print Form::selectDate(($date_end?$date_end:-1),'projectend',0,0,0,'',1,0,1);
+    print $form->select_date(($date_end?$date_end:-1),'projectend',0,0,0,'',1,0,1);
     print '</td></tr>';
 
     if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
@@ -590,17 +590,17 @@ else
     // Confirmation validation
     if ($action == 'validate')
     {
-        print Form::formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate','',0,1);
+        print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateProject'), $langs->trans('ConfirmValidateProject'), 'confirm_validate','',0,1);
     }
     // Confirmation close
     if ($action == 'close')
     {
-        print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CloseAProject"),$langs->trans("ConfirmCloseAProject"),"confirm_close",'','',1);
+        print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("CloseAProject"),$langs->trans("ConfirmCloseAProject"),"confirm_close",'','',1);
     }
     // Confirmation reopen
     if ($action == 'reopen')
     {
-        print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ReOpenAProject"),$langs->trans("ConfirmReOpenAProject"),"confirm_reopen",'','',1);
+        print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("ReOpenAProject"),$langs->trans("ConfirmReOpenAProject"),"confirm_reopen",'','',1);
     }
     // Confirmation delete
     if ($action == 'delete')
@@ -610,7 +610,7 @@ else
         $taskarray=$task->getTasksArray(0,0,$object->id,0,0);
         $nboftask=count($taskarray);
         if ($nboftask) $text.='<br>'.img_warning().' '.$langs->trans("ThisWillAlsoRemoveTasks",$nboftask);
-        print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1);
+        print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAProject"),$text,"confirm_delete",'','',1);
     }
 
     // Clone confirmation
@@ -626,7 +626,7 @@ else
         	array('type' => 'checkbox', 'name' => 'clone_task_files',	'label' => $langs->trans("CloneTaskFiles"),         'value' => false)
         );
 
-        print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240);
+        print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("CloneProject"), $langs->trans("ConfirmCloneProject"), "confirm_clone", $formquestion, '', 1, 240);
     }
 
 
@@ -676,7 +676,7 @@ else
 
         // Date start
         print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-        print Form::selectDate($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1);
+        print $form->select_date($object->date_start?$object->date_start:-1,'projectstart',0,0,0,'',1,0,1);
         print ' &nbsp; &nbsp; <input type="checkbox" name="reportdate" value="yes" ';
         if ($comefromclone){print ' checked ';}
 		print '/> '. $langs->trans("ProjectReportDate");
@@ -684,7 +684,7 @@ else
 
         // Date end
         print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
-        print Form::selectDate($object->date_end?$object->date_end:-1,'projectend',0,0,0,'',1,0,1);
+        print $form->select_date($object->date_end?$object->date_end:-1,'projectend',0,0,0,'',1,0,1);
         print '</td></tr>';
 
     	if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
@@ -742,7 +742,7 @@ else
             $objectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
             $object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
         }
-        print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+        print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
         print '</td></tr>';
 
         // Label
diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php
index 1ed682fe1862a02f4ce9f6c77adb72c5a043f021..ebfad425cf8de395ce7750e49a382973d0fff2a2 100644
--- a/htdocs/projet/contact.php
+++ b/htdocs/projet/contact.php
@@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref))
 		$objectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
 		$object->next_prev_filter=" rowid in (".(count($objectsListId)?join(',',array_keys($objectsListId)):'0').")";
 	}
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 	print '</td></tr>';
 
 	// Label
diff --git a/htdocs/projet/document.php b/htdocs/projet/document.php
index 8385c07b250c58edda392db3963ea3108df0d1bc..ce033f0e1937c57558c45bbd1d9f275a14ac8e1c 100644
--- a/htdocs/projet/document.php
+++ b/htdocs/projet/document.php
@@ -118,7 +118,7 @@ if ($object->id > 0)
         $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
         $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
     }
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td></tr>';
 
 	// Label
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index f2b5c2b880aae24a9cd5f4a7e1eab626caafbca7..30a8f87a4fa2f35192dae1816c1ef4c9447e9a47 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -128,7 +128,7 @@ if (! $user->rights->projet->all->lire)
     $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
     $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 }
-print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 print '</td></tr>';
 
 print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->title.'</td></tr>';
@@ -324,10 +324,10 @@ if (! $showdatefilter)
 	print '<input type="hidden" name="action" value="view">';
 	print '<table><tr>';
 	print '<td>'.$langs->trans("From").' ';
-	print Form::selectDate($dates,'dates',0,0,1,'',1,0,1);
+	print $form->select_date($dates,'dates',0,0,1,'',1,0,1);
 	print '</td>';
 	print '<td>'.$langs->trans("to").' ';
-	print Form::selectDate($datee,'datee',0,0,1,'',1,0,1);
+	print $form->select_date($datee,'datee',0,0,1,'',1,0,1);
 	print '</td>';
 	print '<td>';
 	print '<input type="submit" name="refresh" value="'.$langs->trans("Refresh").'" class="button">';
diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php
index fa8f5ff8b2631273df432960fcef8efce8c084a0..091059d76e3d9e61d6367d77b3d601563e48f1b8 100644
--- a/htdocs/projet/ganttview.php
+++ b/htdocs/projet/ganttview.php
@@ -112,7 +112,7 @@ if ($id > 0 || ! empty($ref))
         $projectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
         $object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
     }
-    print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param);
+    print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param);
     print '</td></tr>';
 
     print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->title.'</td></tr>';
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 6279ba8f041824988e775389bd188df8e619afb8..627bb67ff539f8c54097b25022b5a911bd44fef6 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -516,7 +516,7 @@ if ($resql)
     }
     // Action column
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 
diff --git a/htdocs/projet/note.php b/htdocs/projet/note.php
index a6815804474269e34288346262af43c29300090b..45c4cffd65bc7d39bc58e3faa41d152f4e9edc6a 100644
--- a/htdocs/projet/note.php
+++ b/htdocs/projet/note.php
@@ -91,7 +91,7 @@ if ($id > 0 || ! empty($ref))
 		$projectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
 		$object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 	}
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref');
 	print '</td></tr>';
 
 	// Label
diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php
index 18f779575bb7d34ef31540258f777f8879fca250..434b8e798860c86e88252d8fdf96bf11e496da22 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -218,7 +218,7 @@ if ($id > 0 || ! empty($ref))
 		$projectsListId = $object->getProjectsAuthorizedForUser($user,0,0);
 		$object->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 	}
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param);
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '', $param);
 	print '</td></tr>';
 
 	print '<tr><td>'.$langs->trans("Label").'</td><td>'.$object->title.'</td></tr>';
@@ -317,12 +317,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
 
 	// Date start
 	print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-	print Form::selectDate(($date_start?$date_start:''),'dateo',1,1,0,'',1,1,1);
+	print $form->select_date(($date_start?$date_start:''),'dateo',1,1,0,'',1,1,1);
 	print '</td></tr>';
 
 	// Date end
 	print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
-	print Form::selectDate(($date_end?$date_end:-1),'datee',1,1,0,'',1,1,1);
+	print $form->select_date(($date_end?$date_end:-1),'datee',1,1,0,'',1,1,1);
 	print '</td></tr>';
 
 	// planned workload
diff --git a/htdocs/projet/tasks/contact.php b/htdocs/projet/tasks/contact.php
index 1fdf7c55833b1f9c25d8c1b1071a18f54a5d1cd9..0faf21c1cc23e515753b289b33ff87430370d189 100644
--- a/htdocs/projet/tasks/contact.php
+++ b/htdocs/projet/tasks/contact.php
@@ -203,7 +203,7 @@ if ($id > 0 || ! empty($ref))
     		    $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0);
     		    $projectstatic->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
     		}
-    		print Form::showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
+    		print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
     		print '</td></tr>';
 
     		print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
@@ -262,7 +262,7 @@ if ($id > 0 || ! empty($ref))
 		    $object->next_prev_filter=" fk_projet in (".$projectsListId.")";
 		}
 		else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
-		print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
+		print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
 		print '</td></tr>';
 
 		// Label
diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php
index 83ba3b2a27a3fda74b49d6a7268af7f3e8ca13fd..97a09ad1f87b8294714d10728c87378a5c36321b 100644
--- a/htdocs/projet/tasks/document.php
+++ b/htdocs/projet/tasks/document.php
@@ -146,7 +146,7 @@ if ($object->id > 0)
 			$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0);
 			$projectstatic->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 		}
-		print Form::showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
+		print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
 		print '</td></tr>';
 
 		print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
@@ -207,7 +207,7 @@ if ($object->id > 0)
 		$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
 	}
 	else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
-	print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
+	print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
 	print '</td>';
 	print '</tr>';
 
diff --git a/htdocs/projet/tasks/list.php b/htdocs/projet/tasks/list.php
index 374964ed5d9b269e08203f97baff4c1c15b2e2a5..d258dbb1e38933ca80962b5e39ab6e1355efcd75 100644
--- a/htdocs/projet/tasks/list.php
+++ b/htdocs/projet/tasks/list.php
@@ -505,7 +505,7 @@ if ($resql)
     }
     // Action column
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     print '</tr>';
diff --git a/htdocs/projet/tasks/note.php b/htdocs/projet/tasks/note.php
index 91b9f4214e1258ee2ffb0306d109eae994f50f05..e62e58df58ba50cfb2062b6c1978147301d3fb0b 100644
--- a/htdocs/projet/tasks/note.php
+++ b/htdocs/projet/tasks/note.php
@@ -126,7 +126,7 @@ if ($object->id > 0)
 		    $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0);
 		    $projectstatic->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 		}
-		print Form::showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
+		print $form->showrefnav($projectstatic,'project_ref','',1,'ref','ref','',$param.'&withproject=1');
 		print '</td></tr>';
 
 		// Project
@@ -179,7 +179,7 @@ if ($object->id > 0)
 	    $object->next_prev_filter=" fk_projet in (".$projectsListId.")";
 	}
 	else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
-	print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
+	print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
 	print '</td></tr>';
 
 	// Label
diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php
index 46693e8de0d7a45205017601d74994ebb8c972f5..1a3b1921713f2de8535823b9a8329745a8949288 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -232,7 +232,7 @@ if ($id > 0 || ! empty($ref))
 				$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0);
 				$projectstatic->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 			}
-			print Form::showrefnav($projectstatic,'project_ref',$linkback,1,'ref','ref','',$param.'&withproject=1');
+			print $form->showrefnav($projectstatic,'project_ref',$linkback,1,'ref','ref','',$param.'&withproject=1');
 			print '</td></tr>';
 
 			print '<tr><td>'.$langs->trans("Label").'</td><td>'.$projectstatic->title.'</td></tr>';
@@ -338,12 +338,12 @@ if ($id > 0 || ! empty($ref))
 
 			// Date start
 			print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-			print Form::selectDate($object->date_start,'dateo',1,1,0,'',1,0,1);
+			print $form->select_date($object->date_start,'dateo',1,1,0,'',1,0,1);
 			print '</td></tr>';
 
 			// Date end
 			print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
-			print Form::selectDate($object->date_end?$object->date_end:-1,'datee',1,1,0,'',1,0,1);
+			print $form->select_date($object->date_end?$object->date_end:-1,'datee',1,1,0,'',1,0,1);
 			print '</td></tr>';
 
 			// Planned workload
@@ -393,7 +393,7 @@ if ($id > 0 || ! empty($ref))
 
 			if ($action == 'delete')
 			{
-				print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
+				print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"].'&withproject='.$withproject,$langs->trans("DeleteATask"),$langs->trans("ConfirmDeleteATask"),"confirm_delete");
 			}
 
 			print '<table class="border" width="100%">';
@@ -408,7 +408,7 @@ if ($id > 0 || ! empty($ref))
 				$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
 			}
 			else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
-			print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
+			print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
 			print '</td>';
 			print '</tr>';
 
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 7556edba158dad02375128227b3e3055a6701581..976e0013431cc7c21c526f75f5688627e7b42f55 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -259,7 +259,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
 				$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,0);
 				$projectstatic->next_prev_filter=" rowid in (".(count($projectsListId)?join(',',array_keys($projectsListId)):'0').")";
 			}
-			print Form::showrefnav($projectstatic,'project_ref',$linkback,1,'ref','ref','',$param.'&withproject=1');
+			print $form->showrefnav($projectstatic,'project_ref',$linkback,1,'ref','ref','',$param.'&withproject=1');
 			print '</td></tr>';
 
 			// Label
@@ -328,7 +328,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
 
 		if ($action == 'deleteline')
 		{
-			print Form::formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1);
+			print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id.'&lineid='.$_GET["lineid"].($withproject?'&withproject=1':''),$langs->trans("DeleteATimeSpent"),$langs->trans("ConfirmDeleteATimeSpent"),"confirm_delete",'','',1);
 		}
 
 		print '<table class="border" width="100%">';
@@ -346,7 +346,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
 			$object->next_prev_filter=" fk_projet in (".$projectsListId.")";
 		}
 		else $object->next_prev_filter=" fk_projet = ".$projectstatic->id;
-		print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
+		print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','',$param);
 		print '</td></tr>';
 
 		// Label
@@ -431,7 +431,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
 			print '<td class="nowrap">';
 			//$newdate=dol_mktime(12,0,0,$_POST["timemonth"],$_POST["timeday"],$_POST["timeyear"]);
 			$newdate='';
-			print Form::selectDate($newdate,'time',1,1,2,"timespent_date",1,0,1);
+			print $form->select_date($newdate,'time',1,1,2,"timespent_date",1,0,1);
 			print '</td>';
 
 			// Contributor
@@ -551,7 +551,7 @@ if (($id > 0 || ! empty($ref)) || $projectidforalltimes > 0)
 			print '<td class="nowrap">';
 			if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
 			{
-				print Form::selectDate(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1);
+				print $form->select_date(($date2?$date2:$date1),'timeline',1,1,2,"timespent_date",1,0,1);
 			}
 			else
 			{
diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php
index bf97b81d0b15d0f170f368607eefe889f8da7df3..2fb6fb61a91c23ea7fa5d59ffe51b020848a34aa 100644
--- a/htdocs/public/members/new.php
+++ b/htdocs/public/members/new.php
@@ -504,7 +504,7 @@ if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))
 }
 // Birthday
 print '<tr id="trbirth" class="trbirth"><td>'.$langs->trans("DateToBirth").'</td><td>';
-print Form::selectDate($birthday,'birth',0,0,1,"newmember",1,0,1);
+print $form->select_date($birthday,'birth',0,0,1,"newmember",1,0,1);
 print '</td></tr>'."\n";
 // Photo
 print '<tr><td>'.$langs->trans("URLPhoto").'</td><td><input type="text" name="photo" size="40" value="'.dol_escape_htmltag(GETPOST('photo')).'"></td></tr>'."\n";
diff --git a/htdocs/public/test/test_arrays.php b/htdocs/public/test/test_arrays.php
index 247783d55041b951450256091a5add51cedfed33..a6e08d025246e444516a38c49ac37f2353dedbb3 100644
--- a/htdocs/public/test/test_arrays.php
+++ b/htdocs/public/test/test_arrays.php
@@ -140,7 +140,7 @@ if ($showbirthday)  $nav.='<input type="hidden" name="showbirthday" value="1">';
 if ($pid)    $nav.='<input type="hidden" name="projectid" value="'.$pid.'">';
 if ($type)   $nav.='<input type="hidden" name="type" value="'.$type.'">';
 if ($usergroup) $nav.='<input type="hidden" name="usergroup" value="'.$usergroup.'">';
-$nav.=Form::selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
+$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
 $nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
 $nav.='</form>';
 
diff --git a/htdocs/public/test/test_forms.php b/htdocs/public/test/test_forms.php
index c126a4d0c14eadc5fe41fbfc4cac4e200f68eaf4..a697b371438566949db91fe18a3adb59e73777f2 100644
--- a/htdocs/public/test/test_forms.php
+++ b/htdocs/public/test/test_forms.php
@@ -26,24 +26,24 @@ This page is a sample of page using Dolibarr HTML widget methods. It is designed
 <?php
 $form=new Form($db);
 
-// Test1: form->selectDate using tzuser date
+// Test1: form->select_date using tzuser date
 print "Test 1: We must have here current hour for user (must match hour on browser). Note: Check your are logged so user TZ and DST are known.";
 $offsettz=(empty($_SESSION['dol_tz'])?0:$_SESSION['dol_tz'])*60*60;
 $offsetdst=(empty($_SESSION['dol_dst'])?0:$_SESSION['dol_dst'])*60*60;
 print " (dol_tz=".$offsettz." dol_dst=".$dol_dst.")<br>\n";
-Form::selectDate('', 'test1', 1, 1, 0);
+$form->select_date('', 'test1', 1, 1, 0);
 
 print '<br><br>'."\n";
 
-// Test2: form->selectDate using tzuser date
+// Test2: form->select_date using tzuser date
 print "Test 2: We must have here 1970-01-01 00:00:00 selected (fields can be empty)<br>\n";
-Form::selectDate(dol_get_first_day(1970,1,false), 'test2', 1, 1, 1);
+$form->select_date(dol_get_first_day(1970,1,false), 'test2', 1, 1, 1);
 
 print '<br><br>'."\n";
 
-// Test3: form->selectDate for 1970-01-01 00:00:00
+// Test3: form->select_date for 1970-01-01 00:00:00
 print "Test 3: We must have here 1970-01-01 00:00:00 selected (fields are mandatory)<br>\n";
-Form::selectDate(dol_get_first_day(1970,1,false), 'test3', 1, 1, 0);
+$form->select_date(dol_get_first_day(1970,1,false), 'test3', 1, 1, 0);
 
 print '<br><br>'."\n";
 
diff --git a/htdocs/resource/card.php b/htdocs/resource/card.php
index e3ab9ffb787f2467f70eeed8eb0254b49fedf8f5..31fb6a955b17b8c8d16a471bb9fcf02a4519d6d9 100644
--- a/htdocs/resource/card.php
+++ b/htdocs/resource/card.php
@@ -206,7 +206,7 @@ if ( $object->fetch($id) > 0 )
 		// Confirm deleting resource line
 	    if ($action == 'delete')
 	    {
-	        print Form::formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1);
+	        print $form->formconfirm("card.php?&id=".$id,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResource"),"confirm_delete_resource",'','',1);
 	    }
 
 
@@ -217,7 +217,7 @@ if ( $object->fetch($id) > 0 )
 
 		print '<tr><td style="width:35%">'.$langs->trans("ResourceFormLabel_ref").'</td><td>';
 		$linkback = $objet->ref.' <a href="list.php">'.$langs->trans("BackToList").'</a>';
-		print Form::showrefnav($object, 'id', $linkback,1,"rowid");
+		print $form->showrefnav($object, 'id', $linkback,1,"rowid");
 		print '</td>';
 		print '</tr>';
 
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index 7ff2eca718f352ebab9a70cb64549f5c9ebc8ee2..e4477e1674ad9f0386a610a1ed400af60652411f 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -175,7 +175,7 @@ else
 	// Confirmation suppression resource line
 	if ($action == 'delete_resource')
 	{
-		print Form::formconfirm("element_resource.php?element=".$element."&element_id=".$element_id."&id=".$id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_linked_resource",'','',1);
+		print $form->formconfirm("element_resource.php?element=".$element."&element_id=".$element_id."&id=".$id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_linked_resource",'','',1);
 	}
 
 
@@ -201,7 +201,7 @@ else
 
 			// Ref
 			print '<tr><td width="30%">'.$langs->trans("Ref").'</td><td colspan="3">';
-			print Form::showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
+			print $form->showrefnav($act, 'id', $linkback, ($user->societe_id?0:1), 'id', 'ref', '');
 			print '</td></tr>';
 
 			// Type
diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php
index 29de48b6916dbaefc38cfca455e7dc1c41cfe7c3..9bfa7309167237447cadc4883c216e4da97951e5 100644
--- a/htdocs/resource/list.php
+++ b/htdocs/resource/list.php
@@ -86,7 +86,7 @@ llxHeader('',$pagetitle,'');
 // Confirmation suppression resource line
 if ($action == 'delete_resource')
 {
-	print Form::formconfirm($_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_resource",'','',1);
+	print $form->formconfirm($_SERVER['PHP_SELF']."?element=".$element."&element_id=".$element_id."&lineid=".$lineid,$langs->trans("DeleteResource"),$langs->trans("ConfirmDeleteResourceElement"),"confirm_delete_resource",'','',1);
 }
 
 // Load object list
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index d2d0e3b615fa5997e9cce230a034043e2f6accc9..782a7f070c440755e88399e183a6269b29e4eff4 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -475,7 +475,7 @@ abstract class ActionsCardCommon
             	if ($modCodeFournisseur->code_auto) $this->tpl['prefix_suppliercode'] = $modCodeFournisseur->verif_prefixIsUsed();
 
             	// Supplier
-            	$this->tpl['yn_supplier'] = Form::selectyesno("fournisseur",$this->object->fournisseur,1);
+            	$this->tpl['yn_supplier'] = $form->selectyesno("fournisseur",$this->object->fournisseur,1);
             	$this->tpl['suppliercode'] = $this->object->code_fournisseur;
             	if ((!$this->object->code_fournisseur || $this->object->code_fournisseur == -1) && $modCodeFournisseur->code_auto) $this->tpl['suppliercode'] = $modCodeFournisseur->getNextValue($this->object,1);
             	$this->tpl['ismodifiable_suppliercode'] = $this->object->codefournisseur_modifiable();
@@ -508,7 +508,7 @@ abstract class ActionsCardCommon
             if (! empty($conf->global->MAIN_MULTILANGS)) $this->tpl['select_lang'] = $formadmin->select_language(($this->object->default_lang?$this->object->default_lang:$conf->global->MAIN_LANG_DEFAULT),'default_lang',0,0,1);
 
             // VAT
-            $this->tpl['yn_assujtva'] = Form::selectyesno('assujtva_value',$this->tpl['tva_assuj'],1);	// Assujeti par defaut en creation
+            $this->tpl['yn_assujtva'] = $form->selectyesno('assujtva_value',$this->tpl['tva_assuj'],1);	// Assujeti par defaut en creation
 
             // Select users
             $this->tpl['select_users'] = $form->select_dolusers($this->object->commercial_id, 'commercial_id', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
@@ -522,21 +522,21 @@ abstract class ActionsCardCommon
                 if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
                 {
                     $this->tpl['localtax'].= '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td>';
-                    $this->tpl['localtax'].= Form::selectyesno('localtax1assuj_value',$this->object->localtax1_assuj,1);
+                    $this->tpl['localtax'].= $form->selectyesno('localtax1assuj_value',$this->object->localtax1_assuj,1);
                     $this->tpl['localtax'].= '</td><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td>';
-                    $this->tpl['localtax'].= Form::selectyesno('localtax2assuj_value',$this->object->localtax1_assuj,1);
+                    $this->tpl['localtax'].= $form->selectyesno('localtax2assuj_value',$this->object->localtax1_assuj,1);
                     $this->tpl['localtax'].= '</td></tr>';
                 }
                 elseif($mysoc->localtax1_assuj=="1")
                 {
                     $this->tpl['localtax'].= '<tr><td>'.$langs->trans("LocalTax1IsUsedES").'</td><td colspan="3">';
-                    $this->tpl['localtax'].= Form::selectyesno('localtax1assuj_value',$this->object->localtax1_assuj,1);
+                    $this->tpl['localtax'].= $form->selectyesno('localtax1assuj_value',$this->object->localtax1_assuj,1);
                     $this->tpl['localtax'].= '</td><tr>';
                 }
                 elseif($mysoc->localtax2_assuj=="1")
                 {
                     $this->tpl['localtax'].= '<tr><td>'.$langs->trans("LocalTax2IsUsedES").'</td><td colspan="3">';
-                    $this->tpl['localtax'].= Form::selectyesno('localtax2assuj_value',$this->object->localtax1_assuj,1);
+                    $this->tpl['localtax'].= $form->selectyesno('localtax2assuj_value',$this->object->localtax1_assuj,1);
                     $this->tpl['localtax'].= '</td><tr>';
                 }
             }
@@ -549,7 +549,7 @@ abstract class ActionsCardCommon
             $this->tpl['showhead']=dol_get_fiche_head($head, 'card', '', 0, 'company');
             $this->tpl['showend']=dol_get_fiche_end();
 
-            $this->tpl['showrefnav'] 		= Form::showrefnav($this->object,'socid','',($user->societe_id?0:1),'rowid','nom');
+            $this->tpl['showrefnav'] 		= $form->showrefnav($this->object,'socid','',($user->societe_id?0:1),'rowid','nom');
 
             $this->tpl['checkcustomercode'] = $this->object->check_codeclient();
             $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur();
diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php
index abecf82bb9ce03944cda9c2b6e5518ebcf93ed0c..19f9a2fbdb80551b8b08ea96d6cef59d539819fa 100644
--- a/htdocs/societe/canvas/company/actions_card_company.class.php
+++ b/htdocs/societe/canvas/company/actions_card_company.class.php
@@ -163,7 +163,7 @@ class ActionsCardCompany extends ActionsCardCommon
 			// Confirm delete third party
 			if ($action == 'delete')
 			{
-				$this->tpl['action_delete'] = Form::formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"1,action-delete");
+				$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"1,action-delete");
 			}
 
 			for ($i=1; $i<=4; $i++)
diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php
index d4db225fde58d00f7068266bd647a8b5621daead..78064004e3767a31d3fee67f4b0a7004f24af03d 100644
--- a/htdocs/societe/canvas/individual/actions_card_individual.class.php
+++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php
@@ -112,7 +112,7 @@ class ActionsCardIndividual extends ActionsCardCommon
 			// Confirm delete third party
 			if ($action == 'delete' || $conf->use_javascript_ajax)
 			{
-				$this->tpl['action_delete'] = Form::formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteAnIndividual"),$langs->trans("ConfirmDeleteIndividual"),"confirm_delete",'',0,"1,action-delete");
+				$this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteAnIndividual"),$langs->trans("ConfirmDeleteIndividual"),"confirm_delete",'',0,"1,action-delete");
 			}
 		}
 	}
diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php
index 9750e213845b217029538a041bd806c5274d6473..661483cf2a2e7cda6b9eb18d15cffd9c9ba78290 100644
--- a/htdocs/societe/consumption.php
+++ b/htdocs/societe/consumption.php
@@ -367,7 +367,7 @@ if ($sql_select)
     print '<input class="flat" type="text" name="sprod_fulldescr" size="15" value="'.dol_escape_htmltag($sprod_fulldescr).'">';
     print '</td>';
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
     print '</tr>';
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index 76321fcc815b87b5a84f9a247cb218eb2ba1d28c..c2515b897153b29b7b850cef912521424e123033 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -816,7 +816,7 @@ if ($resql)
     }
     // Action column
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 
diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php
index b6a635d61fa764542dfb8377d70c7f2a5ae2de4d..f9b924c9240604d3f2c19b9fabfa9541910aa254 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -513,7 +513,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
             print '<td colspan="8">&nbsp;</td>';
             // Print the search button
             print '<td class="liste_titre" align="right">';
-            $searchpitco=Form::showFilterAndCheckAddButtons();
+            $searchpitco=$form->showFilterAndCheckAddButtons(0);
             print $searchpitco;
             print '</td>';
             print '</tr>';
diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php
index aa400ba0d38d27bb1862133f8d174746fb238feb..c7f087daf72eb2c7cc65897ff123a18448d23ec3 100644
--- a/htdocs/societe/rib.php
+++ b/htdocs/societe/rib.php
@@ -235,7 +235,7 @@ if ($socid && $action != 'edit' && $action != "create")
 	// Confirm delete third party
     if ($action == 'delete')
     {
-        print Form::formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1);
+        print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1);
     }
 
     dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom');
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 4c36c378e089b0d903898891541c9aeff51a4d0b..8da096519d0faf41457b48d2e899166800df419f 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1018,7 +1018,7 @@ else
             // Supplier
             print '<tr>';
             print '<td>'.fieldLabel('Supplier','fournisseur',1).'</td><td>';
-            print Form::selectyesno("fournisseur", (isset($_POST['fournisseur'])?GETPOST('fournisseur'):(GETPOST("type") == '' ? -1 : $object->fournisseur)), 1, 0, (GETPOST("type") == '' ? 1 : 0));
+            print $form->selectyesno("fournisseur", (isset($_POST['fournisseur'])?GETPOST('fournisseur'):(GETPOST("type") == '' ? -1 : $object->fournisseur)), 1, 0, (GETPOST("type") == '' ? 1 : 0));
             print '</td>';
             print '<td>'.fieldLabel('SupplierCode','supplier_code').'</td><td>';
             print '<table class="nobordernopadding"><tr><td>';
@@ -1121,7 +1121,7 @@ else
         // Assujeti TVA
         print '<tr><td>'.fieldLabel('VATIsUsed','assujtva_value').'</td>';
         print '<td>';
-        print Form::selectyesno('assujtva_value',1,1);     // Assujeti par defaut en creation
+        print $form->selectyesno('assujtva_value',1,1);     // Assujeti par defaut en creation
         print '</td>';
         print '<td class="nowrap">'.fieldLabel('VATIntra','intra_vat').'</td>';
         print '<td class="nowrap">';
@@ -1186,22 +1186,22 @@ else
         if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
         {
             print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
-            print Form::selectyesno('localtax1assuj_value',0,1);
+            print $form->selectyesno('localtax1assuj_value',0,1);
             print '</td><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td>';
-            print Form::selectyesno('localtax2assuj_value',0,1);
+            print $form->selectyesno('localtax2assuj_value',0,1);
             print '</td></tr>';
 
         }
         elseif($mysoc->localtax1_assuj=="1")
         {
             print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td colspan="3">';
-            print Form::selectyesno('localtax1assuj_value',0,1);
+            print $form->selectyesno('localtax1assuj_value',0,1);
             print '</td><tr>';
         }
         elseif($mysoc->localtax2_assuj=="1")
         {
             print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
-            print Form::selectyesno('localtax2assuj_value',0,1);
+            print $form->selectyesno('localtax2assuj_value',0,1);
             print '</td><tr>';
         }
 
@@ -1560,7 +1560,7 @@ else
             {
                 print '<tr>';
                 print '<td>'.fieldLabel('Supplier','fournisseur',1).'</td><td>';
-                print Form::selectyesno("fournisseur",$object->fournisseur,1);
+                print $form->selectyesno("fournisseur",$object->fournisseur,1);
                 print '</td>';
                 print '<td>'.fieldLabel('SupplierCode','supplier_code').'</td><td>';
 
@@ -1676,7 +1676,7 @@ else
 
             // VAT payers
             print '<tr><td>'.fieldLabel('VATIsUsed','assujtva_value').'</td><td>';
-            print Form::selectyesno('assujtva_value',$object->tva_assuj,1);
+            print $form->selectyesno('assujtva_value',$object->tva_assuj,1);
             print '</td>';
 
             // VAT Code
@@ -1714,7 +1714,7 @@ else
         	if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
             {
                 print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').'</td><td>';
-                print Form::selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
+                print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
                 if(! isOnlyOneLocalTax(1))
                 {
                 	print '<span class="cblt1">     '.$langs->transcountry("Type",$mysoc->country_code).': ';
@@ -1723,7 +1723,7 @@ else
                 }
 
                 print '</td><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td>';
-                print Form::selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
+                print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
 	            if  (! isOnlyOneLocalTax(2))
 	            {
 	            		print '<span class="cblt2">     '.$langs->transcountry("Type",$mysoc->country_code).': ';
@@ -1736,7 +1736,7 @@ else
             elseif($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj!="1")
             {
                 print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax1IsUsed",$mysoc->country_code),'localtax1assuj_value').'</td><td colspan="3">';
-                print Form::selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
+                print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1);
                 if(! isOnlyOneLocalTax(1))
                 {
                 	print '<span class="cblt1">     '.$langs->transcountry("Type",$mysoc->country_code).': ';
@@ -1749,7 +1749,7 @@ else
             elseif($mysoc->localtax2_assuj=="1" && $mysoc->localtax1_assuj!="1")
             {
                 print '<tr><td>'.fieldLabel($langs->transcountry("LocalTax2IsUsed",$mysoc->country_code),'localtax2assuj_value').'</td><td colspan="3">';
-                print Form::selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
+                print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
                 if(! isOnlyOneLocalTax(2))
                 {
                 	print '<span class="cblt2">     '.$langs->transcountry("Type",$mysoc->country_code).': ';
@@ -1903,7 +1903,7 @@ else
         // Confirm delete third party
         if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)))
         {
-            print Form::formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete");
+            print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("DeleteACompany"), $langs->trans("ConfirmDeleteCompany"), "confirm_delete", '', 0, "action-delete");
         }
 
 	    if ($action == 'merge')
@@ -1917,7 +1917,7 @@ else
 			    )
 		    );
 
-		    print Form::formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 190);
+		    print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id, $langs->trans("MergeThirdparties"), $langs->trans("ConfirmMergeThirdparties"), "confirm_merge", $formquestion, 'no', 1, 190);
 	    }
 
         dol_htmloutput_errors($error,$errors);
@@ -1981,7 +1981,7 @@ else
             print '<tr><td>';
             print $langs->trans('Gencod').'</td><td>'.$object->barcode;
             print '</td>';
-			if ($htmllogobar) $htmllogobar.=Form::showbarcode($object);
+			if ($htmllogobar) $htmllogobar.=$form->showbarcode($object);
             print $htmllogobar;
 			$htmllogobar='';
             print '</tr>';
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index c38df4f70d0389d3f3349ab29ef507fe9db9eaac..5411cee24b6ed90dd0be1433a87242c231453c27 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1138,9 +1138,9 @@ if ($action == 'create')
 		$syear = date("Y", $tmpdte);
 		$smonth = date("m", $tmpdte);
 		$sday = date("d", $tmpdte);
-		Form::selectDate($syear."-".$smonth."-".$sday, 'liv_', '', '', '', "addask");
+		$form->select_date($syear."-".$smonth."-".$sday, 'liv_', '', '', '', "addask");
 	} else {
-		Form::selectDate(-1, 'liv_', '', '', '', "addask", 1, 1);
+		$form->select_date(-1, 'liv_', '', '', '', "addask", 1, 1);
 	}
 	print '</td></tr>';
 
@@ -1358,22 +1358,22 @@ if ($action == 'create')
 							// 1),
 							array('type' => 'other','name' => 'socid','label' => $langs->trans("SelectThirdParty"),'value' => $form->select_company(GETPOST('socid', 'int'), 'socid', 's.fournisseur=1')));
 		// Paiement incomplet. On demande si motif = escompte ou autre
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneAsk'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('CloneAsk'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
 	}
 
 	// Confirm delete
 	else if ($action == 'delete') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAsk'), $langs->trans('ConfirmDeleteAsk', $object->ref), 'confirm_delete', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteAsk'), $langs->trans('ConfirmDeleteAsk', $object->ref), 'confirm_delete', '', 0, 1);
 	}
 
 	// Confirm reopen
 	else if ($action == 'reopen') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenAsk', $object->ref), 'confirm_reopen', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ReOpen'), $langs->trans('ConfirmReOpenAsk', $object->ref), 'confirm_reopen', '', 0, 1);
 	}
 
 	// Confirmation delete product/service line
 	else if ($action == 'ask_deleteline') {
-		$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
+		$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&lineid=' . $lineid, $langs->trans('DeleteProductLine'), $langs->trans('ConfirmDeleteProductLine'), 'confirm_deleteline', '', 0, 1);
 	}
 
 	// Confirm validate askprice
@@ -1401,7 +1401,7 @@ if ($action == 'create')
 		}
 
 		if (! $error)
-			$formconfirm = Form::formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateAsk'), $text, 'confirm_validate', '', 0, 1);
+			$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('ValidateAsk'), $text, 'confirm_validate', '', 0, 1);
 	}
 
 	if (! $formconfirm) {
@@ -1420,7 +1420,7 @@ if ($action == 'create')
 
 	// Ref
 	print '<tr><td>' . $langs->trans('Ref') . '</td><td colspan="5">';
-	print Form::showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
+	print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
 	print '</td></tr>';
 
 	// Company
@@ -1458,7 +1458,7 @@ if ($action == 'create')
 		print '<form name="editdate_livraison" action="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '" method="post">';
 		print '<input type="hidden" name="token" value="' . $_SESSION ['newtoken'] . '">';
 		print '<input type="hidden" name="action" value="setdate_livraison">';
-		Form::selectDate($object->date_livraison, 'liv_', '', '', '', "editdate_livraison");
+		$form->select_date($object->date_livraison, 'liv_', '', '', '', "editdate_livraison");
 		print '<input type="submit" class="button" value="' . $langs->trans('Modify') . '">';
 		print '</form>';
 	} else {
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 9f2338b69d71a230f6e36e4fdba90b3ae1b5d8b0..ff1abaa2da1040060ae0302df709bd6933e855c7 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -99,7 +99,7 @@ if ($object->id > 0)
 
 	// Ref
 	print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
-	print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','');
+	print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
 	print '</td></tr>';
 	
 	// Supplier
diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php
index 32d7d22dc66b548ac709b20f131f4eb9b0c3521e..4e9f3affa501f84bfc20fc7ef98e57bb2ebebab4 100644
--- a/htdocs/supplier_proposal/note.php
+++ b/htdocs/supplier_proposal/note.php
@@ -83,7 +83,7 @@ if ($id > 0 || ! empty($ref))
 
 			// Ref
 			print '<tr><td width="25%">'.$langs->trans('Ref').'</td><td colspan="3">';
-			print Form::showrefnav($object,'ref',$linkback,1,'ref','ref','');
+			print $form->showrefnav($object,'ref',$linkback,1,'ref','ref','');
 			print '</td></tr>';
 			
 			// Customer
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 228526a9b5e6b9b9f7a9a9a521642dedf0118b96..9344572d9df8bc9c1453476d9299e875cedf0893 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -756,7 +756,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
 	// Employee
     print '<tr>';
     print '<td>'.fieldLabel('Employee','employee',0).'</td><td>';
-    print Form::selectyesno("employee",(isset($_POST['employee'])?GETPOST('employee'):0),1);
+    print $form->selectyesno("employee",(isset($_POST['employee'])?GETPOST('employee'):0),1);
     print '</td></tr>';
 
     // Position/Job
@@ -847,7 +847,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
     {
         print '<tr><td>'.$langs->trans("Administrator").'</td>';
         print '<td>';
-        print Form::selectyesno('admin',GETPOST('admin'),1);
+        print $form->selectyesno('admin',GETPOST('admin'),1);
 
         if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode))
         {
@@ -1199,7 +1199,7 @@ else
          */
         if ($action == 'password')
         {
-            print Form::formconfirm("card.php?id=$object->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$object->login),"confirm_password", '', 0, 1);
+            print $form->formconfirm("card.php?id=$object->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$object->login),"confirm_password", '', 0, 1);
         }
 
         /*
@@ -1207,7 +1207,7 @@ else
          */
         if ($action == 'passwordsend')
         {
-            print Form::formconfirm("card.php?id=$object->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$object->login),"confirm_passwordsend", '', 0, 1);
+            print $form->formconfirm("card.php?id=$object->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$object->login),"confirm_passwordsend", '', 0, 1);
         }
 
         /*
@@ -1215,7 +1215,7 @@ else
          */
         if ($action == 'disable')
         {
-            print Form::formconfirm("card.php?id=$object->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$object->login),"confirm_disable", '', 0, 1);
+            print $form->formconfirm("card.php?id=$object->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$object->login),"confirm_disable", '', 0, 1);
         }
 
         /*
@@ -1223,7 +1223,7 @@ else
          */
         if ($action == 'enable')
         {
-            print Form::formconfirm("card.php?id=$object->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$object->login),"confirm_enable", '', 0, 1);
+            print $form->formconfirm("card.php?id=$object->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$object->login),"confirm_enable", '', 0, 1);
         }
 
         /*
@@ -1231,7 +1231,7 @@ else
          */
         if ($action == 'delete')
         {
-            print Form::formconfirm("card.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1);
+            print $form->formconfirm("card.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1);
         }
 
         /*
@@ -1828,7 +1828,7 @@ else
             // Employee
             print '<tr>';
             print '<td>'.fieldLabel('Employee','employee',0).'</td><td>';
-            print Form::selectyesno("employee",$object->employee,1);
+            print $form->selectyesno("employee",$object->employee,1);
             print '</td></tr>';
 
             // Position/Job
@@ -1924,7 +1924,7 @@ else
                 	)
                 )
                 {
-                    print Form::selectyesno('admin',$object->admin,1);
+                    print $form->selectyesno('admin',$object->admin,1);
 
                     if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode))
                     {
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 70caca334d0db1dc7364fcb4ac0be1a57e39dcce..6f5e79b9d6098406d862c94f2dde10b41918c677 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -296,7 +296,7 @@ else
 		 */
 		if ($action == 'delete')
 		{
-			print Form::formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$object->name),"confirm_delete", '',0,1);
+			print $form->formconfirm($_SERVER['PHP_SELF']."?id=".$object->id,$langs->trans("DeleteAGroup"),$langs->trans("ConfirmDeleteGroup",$object->name),"confirm_delete", '',0,1);
 		}
 
 		/*
@@ -312,7 +312,7 @@ else
 			// Ref
 			print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 			print '<td colspan="2">';
-			print Form::showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
+			print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
 			print '</td>';
 			print '</tr>';
 
diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php
index 6d23fcda8d810e1caf571f5c0d1327a74b5bd4a1..199041551c5423f84e88f62b78418686e1a7a505 100644
--- a/htdocs/user/group/ldap.php
+++ b/htdocs/user/group/ldap.php
@@ -102,7 +102,7 @@ print '<table class="border" width="100%">';
 // Ref
 print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
 print '<td colspan="2">';
-print Form::showrefnav($fgroup,'id','',$canreadperms);
+print $form->showrefnav($fgroup,'id','',$canreadperms);
 print '</td>';
 print '</tr>';
 
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index 32a1a8129cdc2f5b8a332bd7782f6a04eb237734..9ffda5e96c8bbaa97ccb81cec7c8255416cffaea 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -193,7 +193,7 @@ if ($id)
     // Ref
     print '<tr><td width="25%">'.$langs->trans("Ref").'</td>';
     print '<td colspan="2">';
-    print Form::showrefnav($fgroup,'id','',$user->rights->user->user->lire || $user->admin);
+    print $form->showrefnav($fgroup,'id','',$user->rights->user->user->lire || $user->admin);
     print '</td>';
     print '</tr>';
 
diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php
index 970c6113eedc86feac566543b7c4574e0ade77d8..66d725b320489834a1a671b15d8c0cee9d31663e 100644
--- a/htdocs/user/hierarchy.php
+++ b/htdocs/user/hierarchy.php
@@ -153,7 +153,7 @@ print '<td align="right">';
 print $form->selectarray('search_statut', array('-1'=>'','1'=>$langs->trans('Enabled')),$search_statut);
 print '</td>';
 print '<td class="liste_titre" align="right">';
-$searchpitco=Form::showFilterAndCheckAddButtons();
+$searchpitco=$form->showFilterAndCheckAddButtons(0);
 print $searchpitco;
 print '</td>';
 print '</tr>';
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index 1acdcc14846df72535a758ace672ae8acf23738d..161e39a89a8b9fe6f0b643a144b86feb70063eff 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -332,7 +332,7 @@ if ($result)
     if (! empty($arrayfields['u.employee']['checked']))
     {
         print '<td>';
-        print Form::selectyesno('search_employee', $search_employee, 1, false, 1);
+        print $form->selectyesno('search_employee', $search_employee, 1, false, 1);
         print '</td>';
     }
     if (! empty($arrayfields['u.accountancy_code']['checked']))
@@ -396,7 +396,7 @@ if ($result)
     }
     // Action column
     print '<td class="liste_titre" align="right">';
-    $searchpitco=Form::showFilterAndCheckAddButtons();
+    $searchpitco=$form->showFilterAndCheckAddButtons(0);
     print $searchpitco;
     print '</td>';
 	
diff --git a/scripts/accountancy/export-thirdpartyaccount.php b/scripts/accountancy/export-thirdpartyaccount.php
index a559d9ef53d5090781807f61eec08c657275dc2d..05236aabf7efe51e0e119488eb8c11019b7ca97d 100755
--- a/scripts/accountancy/export-thirdpartyaccount.php
+++ b/scripts/accountancy/export-thirdpartyaccount.php
@@ -102,7 +102,7 @@ $periodlink = '';
 $exportlink = '';
 
 $nom = $langs->trans("ReportThirdParty");
-$period = Form::selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . Form::selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
+$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
 $description = $langs->trans("DescThirdPartyReport");
 $builddate = time();