Index: /extensions/ConcoursPhoto/admin/add_concours.php
===================================================================
--- /extensions/ConcoursPhoto/admin/add_concours.php	(revision 4140)
+++ /extensions/ConcoursPhoto/admin/add_concours.php	(revision 4141)
@@ -39,4 +39,11 @@
 
 
+  
+// Month initialization for date selection...
+$month_list = $lang['month'];
+$month_list[0]='------------';
+ksort($month_list);
+
+
 // concours initialize
 if ($action != "new")
@@ -75,6 +82,6 @@
 // Step 2 : action = modify_crit
 	
+/*
 	// Verify date format.		
-//	echo "DATE=".$_POST['concours_begin_date'];
 	if (!preg_match(
 	"/^([2][0]\d{2})\-([0]\d|[1][0-2])\-([0-2]\d|[3][0-1])\s([0-1]\d|[2][0-3])\:[0-5]\d\:[0-5]\d$/"
@@ -82,8 +89,6 @@
 	{
 		$_POST['concours_begin_date'] = date("Y-m-d H:m:s");
-//		redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . CONCOURS_DIR . '%2Fadmin%2Fadmin.php&amp;tab=add_concours&amp;action='.$action.'&amp;concours=' . $concours_id);
 	}
-
-	
+*/
 	
 	// Get information from form
@@ -92,9 +97,11 @@
 	$concours->concours_infos['name'] = $_POST['concours_name'];
 	$concours->concours_infos['descr'] = $_POST['concours_descr'];
-	$concours->concours_infos['begin_date'] = $_POST['concours_begin_date'];
-
-	$concours->concours_infos['end_date'] = AjoutJours($concours->concours_infos['begin_date'],$_POST['concours_end_date'] );
-
-//echo $_POST['concours_end_date'].' : '.$concours->concours_infos['end_date'];
+
+//	$concours->concours_infos['begin_date'] = $_POST['concours_begin_date'];
+//	$concours->concours_infos['end_date'] = AjoutJours($concours->concours_infos['begin_date'],$_POST['concours_end_date'] );
+
+	$concours->concours_infos['begin_date'] = sprintf("%04d-%02d-%02d %02d:%02d:%02d",$_POST['start_year'], $_POST['start_month'], $_POST['start_day'], $_POST['start_hour'], $_POST['start_min'], 0);
+    $concours->concours_infos['end_date'] = sprintf("%04d-%02d-%02d %02d:%02d:%02d",$_POST['end_year'], $_POST['end_month'], $_POST['end_day'], $_POST['end_hour'], $_POST['end_min'], 0);
+
 
 	$concours->concours_infos['groups'] = (!empty($_POST['groups']) ? '"' . implode(',', $_POST['groups']) . '"' : 'NULL');
@@ -168,9 +175,31 @@
 		$template->assign( 'CONCOURS', array(
 				'ID'	=> $concours_id,
-				'BEGIN_DATE'	=> date("Y-m-d H:m:s"),
-				'END_DATE'	=> 15
+//				'BEGIN_DATE'	=> date("Y-m-d H:m:s"),
+//				'END_DATE'	=> 15
 				));
 
-		break;
+        //  Init begin and end date
+          $form['start_year']  = $form['end_year']  = date('Y');
+          $form['start_month'] = $form['end_month'] = date('n');
+          $form['start_day']   = $form['end_day']   = date('j');
+                      
+        $template->assign(
+          array(
+
+            'START_DAY_SELECTED' => @$form['start_day'],
+            'START_MONTH_SELECTED' => @$form['start_month'],
+            'START_YEAR' => @$form['start_year'],
+            'START_HOUR' => '12',
+            'START_MIN' => '00',
+            
+            'END_DAY_SELECTED' => @$form['end_day'],
+            'END_MONTH_SELECTED' => @$form['end_month'],
+            'END_YEAR'   => @$form['end_year'],
+            'END_HOUR' => '12',
+            'END_MIN' => '00',
+            )
+          );
+
+  break;
 	case "modify" :
 
@@ -186,4 +215,7 @@
 		// Format group list
 		$concours->concours_infos['groups'] = explode(',', $concours->concours_infos['groups']);
+
+        $tBeginDate = explodeDateArray($concours->concours_infos['begin_date']);
+        $tEndDate = explodeDateArray($concours->concours_infos['end_date']);
 		
 		$template->assign( 'CONCOURS', array(
@@ -191,7 +223,23 @@
 				'NAME'	=> $concours->concours_infos['name'],
 				'DESCR'	=> $concours->concours_infos['descr'],
-				'BEGIN_DATE'	=> $concours->concours_infos['begin_date'],
-				'END_DATE'	=> NbJours($concours->concours_infos['begin_date'], $concours->concours_infos['end_date'])
+//				'BEGIN_DATE'	=> $concours->concours_infos['begin_date'],
+//				'END_DATE'	=> NbJours($concours->concours_infos['begin_date'], $concours->concours_infos['end_date'])
 				));
+        $template->assign(
+          array(
+
+            'START_DAY_SELECTED' => @$tBeginDate[2],
+            'START_MONTH_SELECTED' => @$tBeginDate[1],
+            'START_YEAR' => @$tBeginDate[0],
+            'START_HOUR' => @$tBeginDate[3],
+            'START_MIN' => @$tBeginDate[4],
+            
+            'END_DAY_SELECTED' => @$tEndDate[2],
+            'END_MONTH_SELECTED' => @$tEndDate[1],
+            'END_YEAR'   => @$tEndDate[0],
+            'END_HOUR' => @$tEndDate[3],
+            'END_MIN' => @$tEndDate[4],
+            )
+          );
 
 		break;
@@ -199,4 +247,7 @@
 	case "edit" :
 		$concours->concours_infos['groups'] = explode(',', $concours->concours_infos['groups']);
+
+        $tBeginDate = explodeDateArray($concours->concours_infos['begin_date']);
+        $tEndDate = explodeDateArray($concours->concours_infos['end_date']);
 		
 		$template->assign( 'CONCOURS', array(
@@ -204,7 +255,23 @@
 				'NAME'	=> $concours->concours_infos['name'],
 				'DESCR'	=> $concours->concours_infos['descr'],
-				'BEGIN_DATE'	=> $concours->concours_infos['begin_date'],
-				'END_DATE'	=> NbJours($concours->concours_infos['begin_date'], $concours->concours_infos['end_date'])
+//				'BEGIN_DATE'	=> $concours->concours_infos['begin_date'],
+//				'END_DATE'	=> NbJours($concours->concours_infos['begin_date'], $concours->concours_infos['end_date'])
 				));
+        $template->assign(
+          array(
+
+            'START_DAY_SELECTED' => @$tBeginDate[2],
+            'START_MONTH_SELECTED' => @$tBeginDate[1],
+            'START_YEAR' => @$tBeginDate[0],
+            'START_HOUR' => @$tBeginDate[3],
+            'START_MIN' => @$tBeginDate[4],
+            
+            'END_DAY_SELECTED' => @$tEndDate[2],
+            'END_MONTH_SELECTED' => @$tEndDate[1],
+            'END_YEAR'   => @$tEndDate[0],
+            'END_HOUR' => @$tEndDate[3],
+            'END_MIN' => @$tEndDate[4],
+            )
+          );
 		
 		$firstcriterias = $concours->get_firstlevel_criterias();
@@ -270,4 +337,6 @@
 	
 
+// Add month list to template
+$template->assign(array('month_list' => $month_list));
 
 
@@ -308,4 +377,16 @@
 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
 
+// Explode a date format ("AAAA-MM-JJ HH:hh:ss") in array
+// Array(YYYY, MM, JJ, HH, mm, ss)
+function explodeDateArray($date) {
+
+  $tDeb = explode("-", substr($date,0,strpos($date, ' ')));
+  $tDebH = explode(":", substr($date,strpos($date, ' ')+1));
+
+  return array($tDeb[0], $tDeb[1], $tDeb[2], $tDebH[0], $tDebH[1], $tDebH[2]);
+  
+}
+
+
 // NB of days between 2 dates "AAAA-MM-JJ HH:hh:ss"
 function NbJours($debut, $fin) {
Index: /extensions/ConcoursPhoto/admin/template/add_concours.tpl
===================================================================
--- /extensions/ConcoursPhoto/admin/template/add_concours.tpl	(revision 4140)
+++ /extensions/ConcoursPhoto/admin/template/add_concours.tpl	(revision 4141)
@@ -1,3 +1,11 @@
 {include file='include/autosize.inc.tpl'}
+{include file='include/datepicker.inc.tpl'}
+
+{literal}
+<script type="text/javascript">
+  pwg_initialization_datepicker("#start_day", "#start_month", "#start_year", "#start_linked_date", null, null, null);
+  pwg_initialization_datepicker("#end_day", "#end_month", "#end_year", "#end_linked_date", null, null, null);
+</script>
+{/literal}
 
 <div class="titrePage">
@@ -11,28 +19,40 @@
 	<table>
 
-		<tr><td colspan="3"><br></td></tr>
+		<tr><td colspan="4"><br></td></tr>
 
 		<tr>
 			<td><b>{'concours_id'|@translate}&nbsp;&nbsp;</b></td>
-			<td colspan="2">{$CONCOURS.ID}</td>
+			<td colspan="3">{$CONCOURS.ID}</td>
 		</tr>
 {if (isset($action) && ($action == 'modify_crit' || $action == 'edit'))}
 		<tr>
 			<td><b>{'concours_name'|@translate}&nbsp;&nbsp;</b></td>
-			<td colspan="2">{$CONCOURS.NAME}</td>
+			<td colspan="3">{$CONCOURS.NAME}</td>
 		</tr>
 
 		<tr>
 			<td><b>{'concours_descr'|@translate}&nbsp;&nbsp;</b></td>
-			<td colspan="2">{$CONCOURS.DESCR}</td>
-		</tr>
-
-		<tr>
-			<td><b>{'concours_begin_date'|@translate}</b></td>
-			<td colspan="2">{$CONCOURS.BEGIN_DATE}
-			 {'concours_nb_jours'|@translate} {$CONCOURS.END_DATE} {'jours'|@translate}</td>
-        </tr>
-		<tr>
-			<td colspan="3">
+			<td colspan="3">{$CONCOURS.DESCR}</td>
+		</tr>
+
+		<tr>
+          <td>
+            <b>{'concours_date_from'|@translate}</b>
+          </td>
+          <td colspan="3">
+            <b>{$START_DAY_SELECTED} / {$START_MONTH_SELECTED} / {$START_YEAR} - {$START_HOUR} : {$START_MIN}</b>
+          </td>
+        </tr>
+		<tr>
+          <td>
+            <b>{'concours_date_end'|@translate}</b>
+          </td>
+          <td colspan="3">
+            <b>{$END_DAY_SELECTED} / {$END_MONTH_SELECTED} / {$END_YEAR} - {$END_HOUR} : {$END_MIN}</b>
+          </td>
+        </tr>
+		
+		<tr>
+			<td colspan="4">
 			<b>{'concours_category_select'|@translate}</b>
 			<select  name="cat_selection" disabled="disabled">
@@ -46,36 +66,84 @@
 		<tr>
 			<td><b>{'concours_name'|@translate}&nbsp;&nbsp;</b></td>
-			<td colspan="2"><input  type="text" size="50" maxlength="50" value="{$CONCOURS.NAME}" name="concours_name"/></td>
-		</tr>
-
-		<tr><td colspan="3"><br></td></tr>
+			<td colspan="3"><input  type="text" size="50" maxlength="50" value="{$CONCOURS.NAME}" name="concours_name"/></td>
+		</tr>
+
+		<tr><td colspan="4"><br></td></tr>
 
 		<tr>
 			<td><b>{'concours_descr'|@translate}&nbsp;&nbsp;</b></td>
-			<td colspan="2"><input  type="text" size="65" maxlength="255" value="{$CONCOURS.DESCR}" name="concours_descr"/></td>
-		</tr>
-
-		<tr><td colspan="3"><br></td></tr>
+			<td colspan="3"><input  type="text" size="65" maxlength="255" value="{$CONCOURS.DESCR}" name="concours_descr"/></td>
+		</tr>
+
+		<tr><td colspan="4"><br></td></tr>
 
 		{if isset($group_perm)}
-		<tr><td colspan="3"><br></td></tr>
+		<tr><td colspan="4"><br></td></tr>
 		<tr>
 			<td><b>{'concours_authorized_group'|@translate} &nbsp;&nbsp;</b></td>
-			<td colspan="2">{$group_perm.GROUPSELECTION}</td>
+			<td colspan="3">{$group_perm.GROUPSELECTION}</td>
         </tr>
 		{/if}
-		<tr>
-			<td>&nbsp;</td>
-			<td>{'concours_begin_date'|@translate} (AAAA-MM-JJ HH:MM:SS)</td>
-			<td>{'concours_nb_jours'|@translate}</td>
-        </tr>
-		<tr>
-			<td><b>{'concours_activation_date'|@translate}</b></td>
-			<td><input  type="text" size="19" maxlength="19" value="{$CONCOURS.BEGIN_DATE}" name="concours_begin_date"/></td>
-			<td><input  type="text" size="5" maxlength="5" value="{$CONCOURS.END_DATE}" name="concours_end_date"/> {'jours'|@translate}</td>
-        </tr>
-        <tr><td colspan="3"><br></td></tr>
-		<tr>
-			<td colspan="3">
+        <tr><td colspan="4"><br></td></tr>
+		<tr>
+			<td colspan="4"><b><i><u>{'concours_activation_date'|@translate}</u></i></b></td>
+        </tr>
+
+		<tr>
+          <td>
+            <b>{'concours_date_from'|@translate}</b>
+          </td>
+          <td>
+              <select id="start_day" name="start_day">
+                <option value="0">--</option>
+                {section name=day start=1 loop=32}
+                <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$START_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
+                {/section}
+              </select>
+              <select id="start_month" name="start_month">
+              {html_options options=$month_list selected=$START_MONTH_SELECTED}
+              </select>
+              <input id="start_year" name="start_year" value="{$START_YEAR}" type="text" size="4" maxlength="4" >
+              <input id="start_linked_date" name="start_linked_date" type="hidden" size="10" disabled="disabled"/>
+          </td>
+          <td align="right">
+            <b>{'concours_hour_from'|@translate}</b>
+          </td>
+          <td>
+            <input id="start_hour" name="start_hour" value="{$START_HOUR}" type="text" size="2" maxlength="2" >:
+            <input id="start_min" name="start_min" value="{$START_MIN}" type="text" size="2" maxlength="2" >
+          </td>
+        </tr>
+        <tr>
+          <td>
+            <b>{'concours_date_end'|@translate}</b></li>
+          </td>
+          <td>
+              <select id="end_day" name="end_day">
+                <option value="0">--</option>
+                {section name=day start=1 loop=32}
+                <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$END_DAY_SELECTED}selected="selected"{/if}>{$smarty.section.day.index}</option>
+                {/section}
+              </select>
+              <select id="end_month" name="end_month">
+              {html_options options=$month_list selected=$END_MONTH_SELECTED}
+              </select>
+              <input id="end_year" name="end_year" value="{$END_YEAR}" type="text" size="4" maxlength="4" >
+              <input id="end_linked_date" name="end_linked_date" type="hidden" size="10" disabled="disabled"/>
+          </td>
+          <td align="right">
+            <b>{'concours_hour_to'|@translate}</b>
+          </td>
+          <td>
+            <input id="end_hour" name="end_hour" value="{$END_HOUR}" type="text" size="2" maxlength="2" >:
+            <input id="end_min" name="end_min" value="{$END_MIN}" type="text" size="2" maxlength="2" >
+          </td>
+           
+        </tr>
+
+        <tr><td colspan="4"><br></td></tr>
+
+		<tr>
+			<td colspan="4">
 			<b>{'concours_category_select'|@translate}</b>
 			<select  name="cat_selection">
Index: /extensions/ConcoursPhoto/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/ConcoursPhoto/language/fr_FR/plugin.lang.php	(revision 4140)
+++ /extensions/ConcoursPhoto/language/fr_FR/plugin.lang.php	(revision 4141)
@@ -63,3 +63,9 @@
 $lang['concours_no_result_file']			= 'Aucun fichier généré présent';
 
+$lang['concours_date_from']     = 'Date de Début';
+$lang['concours_date_end']     = 'Date de Fin';
+$lang['concours_hour_from']     = 'Heure de Début';
+$lang['concours_hour_to']     = 'Heure de Fin';
+
+
 ?>
