Ignore:
Timestamp:
01/03/08 14:09:58 (16 years ago)
Author:
niltonneto
Message:

Vide ocorrencias no Trac.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/js/filter.js

    r128 r139  
     1function populatedropdown(dayfield, monthfield, yearfield){ 
     2        var month=['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez']; 
     3        var today=new Date() 
     4        var dayfield=document.getElementById(dayfield) 
     5        var monthfield=document.getElementById(monthfield) 
     6        var yearfield=document.getElementById(yearfield) 
     7        for (var i=0; i<31; i++) 
     8                dayfield.options[i]=new Option(i+1, i+1) 
     9        dayfield.options[today.getDate()]=new Option(today.getDate(), today.getDate(), true, true) //select today's day 
     10        for (var m=0; m<12; m++) 
     11        monthfield.options[m]=new Option(month[m],m) 
     12        monthfield.options[today.getMonth()]=new Option(month[today.getMonth()], today.getMonth(), true, true) //select today's month 
     13        var thisyear=today.getFullYear() 
     14        for (var y=0; y<7; y++){ 
     15                yearfield.options[y]=new Option(thisyear, thisyear) 
     16                thisyear+=1 
     17        } 
     18        yearfield.options[0]=new Option(today.getFullYear(), today.getFullYear(), true, true) //select today's year 
     19} 
     20 
    121        function cfilter(){ 
    222 
     
    256276                                                 "</tr></table></td><td width='52%' valign='top'>"+get_lang('Emails of the account')+":<br><select multiple id='select_2' name='select_2' size='6' style='width:250px'></select>"+ 
    257277                                                 "</td></tr><tr><td colspan='3'><hr size='1' width='100%'></td>"+ 
    258                                                  "</tr><tr><td colspan='3'>"+get_lang('During (days off the office)')+": <input type='text' id='select_days' size='3'> "+get_lang('day(s)')+"</td>"+ 
     278                                                 "</tr><tr><td colspan='3'><input name='type' id='interval' checked='checked' type='radio'>"+get_lang('During')+": <input type='text' id='select_days' size='3'> "+get_lang('day(s)')+"</td>"+ 
     279                                                 "</tr><tr><td colspan='3'><input name='type' id='date' type='radio' onChange=\"populatedropdown('daydropdown', 'monthdropdown', 'yeardropdown')\">"+get_lang('Set date')+": <select id='daydropdown'></select><select id='monthdropdown'></select><select id='yeardropdown'></select></td>"+ 
    259280                                                 "</tr><tr><td colspan='3'><hr size='1' width='100%'></td></tr><tr><td colspan='3'>"+get_lang('With the following message')+".:</td>"+ 
    260281                                                 "</tr><tr><td colspan='3'><textarea id='field8' rows='3' cols='50'></textarea></td></tr></table></div>"+ 
     
    473494                }else{ 
    474495                        mount_rule = ""; 
    475                         var fld_days   = Element("select_days"); 
     496                        if (Element("date").checked){ 
     497                                var today=new Date(); 
     498                                var entryDate = new Date(Date.UTC(Element("yeardropdown").value, Element("monthdropdown").value, parseInt(Element("daydropdown").value)+1, 0, 0, 0)); 
     499                                var fld_days = parseInt((entryDate.getTime()-today.getTime())/86400000); 
     500                                } 
     501                        else 
     502                                var fld_days = parseInt(Element("select_days").value); 
     503                         
    476504                        var fld_emails = Element("select_1"); 
    477505                        var fld_men        = Element("field8"); 
    478506                        mount_rule = "#vacation&&"; 
    479                         if(LTrim(fld_days.value) != ""){ 
    480                                 if(fld_days.value > 0 && fld_days.value < 32){ 
    481                                         mount_rule += fld_days.value + "&&"; 
    482                                 }else{ 
    483                                         alert(get_lang("Inform between 1 and 31!")); 
    484                                         return false; 
    485                                 } 
    486                         }else{ 
     507                        if(fld_days != 0) 
     508                                        mount_rule += fld_days + "&&"; 
     509                        else{ 
    487510                                alert(get_lang("Inform the days!")); 
    488511                                return false; 
Note: See TracChangeset for help on using the changeset viewer.