From 1fb40565f48bb5b91210f404e66ba0d4bc2101bc Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Sun, 12 Jul 2015 12:50:24 +0200
Subject: [PATCH] Fix bad parameters of function select_date

---
 htdocs/adherents/card_subscriptions.php    |  6 +++---
 htdocs/cashdesk/tpl/facturation1.tpl.php   |  4 ++--
 htdocs/commande/card.php                   |  1 -
 htdocs/compta/deplacement/card.php         |  6 +++---
 htdocs/compta/facture.php                  |  6 +++---
 htdocs/compta/paiement/cheque/card.php     |  2 +-
 htdocs/contact/card.php                    |  6 +++---
 htdocs/contact/perso.php                   |  2 +-
 htdocs/contrat/card.php                    |  6 +++---
 htdocs/contrat/services.php                |  4 ++--
 htdocs/core/tpl/objectline_create.tpl.php  |  4 ++--
 htdocs/core/tpl/objectline_edit.tpl.php    |  4 ++--
 htdocs/expedition/card.php                 |  4 ++--
 htdocs/fourn/commande/card.php             |  8 ++++----
 htdocs/loan/card.php                       | 14 +++++++-------
 htdocs/loan/document.php                   |  4 ++--
 htdocs/opensurvey/card.php                 |  2 +-
 htdocs/opensurvey/results.php              |  2 +-
 htdocs/opensurvey/wizard/create_survey.php |  4 ++--
 htdocs/product/stock/product.php           |  4 ++--
 htdocs/projet/card.php                     |  8 ++++----
 htdocs/projet/element.php                  |  4 ++--
 htdocs/projet/tasks.php                    |  4 ++--
 htdocs/projet/tasks/task.php               |  4 ++--
 htdocs/projet/tasks/time.php               |  4 ++--
 htdocs/public/members/new.php              |  2 +-
 26 files changed, 59 insertions(+), 60 deletions(-)

diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php
index dabbf142730..752a756b8cb 100644
--- a/htdocs/adherents/card_subscriptions.php
+++ b/htdocs/adherents/card_subscriptions.php
@@ -944,7 +944,7 @@ if ($rowid > 0)
 				$datefrom=$object->datevalid;
             }
         }
-        $form->select_date($datefrom,'','','','',"cotisation",1,1);
+        print $form->select_date($datefrom,'','','','',"cotisation",1,1,1);
         print "</td></tr>";
 
         // Date end subscription
@@ -957,7 +957,7 @@ if ($rowid > 0)
             $dateto=-1;		// By default, no date is suggested
         }
         print '<tr><td>'.$langs->trans("DateEndSubscription").'</td><td>';
-        $form->select_date($dateto,'end','','','',"cotisation");
+        print $form->select_date($dateto,'end','','','',"cotisation",1,0,1);
         print "</td></tr>";
 
         if ($adht->cotisation)
@@ -1058,7 +1058,7 @@ if ($rowid > 0)
 
                 // Date of payment
                 print '<tr class="bankswitchclass"><td class="fieldrequired">'.$langs->trans("DatePayment").'</td><td>';
-                $form->select_date(isset($paymentdate)?$paymentdate:-1,'payment',0,0,1,'cotisation',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/cashdesk/tpl/facturation1.tpl.php b/htdocs/cashdesk/tpl/facturation1.tpl.php
index b9335e80446..02465625478 100644
--- a/htdocs/cashdesk/tpl/facturation1.tpl.php
+++ b/htdocs/cashdesk/tpl/facturation1.tpl.php
@@ -206,8 +206,8 @@ $langs->load("cashdesk");
 				<td>
 				<input class="button bouton_mode_reglement" type="submit" name="btnModeReglement" value="<?php echo $langs->trans("Reported"); ?>" onclick="javascript: verifClic('DIF');" />
 				<?php
-				echo $langs->trans("DateEcheance").' :';
-				print $form->select_date(-1,'txtDatePaiement');
+				print $langs->trans("DateEcheance").' :';
+				print $form->select_date(-1,'txtDatePaiement',0,0,0,'paymentmode',1,0,1);
 				?>
  				</td>
 			</tr>
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 631cb8ebd3b..82cf9bf168d 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1372,7 +1372,6 @@ if ($action == 'create' && $user->rights->commande->creer)
 	}
 	// Date
 	print '<tr><td class="fieldrequired">' . $langs->trans('Date') . '</td><td colspan="2">';
-	//$form->select_date($dateorder, 're', '', '', '', "crea_commande", 1, 1);
 	$form->select_date('', 're', '', '', '', "crea_commande", 1, 1);			// Always autofill date with current date
 	print '</td></tr>';
 
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 02a3bc82e19..083aeb48986 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->select_date($datec?$datec:-1,'','','','','add',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->select_date($object->date,'','','','','update');
+            print $form->select_date($object->date,'',0,0,0,'update',1,0,1);
             print '</td></tr>';
 
             // Km
@@ -433,7 +433,7 @@ else if ($id)
             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');
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index 65529079d39..087780fdaad 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -2273,7 +2273,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']);
-	$form->select_date($datefacture?$datefacture:$dateinvoice, '', '', '', '', "add", 1, 1);
+	print $form->select_date($datefacture?$datefacture:$dateinvoice, '', '', '', '', "add", 1, 1, 1);
 	print '</td></tr>';
 
 	// Payment term
@@ -2457,12 +2457,12 @@ if ($action == 'create')
 					print '<td class="nobordernopadding nowrap">';
 					print $langs->trans('From') . ' ';
 					print '</td><td class="nobordernopadding nowrap">';
-					print $form->select_date('', 'date_start' . $i, $usehm, $usehm, 1, "add");
+					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->select_date('', 'date_end' . $i, $usehm, $usehm, 1, "add");
+					print $form->select_date('', 'date_end' . $i, $usehm, $usehm, 1, "add", 1, 0, 1);
 					print '</td></tr></table>';
 					print '</td>';
 				}
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index bafa20aa84f..aea7579007a 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -386,7 +386,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->select_date($filterdate,'fd',0,0,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);
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index 4d0451285b1..0278a864c2f 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -635,11 +635,11 @@ else
             $form=new Form($db);
             if ($object->birthday)
             {
-                print $form->select_date($object->birthday,'birthday',0,0,0,"perso");
+                print $form->select_date($object->birthday,'birthday',0,0,0,"perso", 1, 0, 1);
             }
             else
             {
-                print $form->select_date('','birthday',0,0,1,"perso");
+                print $form->select_date('','birthday',0,0,1,"perso", 1, 0, 1);
             }
             print '</td>';
 
@@ -1156,7 +1156,7 @@ else
 		print $langs->trans("VCard");
 		print '</a>';
         print '</td></tr>';
-        
+
         print "</table>";
 
         print dol_fiche_end();
diff --git a/htdocs/contact/perso.php b/htdocs/contact/perso.php
index 19213ca049f..8f4e97e690d 100644
--- a/htdocs/contact/perso.php
+++ b/htdocs/contact/perso.php
@@ -129,7 +129,7 @@ if ($action == 'edit')
     // Date To Birth
     print '<tr><td>'.$langs->trans("DateToBirth").'</td><td>';
     $form=new Form($db);
-    print $form->select_date($object->birthday,'birthday',0,0,1,"perso");
+    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 6bf7dcaeacc..4005cb9abdf 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -1687,11 +1687,11 @@ else
                 }
 
                 print '<tr '.$bc[$var].'><td>'.$langs->trans("DateServiceActivate").'</td><td>';
-                print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active");
+                print $form->select_date($dateactstart,'',$usehm,$usehm,'',"active",1,0,1);
                 print '</td>';
 
                 print '<td>'.$langs->trans("DateEndPlanned").'</td><td>';
-                print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active");
+                print $form->select_date($dateactend,"end",$usehm,$usehm,'',"active",1,0,1);
                 print '</td>';
 
                 print '<td align="center" rowspan="2" valign="middle">';
@@ -1744,7 +1744,7 @@ else
                     if ($objp->statut == 4)
                     {
                         print $langs->trans("DateEndReal").' ';
-                        $form->select_date($dateactend,"end",$usehm,$usehm,($objp->date_fin_reelle>0?0:1),"closeline",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/services.php b/htdocs/contrat/services.php
index fe89907279c..eedb0183759 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -191,14 +191,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->select_date($filter_date1,'op1',0,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->select_date($filter_date2,'op2',0,0,1);
+	print $form->select_date($filter_date2,'op2',0,0,1,'',1,0,1);
 	print '</td>';
     print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
 	print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index fad1af3c082..8b56049fe7f 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -347,9 +347,9 @@ if ((! empty($conf->service->enabled) || ($object->element == 'contrat')) && $da
 	else
 	{
 		echo $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
-		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");
+		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->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");
+		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);
 	}
 	?>
 	</td>
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 51ded55f1c7..e38b8f873bd 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -222,9 +222,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->select_date($line->date_start,'date_start',$hourmin,$hourmin,$line->date_start?0:1,"updateligne");
+	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->select_date($line->date_end,'date_end',$hourmin,$hourmin,$line->date_end?0:1,"updateligne");
+	echo $form->select_date($line->date_end,'date_end',$hourmin,$hourmin,$line->date_end?0:1,"updateligne",1,0,1);
 	?>
 	</td>
 </tr>
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 88661bf090f..90b4589470a 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -542,7 +542,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->select_date($date_delivery?$date_delivery:-1,'date_delivery',1,1);
+            print $form->select_date($date_delivery?$date_delivery:-1,'date_delivery',1,1,1);
             print "</td>\n";
             print '</tr>';
 
@@ -1059,7 +1059,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">';
-			$form->select_date($object->date_delivery?$object->date_delivery:-1,'liv_',1,1,'',"setdate_livraison");
+			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>';
 		}
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 1f6d6533944..27a33216865 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -2216,9 +2216,9 @@ elseif (! empty($object->id))
 
             print '<br>';
             print $langs->trans('ServiceLimitedDuration').' '.$langs->trans('From').' ';
-            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,'');
+            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->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,'');
+            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>';
@@ -2790,7 +2790,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->select_date($date_com,'',1,1,'',"commande");
+			print $form->select_date($date_com,'',1,1,'',"commande",1,0,1);
 			print '</td></tr>';
 
 			print '<tr><td>'.$langs->trans("OrderMode").'</td><td>';
@@ -2817,7 +2817,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->select_date('','',1,1,'',"commande");
+			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/loan/card.php b/htdocs/loan/card.php
index ad32f7b6ced..2eec1695887 100644
--- a/htdocs/loan/card.php
+++ b/htdocs/loan/card.php
@@ -46,7 +46,7 @@ $object = new Loan($db);
 /*
  * Actions
  */
- 
+
 // Classify paid
 if ($action == 'confirm_paid' && $confirm == 'yes')
 {
@@ -86,7 +86,7 @@ if ($action == 'add' && $user->rights->loan->write)
 	{
 		$datestart=@dol_mktime(12,0,0, $_POST["startmonth"], $_POST["startday"], $_POST["startyear"]);
 		$dateend=@dol_mktime(12,0,0, $_POST["endmonth"], $_POST["endday"], $_POST["endyear"]);
-		
+
 		if (! $datestart)
 		{
 			setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("DateStart")), 'errors');
@@ -218,13 +218,13 @@ if ($action == 'create')
 	// Date Start
 	print "<tr>";
     print '<td class="fieldrequired">'.$langs->trans("DateStart").'</td><td>';
-    print $form->select_date($datestart?$datestart:-1,'start','','','','add',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->select_date($dateend?$dateend:-1,'end','','','','add',1,1);
+    print $form->select_date($dateend?$dateend:-1,'end','','','','add',1,1,1);
     print '</td></tr>';
 
 	// Number of terms
@@ -356,7 +356,7 @@ if ($id > 0)
 		print "<td>";
 		if ($action == 'edit')
 		{
-			print $form->select_date($object->datestart, 'start', 0, 0, 0, 'update', 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->select_date($object->dateend, 'end', 0, 0, 0, 'update', 1);
+			print $form->select_date($object->dateend, 'end', 0, 0, 0, 'update', 1, 0, 1);
 		}
 		else
 		{
@@ -402,7 +402,7 @@ if ($id > 0)
 			print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
 			print '</div>';
 			print '</form>';
-		} 
+		}
 
 		dol_fiche_end();
 
diff --git a/htdocs/loan/document.php b/htdocs/loan/document.php
index 3831f73a7ea..41de056dce5 100644
--- a/htdocs/loan/document.php
+++ b/htdocs/loan/document.php
@@ -123,7 +123,7 @@ if ($object->id)
     print "<td>";
     if ($action == 'edit')
     {
-        print $form->select_date($object->datestart, 'start', 0, 0, 0, 'loan', 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->select_date($object->dateend, 'end', 0, 0, 0, 'loan', 1);
+        print $form->select_date($object->dateend, 'end', 0, 0, 0, 'loan', 1, 0, 1);
     }
     else
     {
diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php
index 90f029b4d35..bd0d2cb8a51 100644
--- a/htdocs/opensurvey/card.php
+++ b/htdocs/opensurvey/card.php
@@ -287,7 +287,7 @@ print '</td></tr>';
 
 // Expire date
 print '<tr><td>'.$langs->trans('ExpireDate').'</td><td colspan="2">';
-if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object->date_fin,'expire');
+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/results.php b/htdocs/opensurvey/results.php
index ee19d321301..d9ef51b6a4a 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -458,7 +458,7 @@ print '</td></tr>';
 
 // Expire date
 print '<tr><td>'.$langs->trans('ExpireDate').'</td><td colspan="2">';
-if ($action == 'edit') print $form->select_date($expiredate?$expiredate:$object->date_fin,'expire');
+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 9c5d27d070e..61c3cd6dff6 100644
--- a/htdocs/opensurvey/wizard/create_survey.php
+++ b/htdocs/opensurvey/wizard/create_survey.php
@@ -101,7 +101,7 @@ if (GETPOST("creation_sondage_date") || GETPOST("creation_sondage_autre"))
 	if (! $testdate) {
 		setEventMessage($langs->trans('ErrorFieldRequired',$langs->transnoentitiesnoconv("ExpireDate")), 'errors');
 	}
-	
+
 	if ($titre && $testdate)
 	{
 		if (! empty($creation_sondage_date))
@@ -156,7 +156,7 @@ print '</tr>'."\n";
 
 print '<tr><td class="fieldrequired">'.  $langs->trans("ExpireDate")  .'</td><td>';
 
-print $form->select_date($champdatefin?$champdatefin:-1,'champdatefin','','','',"add",1,0);
+print $form->select_date($champdatefin?$champdatefin:-1,'champdatefin','','','',"add",1,0,1);
 
 print '</tr>'."\n";
 print '</table>'."\n";
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index f80050287e9..44b17cac98f 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -747,10 +747,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->select_date($pdluo->eatby,'eatby','','',1,"");
+			        $form->select_date($pdluo->eatby,'eatby','','',1,'',1,0,1);
 			        print '</td>';
 			        print '<td align="center" width="10%">';
-			        $form->select_date($pdluo->sellby,'sellby','','',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/projet/card.php b/htdocs/projet/card.php
index 1281e24358e..b0165c94760 100644
--- a/htdocs/projet/card.php
+++ b/htdocs/projet/card.php
@@ -478,12 +478,12 @@ if ($action == 'create' && $user->rights->projet->creer)
 
     // Date start
     print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-    print $form->select_date(($date_start?$date_start:''),'projectstart');
+    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->select_date(($date_end?$date_end:-1),'projectend');
+    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))
@@ -636,7 +636,7 @@ else
 
         // Date start
         print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-        print $form->select_date($object->date_start?$object->date_start:-1,'projectstart');
+        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");
@@ -644,7 +644,7 @@ else
 
         // Date end
         print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
-        print $form->select_date($object->date_end?$object->date_end:-1,'projectend');
+        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))
diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php
index fd8d90d8fad..c37f206850a 100644
--- a/htdocs/projet/element.php
+++ b/htdocs/projet/element.php
@@ -320,10 +320,10 @@ if (! $showdatefilter)
 	print '<input type="hidden" name="action" value="view">';
 	print '<table><tr>';
 	print '<td>'.$langs->trans("From").' ';
-	print $form->select_date($dates,'dates',0,0,1);
+	print $form->select_date($dates,'dates',0,0,1,'',1,0,1);
 	print '</td>';
 	print '<td>'.$langs->trans("to").' ';
-	print $form->select_date($datee,'datee',0,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/tasks.php b/htdocs/projet/tasks.php
index 531ce2fbcf1..8a4c2e53d89 100644
--- a/htdocs/projet/tasks.php
+++ b/htdocs/projet/tasks.php
@@ -310,12 +310,12 @@ if ($action == 'create' && $user->rights->projet->creer && (empty($object->third
 
 	// Date start
 	print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-	print $form->select_date(($date_start?$date_start:''),'dateo',1,1,0,'',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->select_date(($date_end?$date_end:-1),'datee',1,1,0,'',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/task.php b/htdocs/projet/tasks/task.php
index 93dcc7226a2..8a3c3cc5d5b 100644
--- a/htdocs/projet/tasks/task.php
+++ b/htdocs/projet/tasks/task.php
@@ -336,12 +336,12 @@ if ($id > 0 || ! empty($ref))
 
 			// Date start
 			print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
-			print $form->select_date($object->date_start,'dateo',1,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->select_date($object->date_end?$object->date_end:-1,'datee',1,1);
+			print $form->select_date($object->date_end?$object->date_end:-1,'datee',1,1,0,'',1,0,1);
 			print '</td></tr>';
 
 			// Planned workload
diff --git a/htdocs/projet/tasks/time.php b/htdocs/projet/tasks/time.php
index 238b3c588ff..8f0398d3f69 100644
--- a/htdocs/projet/tasks/time.php
+++ b/htdocs/projet/tasks/time.php
@@ -385,7 +385,7 @@ if ($id > 0 || ! empty($ref))
 			print '<td class="nowrap">';
 			//$newdate=dol_mktime(12,0,0,$_POST["timemonth"],$_POST["timeday"],$_POST["timeyear"]);
 			$newdate='';
-			print $form->select_date($newdate,'time',1,1,2,"timespent_date");
+			print $form->select_date($newdate,'time',1,1,2,"timespent_date",1,0,1);
 			print '</td>';
 
 			// Contributor
@@ -486,7 +486,7 @@ if ($id > 0 || ! empty($ref))
 			print '<td class="nowrap">';
 			if ($_GET['action'] == 'editline' && $_GET['lineid'] == $task_time->rowid)
 			{
-				print $form->select_date($db->jdate($date2?$date2:$date1),'timeline',1,1,2,"timespent_date");
+				print $form->select_date($db->jdate($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 597c26c49f8..2856fcb93a3 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->select_date($birthday,'birth',0,0,1,"newmember");
+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";
-- 
GitLab