Changeset 4026 for extensions/event_cats/admin
- Timestamp:
- Oct 12, 2009, 2:00:00 AM (15 years ago)
- Location:
- extensions/event_cats/admin
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/autolog_new.inc.php
r4011 r4026 56 56 build_ec_lists(); // in evntcats_funcs.php 57 57 58 $ec_prop_code = ''; 59 $ec_prop_user = '-1'; 60 $ec_prop_act1 = 'create'; 61 58 62 /***************************************************************************** 59 63 * $_GET and $_POST analysis. * … … 63 67 if (isset($_POST['ec_entry_sel'])) { 64 68 if (array_key_exists($_POST['ec_entry_sel'], $ec_lists['ec_table'])) { 65 // Des variables donnant les valeur par défaut des champs à modifier lors66 // d'une nouvelle entrée, prennent les valeurs établies trouvées dans la table67 // (si quelqu'un comprend cette phrase...)69 $ec_prop_code = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['code']; 70 $ec_prop_user = $ec_lists['ec_table'][$_POST['ec_entry_sel']]['user_id']; 71 $ec_prop_act1 = $_POST['ec_entry_sel']; 68 72 } 69 73 else { … … 82 86 $template->assign('ec_ap_ok',$ec_ap_ok); 83 87 $template->assign('ec_lists',$ec_lists); 88 $template->assign('ec_prop_code',$ec_prop_code); 89 $template->assign('ec_prop_user',$ec_prop_user); 90 $template->assign('ec_prop_act1',$ec_prop_act1); 84 91 85 92 ?> -
extensions/event_cats/admin/evntcats_admin.php
r4019 r4026 82 82 ) 83 83 $page['tab'] = 'autolog_new'; 84 else 84 elseif ($_POST['ec_act1'] == 'create') 85 85 $page['tab'] = (ec_create_entry_OK()) ? 'autolog_entries' : 'autolog_new'; 86 elseif (is_numeric($_POST['ec_act1'])) // Entry duplication : $_POST['ec_act1'] is entry # 87 $page['tab'] = (ec_duplicate_entry_OK()) ? 'autolog_entries' : 'autolog_new'; 86 88 } 87 89 else if (isset($_GET['tab'])) switch ($_GET['tab']) { -
extensions/event_cats/admin/template/autolog_new.js
r4019 r4026 10 10 var ec_old_new_psd_text = ''; 11 11 var ec_test_reg = ''; 12 var ec_prop_code = ''; 13 var ec_prop_user = ''; 14 var ec_prop_act1 = ''; 12 15 var ec_selected_old_user = '-1'; 13 16 var ec_selected_AP = '-1'; … … 20 23 21 24 function ec_mark_user(ec_id) { 22 ec_selected_user = ec_id; 23 document.getElementById(ec_selected_user).checked = 'checked'; 24 switch (ec_selected_user) { 25 /* case 'ec_sel_user_none': // None 26 ec_selected_action = 27 (ec_ap_ok && (ec_selected_action != 'ec_input_action_home')) ? 28 'ec_input_action_add_p' : 'ec_input_action_home'; 29 document.getElementById('ec_in_up_usr_txt_id').value = ''; 30 document.getElementById('ec_in_up_psd_txt_id').value = ''; 31 document.getElementById('ec_in_up_usr_list_id').value = '-1'; 32 break; */ 33 case 'ec_sel_user_new': // New user 34 document.getElementById('ec_in_up_usr_txt_id').value = 35 ec_new_user_text; 36 document.getElementById('ec_in_up_psd_txt_id').value = 37 ec_new_psd_text; 38 document.getElementById('ec_in_up_usr_list_id').value = '-1'; 39 break; 40 case 'ec_sel_user_old': // "Old" user 41 document.getElementById('ec_in_up_usr_txt_id').value = ''; 42 document.getElementById('ec_in_up_psd_txt_id').value = ''; 43 document.getElementById('ec_in_up_usr_list_id').value = 44 ec_selected_old_user; 45 break; 46 } 47 ec_check_pwd_text(); 48 if (ec_avoid_infinite_loop) { 49 ec_avoid_infinite_loop = false; 50 ec_mark_action(ec_selected_action); 51 ec_avoid_infinite_loop = true; 25 if ( 26 !(document.getElementById('ec_sel_user_old').disabled == 'disabled' || 27 document.getElementById('ec_sel_user_old').disabled == true) 28 ) { 29 ec_selected_user = ec_id; 30 document.getElementById(ec_selected_user).checked = 'checked'; 31 switch (ec_selected_user) { 32 /* case 'ec_sel_user_none': // None 33 ec_selected_action = 34 (ec_ap_ok && (ec_selected_action != 'ec_input_action_home')) ? 35 'ec_input_action_add_p' : 'ec_input_action_home'; 36 document.getElementById('ec_in_up_usr_txt_id').value = ''; 37 document.getElementById('ec_in_up_psd_txt_id').value = ''; 38 document.getElementById('ec_in_up_usr_list_id').value = '-1'; 39 break; */ 40 case 'ec_sel_user_new': // New user 41 document.getElementById('ec_in_up_usr_txt_id').value = 42 ec_new_user_text; 43 document.getElementById('ec_in_up_psd_txt_id').value = 44 ec_new_psd_text; 45 document.getElementById('ec_in_up_usr_list_id').value = '-1'; 46 break; 47 case 'ec_sel_user_old': // "Old" user 48 document.getElementById('ec_in_up_usr_txt_id').value = ''; 49 document.getElementById('ec_in_up_psd_txt_id').value = ''; 50 document.getElementById('ec_in_up_usr_list_id').value = 51 ec_selected_old_user; 52 break; 53 } 54 ec_check_pwd_text(); 55 if (ec_avoid_infinite_loop) { 56 ec_avoid_infinite_loop = false; 57 ec_mark_action(ec_selected_action); 58 ec_avoid_infinite_loop = true; 59 } 52 60 } 53 61 } … … 223 231 224 232 function ec_check_img_text() { 225 document.getElementById('ec_in_up_imgs_warn').innerHTML = ( 226 document.getElementById('ec_in_up_imgs_id').value != '' && 227 document.getElementById('ec_in_up_cats_id').value == '-1' 228 ) ? ec_JS_message['ec_act_cat_miss'] : ''; 233 if (isNaN(document.getElementById('ec_in_up_imgs_id').value)) { 234 alert(ec_JS_message['ec_act_img_miss']); 235 ec_selected_img = ''; 236 document.getElementById('ec_in_up_imgs_id').value = ''; 237 } 238 else { 239 document.getElementById('ec_in_up_imgs_warn').innerHTML = ( 240 document.getElementById('ec_in_up_imgs_id').value != '' && 241 document.getElementById('ec_in_up_cats_id').value == '-1' 242 ) ? ec_JS_message['ec_act_cat_miss'] : ''; 243 } 229 244 } 230 245 … … 256 271 return false; 257 272 } 273 if ( 274 document.ec_new_code.ec_in_up_aps.selectedIndex < 1 && 275 document.ec_new_code.ec_in_up_cat.selectedIndex < 1 && ( 276 document.getElementById('ec_in_up_imgs_id').value == '' || ( 277 document.getElementById('ec_in_up_imgs_id').value != '' && 278 isNaN(document.getElementById('ec_in_up_imgs_id').value) && 279 document.ec_new_code.ec_in_up_cat.selectedIndex < 1 280 ) 281 ) && 282 document.getElementById('ec_input_action_home').checked == '' 283 ) { 284 alert(ec_JS_message['ec_submit_action_miss']); 285 return false; 286 } 258 287 } 259 288 … … 263 292 264 293 function ec_init() { 294 var t = (ec_prop_code == '') ? '' : 'disabled'; 265 295 ec_err = ''; 266 296 ec_selected_user = 'ec_sel_user_old'; … … 275 305 ec_old_new_psd_text = ''; 276 306 ec_test_reg = ''; 277 document.getElementById('ec_act1_id').value = 'create';307 document.getElementById('ec_act1_id').value = ec_prop_act1; 278 308 document.getElementById('ec_in_up_pwd_warn').innerHTML = ''; 279 document.getElementById('ec_sel_user_new').checked = 'checked'; 280 document.getElementById('ec_sel_user_new').checked = ''; 309 document.getElementById('ec_sel_user_old').checked = 'checked'; 310 document.getElementById('ec_sel_user_old').checked = 311 (ec_prop_user == '-1') ? '' : 'checked'; 281 312 document.getElementById('ec_input_action_home').checked = 'checked'; 282 313 document.getElementById('ec_input_action_home').checked = ''; 283 314 document.getElementById('ec_in_up_usr_txt_id').value = ''; 284 315 document.getElementById('ec_in_up_psd_txt_id').value = ''; 285 document.getElementById('ec_in_up_usr_list_id').value = '-1';286 document.getElementById('ec_in_up_code_id').value = '';316 document.getElementById('ec_in_up_usr_list_id').value = ec_prop_user; 317 document.getElementById('ec_in_up_code_id').value = ec_prop_code; 287 318 document.getElementById('ec_in_up_aps_id').value = '-1'; 288 319 document.getElementById('ec_in_up_cats_id').value = '-1'; 289 320 document.getElementById('ec_in_up_imgs_id').value = ''; 290 } 321 document.getElementById('ec_submit_gen_full_auto_id').disabled = t; 322 document.getElementById('ec_in_up_code_id').disabled = t; 323 document.getElementById('ec_submit_gen_code_id').disabled = t; 324 document.getElementById('ec_in_up_auto_code_length_id').disabled = t; 325 document.getElementById('ec_sel_user_new').disabled = t; 326 document.getElementById('ec_submit_gen_user_id').disabled = t; 327 document.getElementById('ec_in_up_usr_txt_id').disabled = t; 328 document.getElementById('ec_in_up_psd_txt_id').disabled = t; 329 document.getElementById('ec_sel_user_old').disabled = t; 330 document.getElementById('ec_in_up_usr_list_id').disabled = t; 331 ec_prop_code = ''; 332 ec_prop_user = '-1'; 333 ec_prop_act1 = 'create'; 334 } -
extensions/event_cats/admin/template/autolog_new.tpl
r4019 r4026 50 50 <br> 51 51 <input class = "submit" type = "button" name = "ec_submit_gen_full_auto" value = "{'ec_new_full_auto'|@translate}" 52 {* id = "ec_submit_gen_full_auto_id" *}onclick = "ec_gen_full_auto();" style = "margin-top:0;"/>52 id = "ec_submit_gen_full_auto_id" onclick = "ec_gen_full_auto();" style = "margin-top:0;"/> 53 53 </div> 54 54 … … 65 65 <label for = "ec_in_up_code_id" style = "margin:0;"> 66 66 <input class = "submit" type = "button" name = "ec_submit_gen_code" value = "{'ec_new_entry_button'|@translate}" 67 {* id = "ec_submit_gen_code_id" *}onclick = "ec_gen_code();" style = "margin:0;"67 id = "ec_submit_gen_code_id" onclick = "ec_gen_code();" style = "margin:0;" 68 68 /> 69 69 </label> … … 101 101 102 102 <input class = "submit" type = "button" name = "ec_submit_gen_user" value = "{'ec_up_code_lbl_gen_user'|@translate}" 103 {* id = "ec_submit_gen_user_id" *}onclick = "ec_gen_user();"103 id = "ec_submit_gen_user_id" onclick = "ec_gen_user();" 104 104 /><br> 105 105 <ul><li> … … 182 182 /> 183 183 {'ec_up_code_lbl_img'|@translate}<br> 184 <input type = "text" name = "ec_in_up_img s" id = "ec_in_up_imgs_id" maxlength = "6"184 <input type = "text" name = "ec_in_up_img" id = "ec_in_up_imgs_id" maxlength = "6" 185 185 size = "10" onblur = "ec_selected_img = this.value; ec_check_img_text();" onfocus = "ec_mark_action('ec_input_action_img');" 186 186 /><br> … … 207 207 <script type = "text/javascript" src = "{$RACINE_URL}{$EVNTCATS_PATH}admin/template/autolog_new.js"></script> 208 208 <script type = "text/javascript"><!-- 209 ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}"; 210 ec_JS_message['ec_act_cat_miss'] = "{'ec_act_cat_miss'|@translate|@escape:javascript}"; 211 ec_JS_message['ec_new_pwd_gen'] = "{'ec_new_pwd_gen'|@translate|@escape:javascript}"; 212 ec_JS_message['ec_up_code_lbl_home'] = "{'ec_up_code_lbl_home'|@translate}"; 213 ec_JS_message['ec_submit_code_miss'] = "{'ec_submit_code_miss'|@translate}"; 214 ec_JS_message['ec_submit_user_miss'] = "{'ec_submit_user_miss'|@translate}"; 209 ec_JS_message['ec_gen_user_act_miss'] = "{'ec_gen_user_act_miss'|@translate|@escape:javascript}"; 210 ec_JS_message['ec_act_cat_miss'] = "{'ec_act_cat_miss'|@translate|@escape:javascript}"; 211 ec_JS_message['ec_act_img_miss'] = "{'ec_act_img_miss'|@translate|@escape:javascript}"; 212 ec_JS_message['ec_new_pwd_gen'] = "{'ec_new_pwd_gen'|@translate|@escape:javascript}"; 213 ec_JS_message['ec_up_code_lbl_home'] = "{'ec_up_code_lbl_home'|@translate}"; 214 ec_JS_message['ec_submit_code_miss'] = "{'ec_submit_code_miss'|@translate}"; 215 ec_JS_message['ec_submit_user_miss'] = "{'ec_submit_user_miss'|@translate}"; 216 ec_JS_message['ec_submit_action_miss'] = "{'ec_submit_action_miss'|@translate}"; 217 ec_prop_code = "{$ec_prop_code}"; 218 ec_prop_user = "{$ec_prop_user}"; 219 ec_prop_act1 = "{$ec_prop_act1}"; 215 220 ec_init(); 216 221 //--></script>
Note: See TracChangeset
for help on using the changeset viewer.