Changeset 262 for trunk/root/templates/admin/date.tt
- Timestamp:
- 12/09/09 01:08:32 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/root/templates/admin/date.tt
r255 r262 1 1 <!-- $Id$ --> 2 2 [% poll = c.model('Vote').poll(voteid) %] 3 <DIV ID="testdiv1" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV>4 3 5 4 [% INCLUDE 'includes/admin_menu.tt' %] 6 5 6 <script> 7 var cal1, cal2, newStyleSheet; 8 9 var dateFrom = null; 10 var dateTo = null; 11 dhtmlxCalendarLangModules = new Array(); 12 13 dhtmlxCalendarLangModules['fr'] = { 14 langname: 'fr', 15 dateformat: '%d/%m/%Y', 16 monthesFNames: ["Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"], 17 monthesSNames: ["Jan", "Fév", "Mar", "Avr", "Mai", "Jun", "Jui", "Aou", "Sep", "Oct", "Nov", "Déc"], 18 daysFNames: ["Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"], 19 daysSNames: ["D", "L", "M", "M", "J", "V", "S"], 20 weekend: [0, 6], 21 weekstart: 1, 22 msgClose: "Fermer", 23 msgMinimize: "Minimiser", 24 msgToday: "Aujourd'hui", 25 } 26 27 window.onload = function () { 28 cal1 = new dhtmlxCalendarObject('calendar1'); 29 cal1.setYearsRange(2000, 2500); 30 cal1.setOnClickHandler(selectDate1); 31 cal1.setDateFormat('%d/%m/%Y'); 32 cal1.loadUserLanguage('fr'); 33 if (document.getElementById('calInput1').value != '') { 34 cal1.setDate(document.getElementById('calInput1').value); 35 } 36 cal2 = new dhtmlxCalendarObject('calendar2'); 37 cal2.setOnClickHandler(selectDate2); 38 cal2.setDateFormat('%d/%m/%Y'); 39 cal2.loadUserLanguage('fr'); 40 if (document.getElementById('calInput2').value != '') { 41 cal2.setDate(document.getElementById('calInput2').value); 42 } 43 } 44 45 function selectDate1(date) { 46 document.getElementById('calInput1').value = cal1.getFormatedDate(null,date); 47 document.getElementById('calendar1').style.display = 'none'; 48 dateFrom = new Date(date); 49 return true; 50 } 51 function selectDate2(date) { 52 document.getElementById('calInput2').value = cal2.getFormatedDate(null,date); 53 document.getElementById('calendar2').style.display = 'none'; 54 dateTo = new Date(date); 55 return true; 56 } 57 58 function showCalendar(k) { 59 if (document.getElementById('calendar'+k).style.display == 'none') { 60 document.getElementById('calendar'+k).style.display = 'block'; 61 } else { 62 document.getElementById('calendar'+k).style.display = 'none'; 63 } 64 } 65 66 function updatecal() { 67 var newval1 = document.getElementById('calInput1').value; 68 var newval2 = document.getElementById('calInput2').value; 69 cal1.setDate(newval1); 70 cal2.setDate(newval2); 71 } 72 73 </script> 74 7 75 [% IF poll.status == 'BEFORE' %] 8 76 <div class="box" style="float: left; width: 55%;"> 77 9 78 <form action="[% c.uri_for(poll.uid, 'date') %]" method="POST" id="dateform"> 10 79 11 <!-- http://www.mattkruse.com/javascript/calendarpopup/ -->12 80 <i>Les dates sont au format JJ/MM/AAAA HH:MM:SS</i><br> 13 81 [% IF dateerror %]<p class="alert">[% dateerror | html %]</p>[% END %] 14 82 15 <SCRIPT LANGUAGE="JavaScript" ID="js13"> 16 var cal13 = new CalendarPopup(); 17 </SCRIPT> 83 Debut du vote:<br> 84 Date: 18 85 19 Debut du vote:<br> 20 Date: <input type="text" name="dstart" value="[% c.req.param('dstart') || poll.info('dstart') | html %]"> 21 <A HREF="#" onClick="cal13.select(document.forms[0].dstart,'anchor13','dd/MM/yyyy'); return false;" TITLE="cal13.select(document.forms[0].dstart,'anchor13','dd/MM/yyyy'); return false;" NAME="anchor13" ID="anchor13">select</A> 22 Heure: <input type="text" size=9 name="hstart" value="[% c.req.param('hstart') || poll.info('hstart') | html %]"> 86 <input type="text" id="calInput1" name="dstart" value="[% c.req.param('dstart') 87 || poll.info('dstart') | html %]" onkeyup="updatecal()"> 88 <img style="cursor:pointer;" onClick="showCalendar(1)" src="[% c.uri_for('/static/dhtmlxCalendar/imgs', 'calendar.gif') %]" align="absmiddle"><div id="calendar1" style="position:absolute; left:199px; top:0px; display:none"></div> 89 90 Heure: <input type="text" size=9 name="hstart" value="[% c.req.param('hstart') || poll.info('hstart') || '8:00' | html %]"> 23 91 <br> 24 92 Fin du vote:<br> 25 Date: <input type="text" name="dend" value="[% c.req.param('dend') || poll.info('dend') | html %]"> 26 <A HREF="#" onClick="cal13.select(document.forms[0].dend,'anchor14','dd/MM/yyyy',(document.forms[0].dend.value=='')?document.forms[0].dstart.value:null); return false;" 27 TITLE="cal13.select(document.forms[0].dend,'anchor14','dd/MM/yyyy',(document.forms[0].dend.value=='')?document.forms[0].dstart.value:null); return false;" NAME="anchor14" ID="anchor14">select</A> 28 Heure: <input type="text" size=9 name="hend" value="[% c.req.param('hend') || poll.info('hend') | html %]"> 93 Date: 94 95 <input type="text" id="calInput2" name="dend" value="[% c.req.param('dend') || 96 poll.info('dend') | html %]" onkeyup="updatecal()"> 97 <img style="cursor:pointer;" onClick="showCalendar(2)" src="[% c.uri_for('/static/dhtmlxCalendar/imgs', 'calendar.gif') %]" align="absmiddle"><div id="calendar2" style="position:absolute; left:199px; top:0px; display:none"></div> 98 99 Heure: <input type="text" size=9 name="hend" value="[% c.req.param('hend') || poll.info('hend') || '18:00' | html %]"> 29 100 <br> 101 30 102 <hr> 31 103 [% c.prototype.observe_form('dateform', … … 34 106 frequency => 2, 35 107 ) %] 36 <div id="datesub"> 37 </div> 108 <div id="datesub"></div> 38 109 </form> 39 110 </div> … … 43 114 44 115 45 </div>46 116 <div style="clear: both"></div>
Note: See TracChangeset
for help on using the changeset viewer.