Index: /extensions/event_cats/admin/autolog_new.inc.php
===================================================================
--- /extensions/event_cats/admin/autolog_new.inc.php	(revision 4047)
+++ /extensions/event_cats/admin/autolog_new.inc.php	(revision 4048)
@@ -57,4 +57,5 @@
 
 $ec_lists['duplicable_codes'] = array();
+$t = array();
 
 foreach ($ec_lists['ec_table'] as $ec_entry) {
@@ -64,14 +65,20 @@
     $ec_entry['forced'] == 'false'
   ) {
-    $ec_lists['duplicable_codes'][$ec_entry['code']] = $ec_entry['user_id'];
+    $t[$ec_entry['id']] = $ec_entry['code'];
+    $ec_lists['duplicable_codes'][$ec_entry['code']]['id'] =
+     $ec_entry['id'];
+    $ec_lists['duplicable_codes'][$ec_entry['code']]['user_id'] =
+     $ec_entry['user_id'];
   }
+}
+foreach ($t as $ec_id => $ec_code) {
+  $ec_lists['duplicable_codes']['ids'][$ec_id] =
+   $ec_lists['duplicable_codes'][$ec_code]['id'];
 }
 
 $ec_def_vals = array();
 
-$ec_def_vals['code'] = '';
-$ec_def_vals['user'] = '-1';
-$ec_def_vals['act1'] = 'create';
-$ec_def_vals['auto_code_dg_nb'] = read_ec_conf('auto_code_dg_nb');
+$ec_default_action = 'create';
+$ec_def_auto_code_dg_nb = read_ec_conf('auto_code_dg_nb');
 
 /*****************************************************************************
@@ -81,12 +88,8 @@
 if (isset($_POST['ec_act1']) and $_POST['ec_act1'] == 'duplicate_entry') {
   if (isset($_POST['ec_entry_sel'])) {
-    if (array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table'])) {
-      $ec_def_vals['code'] = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['code'];
-      $ec_def_vals['user'] = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['user_id'];
-      $ec_def_vals['act1'] = $_POST['ec_entry_sel'];
-    }
-    else {
-      $page['errors'][] = 'Tentative de duplication d\'une entrée inexistante';
-    }
+    if (array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table']))
+     $ec_default_action = $_POST['ec_entry_sel'];
+    else
+     $page['errors'][] = 'Tentative de duplication d\'une entrée inexistante';
   }
   else {
@@ -95,11 +98,16 @@
 }
 
-
 /****************************************************************************/
-
 
 $template->assign('ec_ap_ok',$ec_ap_ok);
 $template->assign('ec_lists',$ec_lists);
-$template->assign('ec_def_vals',$ec_def_vals);
+$template->assign('ec_hidden_when_no_code',
+  (count($ec_lists['duplicable_codes']) == 0) ? 'style = "display:none;"' : ''
+);
+$template->assign('ec_hidden_when_no_user',
+  (count($ec_lists['user_ids']) == 0) ? 'style = "display:none;"' : ''
+);
+$template->assign('ec_default_action',$ec_default_action);
+$template->assign('ec_def_auto_code_dg_nb',$ec_def_auto_code_dg_nb);
 
 ?>
Index: /extensions/event_cats/admin/evntcats_admin.php
===================================================================
--- /extensions/event_cats/admin/evntcats_admin.php	(revision 4047)
+++ /extensions/event_cats/admin/evntcats_admin.php	(revision 4048)
@@ -139,9 +139,11 @@
 $template->assign('RACINE_URL',ROOT_URL);
 
-$template->assign('GET',str_from_var($_GET));
-$template->assign('POST',str_from_var($_POST));
-$template->assign('test1tpl',str_from_var($ec_lists));
-$template->assign('test2tpl',str_from_var($page['errors']));
-if (isset($code_list)) $template->assign('test3tpl',str_from_var($code_list));
+if (isset($conf['ec_debug1'])) $template->assign('ec_debug1', array(
+  'GET'       => str_from_var($_GET),
+  'POST'      => str_from_var($_POST),
+  'page'      => str_from_var($page),
+  'ec_lists'  => (isset($ec_lists)) ? str_from_var($ec_lists) : '(unset)',
+  'code_list' => (isset($code_list)) ? str_from_var($code_list) : '(unset)',
+));
 
 $template->set_filenames(array('evntcats_admin_content' => dirname(__FILE__).'/template/'.$page['tab'].'.tpl'));
Index: /extensions/event_cats/admin/template/autolog_entries.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4047)
+++ /extensions/event_cats/admin/template/autolog_entries.tpl	(revision 4048)
@@ -1,27 +1,5 @@
 {* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
 
-{* <!-- Page title --> *}
-<div class = "titrePage" style="margin-top: -20px;">
-  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
-</div>
-
-{* <!-- JavaScript warning message --> *}
-<div id = "ec_js_warn">
-  {'ec_javascript_needed'|@translate}<br><br>
-</div>
-<script type = "text/javascript"><!-- // Removes JavaScript warning message
-  document.getElementById('ec_js_warn').innerHTML = ''; //-->
-</script>
-
-{* <!-- EC Presentation --> *}
-{if $ec_howto}
-  <div>
-    {'ec_admin_page_howto'|@translate}
-  </div>
-{/if}
-
-<p>
-  <hr width = 75% size = 3 />
-</p>
+{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
 
 {* <!-- Whether plugin Additionnal Pages is active or not --> *}
@@ -140,15 +118,6 @@
 //--></script>
 
-{* <!-- {$test0tpl} --> *}
-<p>$_GET :</p>
-{$GET}
-<p>$_POST :</p>
-{$POST}
-<p>Autres :</p>
-{$test1tpl}
-{$test2tpl}
-{$test3tpl}
+{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
 
 {* <!--
 --> *}
-
Index: /extensions/event_cats/admin/template/autolog_new.js
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.js	(revision 4047)
+++ /extensions/event_cats/admin/template/autolog_new.js	(revision 4048)
@@ -2,4 +2,6 @@
 
 var ec_avoid_infinite_loop      = true;
+var ec_flag1                    = false;
+var ec_flag2                    = false;
 var ec_err                      = '';
 var ec_selected_action          = '';
@@ -11,4 +13,5 @@
 var ec_test_reg                 = '';
 var ec_auto_code_digits_nb      = '';
+var ec_default_action           = '';
 var ec_selected_old_user        = '-1';
 var ec_selected_old_code        = '-1';
@@ -18,11 +21,12 @@
 var ec_selected_code            = 'ec_sel_code_new';
 var ec_JS_message               = new Array();
-var ec_def_vals                 = new Array();
+var ec_duplic_codes             = new Array();
 
 function ec_mark_code(ec_id) {
-  if (
+  if (ec_flag2 ||
    !(document.getElementById('ec_sel_code_old').disabled == 'disabled' ||
    document.getElementById('ec_sel_code_old').disabled == true)
   ) {
+    var t1 = '';
     ec_selected_code = ec_id;
     document.getElementById(ec_selected_code).checked = 'checked';
@@ -36,11 +40,24 @@
          ec_selected_old_code;
         document.getElementById('ec_in_up_code_id').value = '';
-      break;
-    }
+        t1 = 'disabled';
+        ec_selected_old_user =
+         document.ec_new_code.ec_in_up_code_list.options[
+          document.ec_new_code.ec_in_up_code_list.selectedIndex
+         ].label;
+        document.getElementById('ec_in_up_usr_list_id').value = ec_selected_old_user;
+        ec_mark_user('ec_sel_user_old');
+      break;
+    }
+    document.getElementById('ec_sel_user_new').disabled       = t1;
+    document.getElementById('ec_submit_gen_user_id').disabled = t1;
+    document.getElementById('ec_in_up_usr_txt_id').disabled   = t1;
+    document.getElementById('ec_in_up_psd_txt_id').disabled   = t1;
+    document.getElementById('ec_sel_user_old').disabled       = t1;
+    document.getElementById('ec_in_up_usr_list_id').disabled  = t1;
   }
 }
 
 function ec_mark_user(ec_id) {
-  if (
+  if (ec_flag1 ||
    !(document.getElementById('ec_sel_user_old').disabled == 'disabled' ||
    document.getElementById('ec_sel_user_old').disabled == true)
@@ -49,12 +66,4 @@
     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 =
@@ -95,6 +104,4 @@
         document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
         document.getElementById('ec_in_up_imgs_id').value = '';
-        /* ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
-         'ec_sel_user_old' : ec_selected_user; */
         document.getElementById('ec_in_up_imgs_warn').innerHTML = '';
       break;
@@ -103,6 +110,4 @@
         document.getElementById('ec_in_up_cats_id').value = ec_selected_cat;
         document.getElementById('ec_in_up_imgs_id').value = ec_selected_img;
-        /* ec_selected_user = (ec_selected_user == 'ec_sel_user_none') ?
-         'ec_sel_user_old' : ec_selected_user; */
         ec_check_img_text();
       break;
@@ -240,5 +245,7 @@
       break;
     }
+    ec_flag1 = true;
     ec_mark_user('ec_sel_user_new');
+    ec_flag1 = false;
     return true;
   }
@@ -274,5 +281,5 @@
   var t    = document.getElementById('ec_in_up_code_id').value;
   var treg = /^[a-zA-Z0-9_-]{4,32}$/
-  if (t == '' || treg.test(t)) {
+  if (t == '' || treg.test(t) || t == NULL) {
     ec_new_code_text = t;
   }
@@ -326,4 +333,9 @@
 }
 
+function ec_change_code_list(ec_id) {
+  ec_selected_old_code = ec_id;
+  ec_mark_code('ec_sel_code_old');
+}
+
 function ec_test() {
   alert('OK.');
@@ -331,5 +343,4 @@
 
 function ec_init() {
-  var t = (ec_def_vals['code'] == '') ? '' : 'disabled';
   ec_err = '';
   ec_selected_user = 'ec_sel_user_old';
@@ -346,35 +357,58 @@
   ec_old_new_psd_text = '';
   ec_test_reg = '';
-  document.getElementById('ec_act1_id').value = ec_def_vals['act1'];
-  document.getElementById('ec_in_up_pwd_warn').innerHTML = '';
-  document.getElementById('ec_sel_code_old').checked = 'checked';
-  document.getElementById('ec_sel_code_old').checked =
-   (ec_def_vals['code'] == '') ? '' : 'checked';
-  document.getElementById('ec_sel_user_old').checked = 'checked';
-  document.getElementById('ec_sel_user_old').checked =
-   (ec_def_vals['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 = ec_def_vals['user'];
-  document.getElementById('ec_in_up_code_id').value = ec_def_vals['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_in_up_auto_code_length_id').value =
+  document.getElementById('ec_act1_id').value                    =
+   ec_default_action;
+  document.getElementById('ec_in_up_auto_code_length_id').value  =
    ec_auto_code_digits_nb;
-  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_def_vals['code'] = '';
-  ec_def_vals['user'] = '-1';
-  ec_def_vals['act1'] = 'create';
-}
+  document.getElementById('ec_in_up_code_id').value              = '';
+  document.getElementById('ec_in_up_usr_txt_id').value           = '';
+  document.getElementById('ec_in_up_psd_txt_id').value           = '';
+  document.getElementById('ec_in_up_pwd_warn').innerHTML         = '';
+  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_in_up_imgs_warn').innerHTML        = '';
+  document.getElementById('ec_input_action_home').checked        = 'checked';
+  document.getElementById('ec_input_action_home').checked        = '';
+  
+  if (ec_default_action == 'create') {
+    document.getElementById('ec_in_up_code_list_id').value       = '-1';
+    document.getElementById('ec_sel_code_old').checked           = 'checked';
+    document.getElementById('ec_sel_code_old').checked           = '';
+    document.getElementById('ec_sel_user_old').checked           = 'checked';
+    document.getElementById('ec_sel_user_old').checked           = '';
+    document.getElementById('ec_in_up_usr_list_id').value        = '-1';
+    document.getElementById('ec_submit_gen_full_auto_id').disabled = '';
+    document.getElementById('ec_submit_gen_code_id').disabled    = '';
+    document.getElementById('ec_in_up_auto_code_length_id').disabled = '';
+    document.getElementById('ec_in_up_code_id').disabled         = '';
+    document.getElementById('ec_sel_code_new').disabled          = '';
+    document.getElementById('ec_sel_code_old').disabled          = '';
+    document.getElementById('ec_in_up_code_list_id').disabled    = '';
+    document.getElementById('ec_sel_user_new').disabled          = '';
+    document.getElementById('ec_submit_gen_user_id').disabled    = '';
+    document.getElementById('ec_in_up_usr_txt_id').disabled      = '';
+    document.getElementById('ec_in_up_psd_txt_id').disabled      = '';
+    document.getElementById('ec_sel_user_old').disabled          = '';
+    document.getElementById('ec_in_up_usr_list_id').disabled     = '';
+  }
+  else {
+    document.getElementById('ec_in_up_code_list_id').value       =
+     ec_default_action;
+    document.getElementById('ec_sel_code_old').checked           = 'checked';
+    document.getElementById('ec_submit_gen_full_auto_id').disabled =
+     'disabled';
+    document.getElementById('ec_submit_gen_code_id').disabled    = 'disabled';
+    document.getElementById('ec_in_up_auto_code_length_id').disabled =
+     'disabled';
+    document.getElementById('ec_in_up_code_id').disabled         = 'disabled';
+    document.getElementById('ec_sel_code_new').disabled          = 'disabled';
+    document.getElementById('ec_sel_code_old').disabled          = 'disabled';
+    document.getElementById('ec_in_up_code_list_id').disabled    = 'disabled';
+    ec_selected_old_code = ec_duplic_codes[ec_default_action];
+    ec_flag2 = true;
+    ec_mark_code('ec_sel_code_old');
+    ec_flag2 = false;
+  }
+  ec_default_action                                              = 'create';
+}
Index: /extensions/event_cats/admin/template/autolog_new.tpl
===================================================================
--- /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4047)
+++ /extensions/event_cats/admin/template/autolog_new.tpl	(revision 4048)
@@ -1,27 +1,5 @@
 {* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
 
-{* <!-- Page title --> *}
-<div class = "titrePage" style="margin-top: -20px;">
-  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
-</div>
-
-{* <!-- JavaScript warning message --> *}
-<div id = "ec_js_warn">
-  {'ec_javascript_needed'|@translate}<br><br>
-</div>
-<script type = "text/javascript"><!-- // Removes JavaScript warning message
-  document.getElementById('ec_js_warn').innerHTML = ''; //-->
-</script>
-
-{* <!-- EC Presentation --> *}
-{if $ec_howto}
-  <div>
-    {'ec_admin_page_howto'|@translate}
-  </div>
-{/if}
-
-<p>
-  <hr width = 75% size = 3 />
-</p>
+{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
 
 {* <!-- Whether plugin Additionnal Pages is active or not --> *}
@@ -61,7 +39,7 @@
         <li>
           {* <!-- New code (to create) --> *}
-          <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');">
+          <label for = "ec_in_up_code_id" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code}>
             <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_id" value = "new"
-             id = "ec_sel_code_new" onclick = "ec_mark_code('ec_sel_code_new');"
+             id = "ec_sel_code_new" onclick = "ec_mark_code('ec_sel_code_new');" {$ec_hidden_when_no_code}
             />
             {'ec_up_code_lbl_code_new'|@translate}
@@ -75,7 +53,7 @@
           {'ec_gen_code_nb_pre'|@translate}
           <select name = "ec_in_up_auto_code_length" id = "ec_in_up_auto_code_length_id" onchange = "ec_auto_code_digits_nb = this.value;">
-            <option value = "4">4</option>
-            <option value = "5">5</option>
-            <option value = "8">8</option>
+            <option value =  "4" >4{'ec_gen_code_nb_min'|@translate}</option>
+            <option value =  "5" >5</option>
+            <option value =  "8" >8</option>
             <option value = "10">10</option>
             <option value = "12">12</option>
@@ -98,6 +76,6 @@
         <li>
           {* <!-- Known code --> *}
-          <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');">
-            <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id"
+          <label for = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');" {$ec_hidden_when_no_code} >
+            <input type = "radio" name = "ec_sel_code" for = "ec_in_up_code_list_id" {$ec_hidden_when_no_code}
              value = "old" id = "ec_sel_code_old" onclick = "ec_mark_code('ec_sel_code_old');"
             />
@@ -105,9 +83,9 @@
           </label>
           <select name = "ec_in_up_code_list" id = "ec_in_up_code_list_id" onclick = "ec_mark_code('ec_sel_code_old');"
-           onchange = "ec_selected_old_code = this.value;"
-          >
-            <option label = "------------" value = "-1" id = "ec_old_code_-1">------------</option>
+           onchange = "ec_change_code_list(this.value);" {$ec_hidden_when_no_code}
+          >
+            <option label = "------------" value = "-1" {* id = "ec_old_code_-1" *} {$ec_hidden_when_no_code} >------------</option>
             {foreach from=$ec_lists.duplicable_codes key=ec_key item=ec_val}
-              <option label = "{$ec_val}" value = "{$ec_key}" id = "ec_old_code_{$ec_key}">{$ec_key}</option>
+              <option label = "{$ec_val.user_id}" value = "{$ec_val.id}" {* id = "ec_old_code_{$ec_val.id}" *}>{$ec_key}</option>
             {/foreach}
           </select><br>
@@ -122,7 +100,7 @@
         <li>
           {* <!-- New user (to create) --> *}
-          <label for = "ec_in_up_usr_txt_id" onclick = "ec_mark_user('ec_sel_user_new');">
+          <label for = "ec_in_up_usr_txt_id" onclick = "ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user} >
             <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_txt_id" value = "new"
-             id = "ec_sel_user_new" onclick = "ec_mark_user('ec_sel_user_new');"
+             id = "ec_sel_user_new" onclick = "ec_mark_user('ec_sel_user_new');" {$ec_hidden_when_no_user}
             />
             {'ec_up_code_lbl_user_new'|@translate}
@@ -152,6 +130,6 @@
         <li>
           {* <!-- Known user --> *}
-          <label for = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');">
-            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id"
+          <label for = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');" {$ec_hidden_when_no_user} >
+            <input type = "radio" name = "ec_sel_user" for = "ec_in_up_usr_list_id" {$ec_hidden_when_no_user}
              value = "old" id = "ec_sel_user_old" onclick = "ec_mark_user('ec_sel_user_old');"
             />
@@ -159,9 +137,9 @@
           </label>
           <select name = "ec_in_up_usr_list" id = "ec_in_up_usr_list_id" onclick = "ec_mark_user('ec_sel_user_old');"
-           onchange = "ec_selected_old_user = this.value;"
-          >
-            <option label = "------------" value = "-1" id = "ec_old_user_-1">------------</option>
+           onchange = "ec_selected_old_user = this.value;" {$ec_hidden_when_no_user}
+          >
+            <option label = "------------" value = "-1" {* id = "ec_old_user_-1" *} {$ec_hidden_when_no_user} >------------</option>
             {foreach from=$ec_lists.user_ids key=ec_key item=ec_val}
-              <option label = "{$ec_val}" value = "{$ec_key}" id = "ec_old_user_{$ec_key}">{$ec_val}</option>
+              <option label = "{$ec_val}" value = "{$ec_key}" {* id = "ec_old_user_{$ec_key}" *} >{$ec_val}</option>
             {/foreach}
           </select><br>
@@ -245,22 +223,14 @@
   ec_JS_message['ec_submit_action_miss'] = "{'ec_submit_action_miss'|@translate}";
   ec_JS_message['ec_submit_code_bad']    = "{'ec_submit_code_bad'|@translate}";
-  ec_def_vals['code']                    = "{$ec_def_vals.code}";
-  ec_def_vals['user']                    = "{$ec_def_vals.user}";
-  ec_def_vals['act1']                    = "{$ec_def_vals.act1}";
-  ec_auto_code_digits_nb                 = "{$ec_def_vals.auto_code_dg_nb}";
+  ec_default_action                      = "{$ec_default_action}";
+  ec_auto_code_digits_nb                 = "{$ec_def_auto_code_dg_nb}";
+  {foreach from=$ec_lists.duplicable_codes.ids key=ec_key item=ec_val}
+    ec_duplic_codes[{$ec_key}] = {$ec_val};
+  {/foreach}
   ec_init();
 //--></script>
 
-{* <!-- {$test0tpl} --> *}
-<p>$_GET :</p>
-{$GET}
-<p>$_POST :</p>
-{$POST}
-<p>Autres :</p>
-{$test1tpl}
-{$test2tpl}
-{$test3tpl}
+{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
 
 {* <!--
 --> *}
-
Index: /extensions/event_cats/admin/template/config.tpl
===================================================================
--- /extensions/event_cats/admin/template/config.tpl	(revision 4047)
+++ /extensions/event_cats/admin/template/config.tpl	(revision 4048)
@@ -1,27 +1,5 @@
 {* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
 
-{* <!-- Page title --> *}
-<div class = "titrePage" style="margin-top: -20px;">
-  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
-</div>
-
-{* <!-- JavaScript warning message --> *}
-<div id = "ec_js_warn">
-  {'ec_javascript_needed'|@translate}<br><br>
-</div>
-<script type = "text/javascript"><!-- // Removes JavaScript warning message
-  document.getElementById('ec_js_warn').innerHTML = ''; //-->
-</script>
-
-{* <!-- EC Presentation --> *}
-{if $ec_howto}
-  <div>
-    {'ec_admin_page_howto'|@translate}
-  </div>
-{/if}
-
-<p>
-  <hr width = 75% size = 3 />
-</p>
+{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
 
 {* <!-- Available soon... --> *}
@@ -41,13 +19,5 @@
 --> *}
 
-{* <!-- {$test0tpl} --> *}
-<p>$_GET :</p>
-{$GET}
-<p>$_POST :</p>
-{$POST}
-<p>Autres :</p>
-{$test1tpl}
-{$test2tpl}
-{$test3tpl}
+{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
 
 {* <!--
Index: /extensions/event_cats/admin/template/duplication.tpl
===================================================================
--- /extensions/event_cats/admin/template/duplication.tpl	(revision 4047)
+++ /extensions/event_cats/admin/template/duplication.tpl	(revision 4048)
@@ -1,27 +1,5 @@
 {* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
 
-{* <!-- Page title --> *}
-<div class = "titrePage" style="margin-top: -20px;">
-  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
-</div>
-
-{* <!-- JavaScript warning message --> *}
-<div id = "ec_js_warn">
-  {'ec_javascript_needed'|@translate}<br><br>
-</div>
-<script type = "text/javascript"><!-- // Removes JavaScript warning message
-  document.getElementById('ec_js_warn').innerHTML = ''; //-->
-</script>
-
-{* <!-- EC Presentation --> *}
-{if $ec_howto}
-  <div>
-    {'ec_admin_page_howto'|@translate}
-  </div>
-{/if}
-
-<p>
-  <hr width = 75% size = 3 />
-</p>
+{include file='../../../plugins/event_cats/admin/template/header.inc.tpl'}
 
 {* <!-- Available soon... --> *}
@@ -41,13 +19,5 @@
 --> *}
 
-{* <!-- {$test0tpl} --> *}
-<p>$_GET :</p>
-{$GET}
-<p>$_POST :</p>
-{$POST}
-<p>Autres :</p>
-{$test1tpl}
-{$test2tpl}
-{$test3tpl}
+{include file='../../../plugins/event_cats/admin/template/footer.inc.tpl'}
 
 {* <!--
Index: /extensions/event_cats/admin/template/footer.inc.tpl
===================================================================
--- /extensions/event_cats/admin/template/footer.inc.tpl	(revision 4048)
+++ /extensions/event_cats/admin/template/footer.inc.tpl	(revision 4048)
@@ -0,0 +1,11 @@
+{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
+
+{* <!-- Common Event Cats admin pages footer --> *}
+
+{* <!-- Debug displays --> *}
+{if isset($ec_debug1)}
+  {foreach from=$ec_debug1 key=ec_key item=ec_val}
+    <p>{$ec_key} :</p>
+    {$ec_val}
+  {/foreach}
+{/if}
Index: /extensions/event_cats/admin/template/header.inc.tpl
===================================================================
--- /extensions/event_cats/admin/template/header.inc.tpl	(revision 4048)
+++ /extensions/event_cats/admin/template/header.inc.tpl	(revision 4048)
@@ -0,0 +1,27 @@
+{* <!-- Event Cats (event categories) LucMorizur June - ... 2009 --> *}
+
+{* <!-- Common Event Cats admin pages "header" --> *}
+
+{* <!-- Page title --> *}
+<div class = "titrePage" style="margin-top: -20px;">
+  <h2>{'ec_admin_page_title'|@translate} {$EVNTCATS_VERSION}</h2>
+</div>
+
+{* <!-- JavaScript warning message --> *}
+<div id = "ec_js_warn">
+  {'ec_javascript_needed'|@translate}<br><br>
+</div>
+<script type = "text/javascript"><!-- // Removes JavaScript warning message
+  document.getElementById('ec_js_warn').innerHTML = ''; //-->
+</script>
+
+{* <!-- EC Presentation --> *}
+{if $ec_howto}
+  <div>
+    {'ec_admin_page_howto'|@translate}
+  </div>
+{/if}
+
+<p>
+  <hr width = 75% size = 3 />
+</p>
Index: /extensions/event_cats/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4047)
+++ /extensions/event_cats/language/fr_FR/plugin.lang.php	(revision 4048)
@@ -44,4 +44,5 @@
 $lang['ec_new_entry_button']      = 'Générer un code automatiquement';
 $lang['ec_gen_code_nb_pre']       = 'de';
+$lang['ec_gen_code_nb_min']       = ' (min)';
 $lang['ec_gen_code_nb_max']       = ' (max)';
 $lang['ec_gen_code_nb_end']       = 'caractères';
