Changeset 1622 for trunk/expressoMail1_2/js/search.js
- Timestamp:
- 11/11/09 17:13:52 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/js/search.js
r1614 r1622 8 8 this.all_boxes = new Array; 9 9 this.type = ""; 10 this.fields = new Array("_ass","_de","_body","_para","_cc","_cco"); 10 this.txtfields = new Array("txt_ass","txt_de","txt_body","txt_para","txt_cc","txt_cco", 11 "since_date", "before_date", "on_date"); 12 this.selectFields = new Array("flagged", "seen", "answered", "recent"); 11 13 } 12 14 … … 30 32 div_form_search.style.left = "10px"; 31 33 div_form_search.style.top = "10px"; 32 div_form_search.style.width = "7 70px";33 div_form_search.style.height = " 300px";34 div_form_search.style.width = "784px"; 35 div_form_search.style.height = "418px"; 34 36 div_form_search.style.overflow = "hidden"; 35 37 div_form_search.innerHTML = ""; … … 37 39 div_form_search.appendChild(call_form_search); 38 40 form_search.appendChild(div_form_search); 41 42 Calendar._TT['WEEKEND'] = '0,6'; // hack 43 Calendar._TT['DAY_FIRST'] = 'Mostrar %s primeiro'; 44 Calendar.setup({ 45 inputField : 'since_date', 46 button : 'since_date-trigger', 47 ifFormat : '%d/%m/%Y', 48 daFormat : '%d/%m/%Y' 49 }); 50 51 Calendar.setup({ 52 inputField : 'before_date', 53 button : 'before_date-trigger', 54 ifFormat : '%d/%m/%Y', 55 daFormat : '%d/%m/%Y' 56 }); 57 58 Calendar.setup({ 59 inputField : 'on_date', 60 button : 'on_date-trigger', 61 ifFormat : '%d/%m/%Y', 62 daFormat : '%d/%m/%Y' 63 }); 39 64 40 65 } … … 44 69 div_button_search.id = "div_button_search"; 45 70 div_button_search.style.position = "absolute"; 46 div_button_search.style. left = "10px";71 div_button_search.style.marginLeft = "430px"; 47 72 div_button_search.style.top = "223px"; 48 div_button_search.style.width = " 615px";73 div_button_search.style.width = "350px"; 49 74 div_button_search.style.height = "25px"; 50 div_button_search.innerHTML = "<table border='0' width='50%' cellpadding='0' cellspacing='0' align='right'>"+75 div_button_search.innerHTML = "<table style='width: 100%;' border='0' cellpadding='0' cellspacing='0' align='center'>"+ 51 76 "<tr>"+ 52 "<td ><input type='button' value=" + get_lang('Search') + " onclick='EsearchE.func_search()'></td>"+53 "<td ><input type='button' value=" + get_lang('Clean') + " onclick='EsearchE.func_clean()'></td>"+54 "<td ><input type='button' value=" + get_lang('Close') + " onclick='EsearchE.func_close(\"hidden\")'></td>"+77 "<td width='33%' align='center'><input type='button' value=" + get_lang('Search') + " onclick='EsearchE.func_search()'></td>"+ 78 "<td width='33%' align='center'><input type='button' value=" + get_lang('Clean') + " onclick='EsearchE.func_clean()'></td>"+ 79 "<td width='33%' align='center'><input type='button' value=" + get_lang('Close') + " onclick='EsearchE.func_close(\"hidden\")'></td>"+ 55 80 "</tr>"+ 56 81 "</table>"; … … 81 106 form_sch.id = "form_sch"; 82 107 83 form_sch.innerHTML = '<fieldset style="width: 266px; text-align:right; padding: 5px; position:absolute;">'108 form_sch.innerHTML = '<fieldset style="width:400px; text-align:right; padding: 5px; position:absolute;">' 84 109 + ' <legend>'+get_lang('Inform your search in the text fields')+'</legend>' 85 110 + ' <label>'+get_lang("From")+':</label>' 86 + ' <input type="text" id="txt_de" size="19">'111 + ' <input style="margin-left: 6px;" type="text" id="txt_de" size="39">' 87 112 + ' <br style="margin-bottom:15px"/>' 88 113 + ' <label>'+get_lang('To')+':</label>' 89 + ' <input type="text" id="txt_para" size="19">'114 + ' <input style="margin-left: 6px;" type="text" id="txt_para" size="39">' 90 115 + ' <br style="margin-bottom:15px"/>' 91 116 + ' <label>'+get_lang('Cc')+':</label>' 92 + ' <input type="text" id="txt_cc" size="19">'117 + ' <input style="margin-left: 6px;" type="text" id="txt_cc" size="39">' 93 118 + ' <br style="margin-bottom:15px"/>' 94 119 + ' <label>'+get_lang('Subject')+':</label>' 95 + ' <input type="text" id="txt_ass" size="19">'120 + ' <input style="margin-left: 6px;" type="text" id="txt_ass" size="39">' 96 121 + ' <br style="margin-bottom:15px"/>' 97 122 + ' <label>'+get_lang('Message body')+':</label>' 98 + ' <input type="text" id="txt_body" size="19">' 123 + ' <input style="margin-left: 6px;" type="text" id="txt_body" size="39">' 124 125 + ' <br style="margin-bottom:30px"/>' 126 + ' <label>'+get_lang("Since Date")+':</label>' 127 + ' <input style="margin-left: 6px;" type="text" id="since_date" size="8">' 128 + ' <img id="since_date-trigger" src="/phpgwapi/templates/default/images/datepopup.gif" title="'+get_lang("Select Date")+'" style="cursor:pointer; cursor:hand;"/>' 129 + ' <label style="margin-left: 20px;">'+get_lang('Before Date')+':</label>' 130 + ' <input style="margin-left: 6px;" type="text" id="before_date" size="8">' 131 + ' <img id="before_date-trigger" src="/phpgwapi/templates/default/images/datepopup.gif" title="'+get_lang("Select Date")+'" style="cursor:pointer; cursor:hand;"/>' 132 + ' <br style="margin-bottom:15px"/>' 133 134 + ' <label>'+get_lang('On Date')+':</label>' 135 + ' <input style="margin-left: 6px;" type="text" id="on_date" size="8">' 136 + ' <img style="margin-right: -8px" id="on_date-trigger" src="/phpgwapi/templates/default/images/datepopup.gif" title="'+get_lang("Select Date")+'" style="cursor:pointer; cursor:hand;"/> </spam>' 137 + ' <br style="margin-bottom:30px"/>' 138 139 + ' <label>'+get_lang('Flags')+':</label>' 140 + ' <select style="width:15em; margin-left: 6px" name="flagged" id="flagged">' 141 + ' <option value=""/>' 142 + ' <option value="FLAGGED">'+ get_lang("Flagged") +'</option>' 143 + ' <option value="UNFLAGGED">'+ get_lang("Unflagged") +'</option>' 144 + ' </select>' 145 + ' <br style="margin-bottom:15px"/>' 146 + ' <select style="width:15em;" name="seen" id="seen">' 147 + ' <option value=""/>' 148 + ' <option value="SEEN">'+ get_lang("Seen") +'</option>' 149 + ' <option value="UNSEEN">'+ get_lang("Unseen") +'</option>' 150 + ' </select>' 151 + ' <br style="margin-bottom:15px"/>' 152 + ' <select style="width:15em;" name="answered" id="answered">' 153 + ' <option value=""/>' 154 + ' <option value="ANSWERED">'+ get_lang('Answered/Forwarded') +'</option>' 155 + ' <option value="UNANSWERED">'+ get_lang('Unanswered/Unforwarded') +'</option>' 156 + ' </select>' 157 + ' <br style="margin-bottom:15px"/>' 158 + ' <select style="width:15em;" name="recent" id="recent">' 159 + ' <option value=""/>' 160 + ' <option value="RECENT">'+ get_lang('Recent') +'</option>' 161 + ' <option value="OLD">'+ get_lang('Old') +'</option>' 162 + ' </select>' 163 99 164 + ' <br style="margin-bottom:60px"/>' 100 165 + '</fieldset>' 101 + '<fieldset style="width:350px; padding: 5px; position:absolute; margin-left: 280px">'166 + '<fieldset style="width:350px; padding: 5px; position:absolute; margin-left: 414px">' 102 167 + ' <legend>'+get_lang('Search the messages in these folders')+'</legend>' 103 168 + ' <div id="folders" style="width:160px; height:150px;float:left;margin-bottom:10px;"></div>' … … 308 373 } 309 374 currentTab = border_id; 375 openTab.content_id[currentTab] = Element('content_id_search_' + numBox); 310 376 openTab.type[currentTab] = 1; 311 377 var table = document.createElement("TABLE"); … … 742 808 fields += "CC " + "<=>" + url_encode(Element("txt_cc").value) + "##"; 743 809 } 810 if (trim(Element("since_date").value) != ""){ 811 if (validate_date(Element("since_date").value)) 812 { 813 fields += "SINCE " + "<=>" + url_encode(Element("since_date").value) + "##"; 814 } 815 else 816 { 817 alert(get_lang('Invalid date on field %1'), get_lang('Since Date')); 818 return false; 819 } 820 } 821 if (trim(Element("before_date").value) != ""){ 822 if (validate_date(Element("before_date").value)) 823 { 824 fields += "BEFORE " + "<=>" + url_encode(Element("before_date").value) + "##"; 825 } 826 else 827 { 828 alert(get_lang('Invalid date on field %1'), get_lang('Before Date')); 829 return false; 830 } 831 } 832 if(trim(Element("on_date").value) != ""){ 833 if (validate_date(Element("on_date").value)) 834 { 835 fields += "ON " + "<=>" + url_encode(Element("on_date").value) + "##"; 836 } 837 else 838 { 839 alert(get_lang('Invalid date on field %1'), get_lang('On Date')); 840 return false; 841 } 842 843 } 844 if(trim(Element("flagged").options[Element("flagged").selectedIndex].value) != ""){ 845 if (Element("flagged").options[Element("flagged").selectedIndex].value == "FLAGGED"){ 846 fields += "FLAGGED##"; 847 } 848 else { 849 fields += "UNFLAGGED##"; 850 } 851 } 852 if(trim(Element("seen").options[Element("seen").selectedIndex].value) != ""){ 853 if (Element("seen").options[Element("seen").selectedIndex].value == "SEEN"){ 854 fields += "SEEN##"; 855 } 856 else { 857 fields += "UNSEEN##"; 858 } 859 } 860 if(trim(Element("answered").options[Element("answered").selectedIndex].value) != ""){ 861 if (Element("answered").options[Element("answered").selectedIndex].value == "ANSWERED"){ 862 fields += "ANSWERED##"; 863 } 864 else { 865 fields += "UNANSWERED##"; 866 } 867 } 868 if(trim(Element("recent").options[Element("recent").selectedIndex].value) != ""){ 869 if (Element("answered").options[Element("answered").selectedIndex].value == "RECENT"){ 870 fields += "RECENT##"; 871 } 872 else { 873 fields += "OLD##"; 874 } 875 } 744 876 if(value) { 745 877 fields = "##ALL " + "<=>" +url_encode(value) + "##"; … … 830 962 searchE.prototype.func_clean = function(){ 831 963 // Limpa os campos; 832 for(var i=0; i < this.fields.length; i++){ 833 if(Element("txt" + this.fields[i]) != null){Element("txt" + this.fields[i]).value = "";} 834 } 964 for(var i=0; i < this.txtfields.length; i++){ 965 if(Element(this.txtfields[i]) != null){Element(this.txtfields[i]).value = "";} 966 } 967 968 for(i = 0; i < this.selectFields.length; i++) 969 { 970 if (Element(this.selectFields[i])) 971 { 972 Element(this.selectFields[i]).selectedIndex = 0; 973 } 974 } 835 975 if(Element("check_all_msg") != null){Element("check_all_msg").checked = false;} 836 976 … … 850 990 searchE.prototype.showWindow = function(div){ 851 991 if(!this.searchW[div.id]) { 852 div.style.width = " 660px";853 div.style.height = " 255px";992 div.style.width = "804px"; 993 div.style.height = "440px"; 854 994 div.style.visibility = "hidden"; 855 995 div.style.position = "absolute";
Note: See TracChangeset
for help on using the changeset viewer.