Index: /extensions/event_cats/admin/autolog_new.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_new.inc.php	(revision 4025)
+++ /extensions/event_cats/admin/autolog_new.inc.php	(revision 4026)
@@ -56,4 +56,8 @@
 build_ec_lists(); // in evntcats_funcs.php
 
+$ec_prop_code = '';
+$ec_prop_user = '-1';
+$ec_prop_act1 = 'create';
+
 /*****************************************************************************
 * $_GET and $_POST analysis.                                                 *
@@ -63,7 +67,7 @@
   if (isset($_POST['ec_entry_sel'])) {
     if (array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table'])) {
-      // Des variables donnant les valeur par défaut des champs à modifier lors
-      // d'une nouvelle entrée, prennent les valeurs établies trouvées dans la table
-      // (si quelqu'un comprend cette phrase...)
+      $ec_prop_code = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['code'];
+      $ec_prop_user = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['user_id'];
+      $ec_prop_act1 = $_POST['ec_entry_sel'];
     }
     else {
@@ -82,4 +86,7 @@
 $template->assign('ec_ap_ok',$ec_ap_ok);
 $template->assign('ec_lists',$ec_lists);
+$template->assign('ec_prop_code',$ec_prop_code);
+$template->assign('ec_prop_user',$ec_prop_user);
+$template->assign('ec_prop_act1',$ec_prop_act1);
 
 ?>
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 4025)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 4026)
@@ -82,6 +82,8 @@
   )
    $page['tab'] = 'autolog_new';
-  else if ($_POST['ec_act1'] == 'create')
+  elseif ($_POST['ec_act1'] == 'create')
    $page['tab'] = (ec_create_entry_OK()) ? 'autolog_entries' : 'autolog_new';
+  elseif (is_numeric($_POST['ec_act1'])) // Entry duplication : $_POST['ec_act1'] is entry #
+   $page['tab'] = (ec_duplicate_entry_OK()) ? 'autolog_entries' : 'autolog_new';
 }
 else if (isset($_GET['tab'])) switch ($_GET['tab']) {
Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 4025)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 4026)
@@ -10,4 +10,7 @@
 var ec_old_new_psd_text         = '';
 var ec_test_reg                 = '';
+var ec_prop_code                = '';
+var ec_prop_user                = '';
+var ec_prop_act1                = '';
 var ec_selected_old_user        = '-1';
 var ec_selected_AP              = '-1';
@@ -20,34 +23,39 @@
 
 function ec_mark_user(ec_id) {
-  ec_selected_user = ec_id;
-  document.getElementById(ec_selected_user).checked = 'checked';
-  switch (ec_selected_user) {
-    /* case 'ec_sel_user_none': // None
-      ec_selected_action =
-       (ec_ap_ok && (ec_selected_action != 'ec_input_action_home')) ?
-       'ec_input_action_add_p' : 'ec_input_action_home';
-      document.getElementById('ec_in_up_usr_txt_id').value = '';
-      document.getElementById('ec_in_up_psd_txt_id').value = '';
-      document.getElementById('ec_in_up_usr_list_id').value = '-1';
-    break; */
-    case 'ec_sel_user_new': // New user
-      document.getElementById('ec_in_up_usr_txt_id').value =
-       ec_new_user_text;
-      document.getElementById('ec_in_up_psd_txt_id').value =
-       ec_new_psd_text;
-      document.getElementById('ec_in_up_usr_list_id').value = '-1';
-    break;
-    case 'ec_sel_user_old': // "Old" user
-      document.getElementById('ec_in_up_usr_txt_id').value = '';
-      document.getElementById('ec_in_up_psd_txt_id').value = '';
-      document.getElementById('ec_in_up_usr_list_id').value =
-       ec_selected_old_user;
-    break;
-  }
-  ec_check_pwd_text();
-  if (ec_avoid_infinite_loop) {
-    ec_avoid_infinite_loop = false;
-    ec_mark_action(ec_selected_action);
-    ec_avoid_infinite_loop = true;
+  if (
+   !(document.getElementById('ec_sel_user_old').disabled == 'disabled' ||
+   document.getElementById('ec_sel_user_old').disabled == true)
+  ) {
+    ec_selected_user = ec_id;
+    document.getElementById(ec_selected_user).checked = 'checked';
+    switch (ec_selected_user) {
+      /* case 'ec_sel_user_none': // None
+        ec_selected_action =
+         (ec_ap_ok && (ec_selected_action != 'ec_input_action_home')) ?
+         'ec_input_action_add_p' : 'ec_input_action_home';
+        document.getElementById('ec_in_up_usr_txt_id').value = '';
+        document.getElementById('ec_in_up_psd_txt_id').value = '';
+        document.getElementById('ec_in_up_usr_list_id').value = '-1';
+      break; */
+      case 'ec_sel_user_new': // New user
+        document.getElementById('ec_in_up_usr_txt_id').value =
+         ec_new_user_text;
+        document.getElementById('ec_in_up_psd_txt_id').value =
+         ec_new_psd_text;
+        document.getElementById('ec_in_up_usr_list_id').value = '-1';
+      break;
+      case 'ec_sel_user_old': // "Old" user
+        document.getElementById('ec_in_up_usr_txt_id').value = '';
+        document.getElementById('ec_in_up_psd_txt_id').value = '';
+        document.getElementById('ec_in_up_usr_list_id').value =
+         ec_selected_old_user;
+      break;
+    }
+    ec_check_pwd_text();
+    if (ec_avoid_infinite_loop) {
+      ec_avoid_infinite_loop = false;
+      ec_mark_action(ec_selected_action);
+      ec_avoid_infinite_loop = true;
+    }
   }
 }
@@ -223,8 +231,15 @@
 
 function ec_check_img_text() {
-  document.getElementById('ec_in_up_imgs_warn').innerHTML = (
-   document.getElementById('ec_in_up_imgs_id').value != '' &&
-   document.getElementById('ec_in_up_cats_id').value == '-1'
-  ) ? ec_JS_message['ec_act_cat_miss'] : '';
+  if (isNaN(document.getElementById('ec_in_up_imgs_id').value)) {
+    alert(ec_JS_message['ec_act_img_miss']);
+    ec_selected_img = '';
+    document.getElementById('ec_in_up_imgs_id').value = '';
+  }
+  else {
+    document.getElementById('ec_in_up_imgs_warn').innerHTML = (
+     document.getElementById('ec_in_up_imgs_id').value != '' &&
+     document.getElementById('ec_in_up_cats_id').value == '-1'
+    ) ? ec_JS_message['ec_act_cat_miss'] : '';
+  }
 }
 
@@ -256,4 +271,18 @@
     return false;
   }
+  if (
+    document.ec_new_code.ec_in_up_aps.selectedIndex < 1 &&
+    document.ec_new_code.ec_in_up_cat.selectedIndex < 1 && (
+      document.getElementById('ec_in_up_imgs_id').value == '' || (
+        document.getElementById('ec_in_up_imgs_id').value != '' &&
+        isNaN(document.getElementById('ec_in_up_imgs_id').value) &&
+        document.ec_new_code.ec_in_up_cat.selectedIndex < 1
+      )
+    ) &&
+    document.getElementById('ec_input_action_home').checked == ''
+  ) {
+    alert(ec_JS_message['ec_submit_action_miss']);
+    return false;
+  }
 }
 
@@ -263,4 +292,5 @@
 
 function ec_init() {
+  var t = (ec_prop_code == '') ? '' : 'disabled';
   ec_err = '';
   ec_selected_user = 'ec_sel_user_old';
@@ -275,16 +305,30 @@
   ec_old_new_psd_text = '';
   ec_test_reg = '';
-  document.getElementById('ec_act1_id').value = 'create';
+  document.getElementById('ec_act1_id').value = ec_prop_act1;
   document.getElementById('ec_in_up_pwd_warn').innerHTML = '';
-  document.getElementById('ec_sel_user_new').checked = 'checked';
-  document.getElementById('ec_sel_user_new').checked = '';
+  document.getElementById('ec_sel_user_old').checked = 'checked';
+  document.getElementById('ec_sel_user_old').checked =
+   (ec_prop_user == '-1') ? '' : 'checked';
   document.getElementById('ec_input_action_home').checked = 'checked';
   document.getElementById('ec_input_action_home').checked = '';
   document.getElementById('ec_in_up_usr_txt_id').value = '';
   document.getElementById('ec_in_up_psd_txt_id').value = '';
-  document.getElementById('ec_in_up_usr_list_id').value = '-1';
-  document.getElementById('ec_in_up_code_id').value = '';
+  document.getElementById('ec_in_up_usr_list_id').value = ec_prop_user;
+  document.getElementById('ec_in_up_code_id').value = ec_prop_code;
   document.getElementById('ec_in_up_aps_id').value = '-1';
   document.getElementById('ec_in_up_cats_id').value = '-1';
   document.getElementById('ec_in_up_imgs_id').value = '';
-}
+  document.getElementById('ec_submit_gen_full_auto_id').disabled = t;
+  document.getElementById('ec_in_up_code_id').disabled = t;
+  document.getElementById('ec_submit_gen_code_id').disabled = t;
+  document.getElementById('ec_in_up_auto_code_length_id').disabled = t;
+  document.getElementById('ec_sel_user_new').disabled = t;
+  document.getElementById('ec_submit_gen_user_id').disabled = t;
+  document.getElementById('ec_in_up_usr_txt_id').disabled = t;
+  document.getElementById('ec_in_up_psd_txt_id').disabled = t;
+  document.getElementById('ec_sel_user_old').disabled = t;
+  document.getElementById('ec_in_up_usr_list_id').disabled = t;
+  ec_prop_code = '';
+  ec_prop_user = '-1';
+  ec_prop_act1 = 'create';
+}
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4025)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4026)
@@ -50,5 +50,5 @@
     <br>
     <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}"
-     {* id = "ec_submit_gen_full_auto_id" *} onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
+     id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>
   </div>
   
@@ -65,5 +65,5 @@
         <label for = "ec_in_up_code_id" style = "margin:0;">
           <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}"
-           {* id = "ec_submit_gen_code_id" *} onclick = "ec_gen_code();" style = "margin:0;"
+           id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;"
           />
         </label>
@@ -101,5 +101,5 @@
         &nbsp;
         <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}"
-         {* id = "ec_submit_gen_user_id" *} onclick = "ec_gen_user();"
+         id = "ec_submit_gen_user_id" onclick = "ec_gen_user();"
         /><br>
         <ul><li>
@@ -182,5 +182,5 @@
           />
           {'ec_up_code_lbl_img'|@translate}<br>
-          <input type = "text" name = "ec_in_up_imgs" id = "ec_in_up_imgs_id" maxlength = "6"
+          <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6"
            size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "ec_mark_action('ec_input_action_img');"
           /><br>
@@ -207,10 +207,15 @@
 <script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script>
 <script type = "text/javascript"><!--
-  ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_act_cat_miss']      = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
-  ec_JS_message['ec_new_pwd_gen']       = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
-  ec_JS_message['ec_up_code_lbl_home']  = "{'ec_up_code_lbl_home'|@translate}";
-  ec_JS_message['ec_submit_code_miss']  = "{'ec_submit_code_miss'|@translate}";
-  ec_JS_message['ec_submit_user_miss']  = "{'ec_submit_user_miss'|@translate}";
+  ec_JS_message['ec_gen_user_act_miss']  = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_cat_miss']       = "{'ec_act_cat_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_act_img_miss']       = "{'ec_act_img_miss'|@translate|@escape:javascript}";
+  ec_JS_message['ec_new_pwd_gen']        = "{'ec_new_pwd_gen'|@translate|@escape:javascript}";
+  ec_JS_message['ec_up_code_lbl_home']   = "{'ec_up_code_lbl_home'|@translate}";
+  ec_JS_message['ec_submit_code_miss']   = "{'ec_submit_code_miss'|@translate}";
+  ec_JS_message['ec_submit_user_miss']   = "{'ec_submit_user_miss'|@translate}";
+  ec_JS_message['ec_submit_action_miss'] = "{'ec_submit_action_miss'|@translate}";
+  ec_prop_code                           = "{$ec_prop_code}";
+  ec_prop_user                           = "{$ec_prop_user}";
+  ec_prop_act1                           = "{$ec_prop_act1}";
   ec_init();
 //--></script>
Index: /extensions/event_cats/include/evntcats_funcs.inc.php
===================================================================
--- /extensions/event_cats/include/evntcats_funcs.inc.php	(revision 4025)
+++ /extensions/event_cats/include/evntcats_funcs.inc.php	(revision 4026)
@@ -312,4 +312,18 @@
 
 /*
+ * ec_duplicate_entry_OK()
+ * returns true or false whether the duplication of an existing entry which #
+ * is given by $_POST['ec_act1'] was OK or not.
+ *
+ * @param
+ *   no param
+ * @return
+ *   true if creation was OK ; false if not
+ */
+function ec_duplicate_entry_OK() {
+  return false;
+}
+
+/*
  * str_from_var($var)
  * returns a string easing array var informations displaying in Piwigo :
Index: /extensions/event_cats/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4025)
+++ /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4026)
@@ -63,7 +63,9 @@
 $lang['ec_gen_user_act_miss']     = 'Sélectionnez d\'abord une page à afficher';
 $lang['ec_act_cat_miss']          = 'Catégorie ?';
+$lang['ec_act_img_miss']          = 'L\'identifiant d\'une image doit être un nombre.';
 $lang['ec_new_pwd_gen']           = 'Pensez à NOTER le mot de passe !';
 $lang['ec_submit_code_miss']      = 'Vous devez fournir un code.';
 $lang['ec_submit_user_miss']      = 'Vous devez fournir un utilisateur.';
+$lang['ec_submit_action_miss']    = 'Vous devez proposer une page à afficher.';
 
 // In PHP files
