Changeset 7879
- Timestamp:
- Nov 26, 2010, 12:11:13 AM (13 years ago)
- Location:
- extensions/event_cats
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/event_cats/admin/template/autolog_new.js
r7864 r7879 41 41 var ec_selected_action = '-1'; 42 42 var maintenant = new Date(); 43 var validity_date = new Date(); 43 44 var ec_JS_message = new Array(); 44 45 var ec_duplic_codes = new Array(); … … 54 55 ec_lists['comment'] = new Array(); 55 56 var d = document; 56 var validity_date = maintenant;57 57 58 58 function de(ec_id) { … … 726 726 tp.setMilliseconds(0); 727 727 tp.setSeconds(0); 728 maintenant = tp;728 maintenant.setTime(tp.getTime()); 729 729 tp.setTime(maintenant.getTime() + 120000); // PHP will not allow that 730 730 // [date & time] is less than [one minute more than current [date & time]]. … … 737 737 ec_get_validity(); 738 738 if (Number(validity_date.getTime()) < Number(tp.getTime())) 739 validity_date = tp;739 validity_date.setTime(tp.getTime()); 740 740 ec_set_validity(); 741 741 } … … 743 743 function ec_mark_now() { 744 744 maintenant = new Date(); 745 maintenant.setMilliseconds(0); 746 maintenant.setSeconds(0); 745 747 validity_date.setTime(maintenant.getTime() + 120000); // See two minutes 746 748 // explanation in function ec_validity_check_min … … 788 790 var tp = new Date(); 789 791 var ts = 0; 790 maintenant = tp; 792 tp.setMilliseconds(0); 793 tp.setSeconds(0); 794 maintenant.setTime(tp.getTime()); 791 795 tp.setTime(maintenant.getTime() + 120000); // See two minutes 792 796 // explanation in function ec_validity_check_min … … 799 803 ec_set_validity(); 800 804 ec_validity_check_min(); 805 } 806 807 function ec_check_validity_on() { 808 $('.ec_valid_ctl').attr('disabled', !ec_validity_on); 809 $('img.ui-datepicker-trigger').css( 810 'display', (ec_validity_on) ? 'inline' : 'none' 811 ); 812 $('#ec_tmp_img').css( 813 'display', (ec_validity_on) ? 'none' : 'inline' 814 ); 801 815 } 802 816 … … 850 864 null, "#ec_min_date_id", null); 851 865 $(document).ready(function(){ 866 maintenant = new Date(); 867 maintenant.setMilliseconds(0); 868 maintenant.setSeconds(0); 869 validity_date.setTime(maintenant.getTime()); 870 ec_check_validity_on(); 871 $('#ec_tmp_img').attr( 872 'src', $('img.ui-datepicker-trigger:first').attr('src') 873 ); 852 874 $('.ui-datepicker').click(function(){ 853 875 ec_validity_check_min(); … … 859 881 'backgroundColor', $('#content').css('backgroundColor') 860 882 ); 883 $('#ec_validity_sel_day').css( 884 'color', $('#content').css('color') 885 ); 886 $('.ec_valid_ctl').attr('disabled', 'disabled'); 887 $('#ec_valid_date_on_id').change(function(){ 888 ec_validity_on = $(this).attr('checked'); 889 ec_check_validity_on(); 890 }); 861 891 }); 862 892 -
extensions/event_cats/admin/template/autolog_new.tpl
r7864 r7879 315 315 <!-- 316 316 Next steps: 317 _ check if initialize validity date with JS is doable ; DONE 318 _ check if ' onchange = "ec_update_ts();" ' can be used ; DONE 319 _ implement JS ; DONE 317 _ check if initialize validity date with JS is doable; DONE 318 _ check if ' onchange = "ec_update_ts();" ' can be used; DONE 319 _ implement JS: 320 _ tick checkboxes when necessary; 321 _ throw proper information when submitting form. 320 322 _ implement PHP ; 321 323 _ commit, and drink a pint! … … 336 338 </label> 337 339 </p> 338 <p style = "text-align:left; {* padding:0.5em; border:1px solid #666666; *}">339 <input type = "text" id = "ec_validity_sel_day" style = "text-align:right; border:none; " disabled = "disabled"> 340 <select id = "ec_validity_day_id" name = "ec_validity_day" class = "ec_ datepicker">340 <p style = "text-align:left;"> 341 <input type = "text" id = "ec_validity_sel_day" style = "text-align:right; border:none; cursor:default;" disabled = "disabled"> 342 <select id = "ec_validity_day_id" name = "ec_validity_day" class = "ec_valid_ctl ec_datepicker"> 341 343 <option value = "0">--</option> 342 344 {section name=day start=1 loop=32} … … 346 348 {/section} 347 349 </select> 348 <select id = "ec_validity_month_id" name = "ec_validity_month" class = "ec_ datepicker">350 <select id = "ec_validity_month_id" name = "ec_validity_month" class = "ec_valid_ctl ec_datepicker"> 349 351 {html_options options=$month_list} 350 352 </select> 351 353 <input id = "ec_validity_year_id" name = "ec_validity_year" type = "text" size = "4" 352 maxlength = "4" style = "text-align:right; " class = "ec_ datepicker">353 <input id = "ec_validity_time_id" name = "ec_validity_time" type = "text" class = "ec_ datepicker"354 maxlength = "4" style = "text-align:right; " class = "ec_valid_ctl ec_datepicker"> 355 <input id = "ec_validity_time_id" name = "ec_validity_time" type = "text" class = "ec_valid_ctl ec_datepicker" 354 356 size = "5" maxlength = "5" title = "{'Hours field tooltip'|@translate}" style = "text-align:right; "> 355 357 <input id = "ec_linked_date_id" name = "ec_linked_date_id" type = "hidden" size = "10" disabled = "disabled"> 358 <img id = "ec_tmp_img" class = "ui-datepicker-trigger" src = "{$EVNTCATS_URLS.ROOT}icon/tmp.png" alt = "" title = "" style = "display:none;"> 356 359 </p> 357 360 <p style = "text-align:left;"> 358 361 <input id = "ec_date_today_btn_id" type = "button" value = "{'Now + 2 mn'|@translate}" 359 class = " submit" title = "{'Now button tooltip'|@translate}" onclick = "ec_mark_now();"> — 362 class = "ec_valid_ctl submit" title = "{'Now button tooltip'|@translate}" onclick = "ec_mark_now();"> — 360 363 <input id = "ec_set_time_to_btn_id" type = "button" value = "{'Set time to'|@translate}" 361 class = " submit" onclick = "ec_valid_set_time_to(document.getElementById('ec_set_time_to_id').selectedIndex);"> 362 <select id = "ec_set_time_to_id" name = "ec_set_time_to" onchange = "ec_valid_set_time_to(this.selectedIndex);" >364 class = "ec_valid_ctl submit" onclick = "ec_valid_set_time_to(document.getElementById('ec_set_time_to_id').selectedIndex);"> 365 <select id = "ec_set_time_to_id" name = "ec_set_time_to" onchange = "ec_valid_set_time_to(this.selectedIndex);" class = "ec_valid_ctl"> 363 366 {section name=time start=0 loop=24} 364 367 <option label = "{if strlen($smarty.section.time.index) lt 2}0{/if}{$smarty.section.time.index}:00" value = "{$smarty.section.time.index}"> … … 369 372 </p> 370 373 <p style = "text-align:left;"> 371 <input id = "ec_date_add_btn_id" type = "button" value = "{'Add'|@translate}" title = "{'Add button tooltip'|@translate}" class = " submit"374 <input id = "ec_date_add_btn_id" type = "button" value = "{'Add'|@translate}" title = "{'Add button tooltip'|@translate}" class = "ec_valid_ctl submit" 372 375 onclick = "ec_add_time(document.getElementById('ec_date_add_val_id').value, document.getElementById('ec_date_add_kind_id').selectedIndex);"> 373 <input id = "ec_date_add_val_id" type = "text" size = "5" maxlength = "5" value = "" style = "text-align:right;" > 374 <select id = "ec_date_add_kind_id" name = "ec_date_add_kind" >376 <input id = "ec_date_add_val_id" type = "text" size = "5" maxlength = "5" value = "" style = "text-align:right;" class = "ec_valid_ctl"> 377 <select id = "ec_date_add_kind_id" name = "ec_date_add_kind" class = "ec_valid_ctl"> 375 378 <option label = "{'Minutes'|@translate}" value = "minutes">{'Minutes'|@translate}</option> 376 379 <option label = "{'Hours'|@translate}" value = "hours" >{'Hours'|@translate}</option> … … 393 396 <li style = "margin-bottom:0;"> 394 397 <label for = "ec_notify_user_id"> 395 <input type = "checkbox" name = "ec_notify_user" id = "ec_notify_user_id" >398 <input type = "checkbox" name = "ec_notify_user" id = "ec_notify_user_id" class = "ec_valid_ctl"> 396 399 {'The user'|@translate} 397 400 </label> … … 399 402 <li style = "margin-bottom:0;"> 400 403 <label for = "ec_notify_webm_id"> 401 <input type = "checkbox" name = "ec_notify_webm" id = "ec_notify_webm_id" >404 <input type = "checkbox" name = "ec_notify_webm" id = "ec_notify_webm_id" class = "ec_valid_ctl"> 402 405 {'The webmaster'|@translate} 403 406 </label> … … 405 408 <li style = "margin-bottom:0;"> 406 409 <label for = "ec_notify_admins_id"> 407 <input type = "checkbox" name = "ec_notify_admins" id = "ec_notify_admins_id" >410 <input type = "checkbox" name = "ec_notify_admins" id = "ec_notify_admins_id" class = "ec_valid_ctl"> 408 411 {'All administrators'|@translate} 409 412 </label> … … 449 452 <li style = "margin-bottom:0;"> 450 453 <label for = "ec_date_unknown_0_id"> 451 <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id" >454 <input type = "radio" name = "ec_date_unknown" value = "0" id = "ec_date_unknown_0_id" class = "ec_valid_ctl"> 452 455 {'Home'|@translate} 453 456 </label> … … 455 458 <li style = "margin-bottom:0;"> 456 459 <label for = "ec_date_unknown_1_id"> 457 <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id" >460 <input type = "radio" name = "ec_date_unknown" value = "1" id = "ec_date_unknown_1_id" class = "ec_valid_ctl"> 458 461 {'Access denied'|@translate} 459 462 </label> … … 461 464 {* <!-- Additionnal Page, provided the plugin is activated and at least one Add. P. is available --> *} 462 465 <li {if !$ec_ap_ok or count($ec_lists.add_pages) == 0} style = "display:none;" {else} style = "margin-bottom:0;" {/if} > 463 <label class = "ec_date_block"for = "ec_date_in_up_aps_id">464 <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id" >466 <label for = "ec_date_in_up_aps_id"> 467 <input type = "radio" name = "ec_date_unknown" value = "2" id = "ec_date_unknown_2_id" class = "ec_valid_ctl"> 465 468 {'Additional Page'|@translate}<br> 466 <select class = " categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" >469 <select class = "ec_valid_ctl categoryList" name = "ec_date_in_up_aps" size = "30" id = "ec_date_in_up_aps_id" > 467 470 {html_options options = $ec_lists.add_pages} 468 471 </select>
Note: See TracChangeset
for help on using the changeset viewer.