Merge branch 'template_locales'
[kivitendo-erp.git] / templates / webpages / common / search_history.html
1 [%- USE T8 %]
2 [% USE HTML %]<style type="text/css">@import url(js/jscalendar/calendar-win2k-1.css);</style>
3 <script type="text/javascript" src="js/jscalendar/calendar.js"></script>
4 <script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script>
5 <script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script>
6
7 <form method="post" action="am.pl">
8
9 <input type="hidden" name="action" value="show_am_history">
10
11   <table>
12     <tr>
13       <th class ="listtop">[% 'history search engine' | $T8 %]</th>
14       </th>
15     </tr>
16     <tr>
17       <td>
18         <script type="text/javascript">
19           <!--
20                     function uncheckOther(id) {
21             if(!(
22                 (document.getElementById('non-deleted').checked == false)
23                 &&
24                 (document.getElementById('both').checked == false)
25                 &&
26                 (document.getElementById('deleted').checked == false)
27               )) {
28                 if(id == "deleted") {
29                   document.getElementById('non-deleted').checked = false;
30                   document.getElementById('both').checked = false;
31                 }
32                 if(id == "non-deleted") {
33                   document.getElementById('deleted').checked = false;
34                   document.getElementById('both').checked = false;
35                 }
36                 if(id == "both") {
37                   document.getElementById('non-deleted').checked = false;
38                   document.getElementById('deleted').checked = false;
39                 }
40             }
41           }
42
43           var defaults = new Array('SAVED', 'DELETED', 'ADDED', 'PAYMENT POSTED', 'POSTED', 'POSTED AS NEW', 'SAVED FOR DUNNING', 'DUNNING STARTED', 'PRINTED');
44           var translated = new Object();
45           translated['SAVED'] = '[% 'SAVED' | $T8 %]';
46           translated['DELETED'] = '[% 'DELETED' | $T8 %]';
47           translated['ADDED'] = '[% 'ADDED' | $T8 %]';
48           translated['PAYMENT POSTED'] = '[% 'PAYMENT POSTED' | $T8 %]';
49           translated['POSTED'] = '[% 'POSTED' | $T8 %]';
50           translated['POSTED AS NEW'] = '[% 'POSTED AS NEW' | $T8 %]'
51           translated['SAVED FOR DUNNING'] = '[% 'SAVED FOR DUNNING' | $T8 %]';
52           translated['DUNNING STARTED'] = '[% 'DUNNING STARTED' | $T8 %]';
53           translated['PRINTED'] = '[% 'PRINTED' | $T8 %]';
54
55           var jscalender = "<table valign=\"top\">"
56                   + "<tr><td colspan=\"2\"><b>[% 'Period' | $T8 %]:&nbsp;</b></td></tr>"
57                   + "<tr><td>[% 'from (time)' | $T8 %]:&nbsp;"
58                   + "<input name=\"fromdate\" id=\"fromdate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(fromdate) %]\">"
59                   + "<input type=\"button\" name=\"fromdate\" id=\"trigger1\" value=\"?\">"
60                   + "&nbsp;</td><td>[% 'to (time)' | $T8 %]:&nbsp;"
61                   + "<input name=\"todate\" id=\"todate\" size=\"11\" title=\"[% HTML.escape(myconfig_dateformat) %]\" value=\"[% HTML.escape(todate) %]\">"
62                   + "<input type=\"button\" name=\"todate\" id=\"trigger2\" value=\"?\"></td></tr></table>";
63           var mitarbeiter = "<table valign=\"top\">"
64                   + "<tr><td><b>Mitarbeiter:</b>&nbsp;</td>"
65                   + "<td><input type='text' name='mitarbeiter' id='mitarbeiter'></td>"
66                   + "</tr></table>";
67
68           var tempString = "";
69           function addForm(last, remove) {
70             if(last == "INIT") {
71               tempString = "<select id='selectForm'><option></option>";
72               for(i=0;i<defaults.length;i++) {
73                 tempString += "\<option value\=\'" + defaults[i] + "\'\ onClick=\"javascript:addForm(\'" + defaults[i] + "\', " + i + ");\">" + translated[defaults[i]] + "\<\/option\>" + "\n";
74               }
75               tempString += "</select>";
76               document.getElementById('selectEmployee').innerHTML = mitarbeiter;
77               document.getElementById('selectDate').innerHTML = jscalender;
78               document.getElementById('selectTable').innerHTML = tempString;
79
80               Calendar.setup(
81                     {
82                           inputField : "fromdate",
83                           ifFormat :"%d.%m.%Y",
84                           align : "BL",
85                           button : "trigger1"
86                       });
87
88                     Calendar.setup(
89                     {
90                           inputField : "todate",
91                           ifFormat :"%d.%m.%Y",
92                           align : "BL",
93                           button : "trigger2"
94                     });
95             }
96             else {
97               defaults.splice(remove,1);
98               document.getElementById('inputText').innerHTML += ((document.getElementById('inputText').innerHTML == "") ? ("<b>[%- 'You\'ve already chosen the following limitations:' | $T8 %]</b><br>") : ("<br>")) + translated[last];
99               if(defaults.length > 0) {
100                 document.getElementById('einschraenkungen').value += ((document.getElementById('einschraenkungen').value == "") ? ("") : (",")) + last;
101                 tempString = "<select id='selectForm'><option></option>";
102                 for(i=0;i<defaults.length;i++) {
103                   tempString += "\<option value\=\'" + defaults[i] + "\'\ onClick=\"javascript:addForm(\'" + defaults[i] + "\', " + i + ");\">" + translated[defaults[i]] + "\<\/option\>" + "\n";
104                 }
105                 tempString += "</select>";
106                 document.getElementById('selectTable').innerHTML = tempString;
107               }
108               else {
109                 document.getElementById('selectTable').innerHTML = "";
110               }
111             }
112           }
113
114           function resetAll() {
115             document.getElementById('selectTable').innerHTML = "<a href=\"javascript:addForm('INIT')\">[% 'Yes' | $T8 %]";
116             document.getElementById('inputText').innerHTML = "";
117           }
118           //-->
119         </script>
120         <table>
121           <tr>
122             <td>
123               [% '<b>What</b> do you want to look for?' | $T8 %]:
124             </td>
125             <td>
126               <select name="what2search" id="what2search">
127                 <option name="Artikelnummer" value="Artikelnummer" id="Artikelnummer">[% 'Part Number' | $T8 %]</option>
128                 <option name="Kundennummer" value="Kundennummer" id="Kundennummer">[% 'Customer Number' | $T8 %]</option>
129                 <option name="Lieferantennummer" value="Lieferantennummer" id="Lieferantennummer">[% 'Vendor Number' | $T8 %]</option>
130                 <option name="Projektnummer" value="Projektnummer" id="Projektnummer">[% 'Project Number' | $T8 %]</option>
131                 <option name="Buchungsnummer" value="Buchungsnummer" id="Buchungsnummer">[% 'ID' | $T8 %]</option>
132                 <option name="Eingangsrechnungnummer" value="Eingangsrechnungnummer" id="Eingangsrechnungnummer">[% 'Incoming invoice number' | $T8 %]</option>
133                 <option name="Ausgangsrechnungnummer" value="Ausgangsrechnungnummer" id="Ausgangsrechnungnummer">[% 'Sales invoice number' | $T8 %]</option>
134                 <option name="Mahnungsnummer" value="Mahnungsnummer" id="Mahnungsnummer">[% 'Dunning number' | $T8 %]</option>
135               </select>
136             </td>
137           </tr>
138           <tr>
139             <td>
140              [% 'What's the <b>term</b> you're looking for?' | $T8 %]
141             </td>
142             <td>
143               <input type="text" name="searchid" id="searchid" value="[% HTML.escape(searchid) %]">
144             </td>
145           </tr>
146           <tr>
147             <td valign="top">
148              [% 'Do you want to <b>limit</b> your search?' | $T8 %]
149             </td>
150             <td>
151               <table valign="top" cellpadding="0" marginheight="0" marginwidth="0" cellspacing="0" topmargin="0" leftmargin="0">
152                 <tr>
153                   <td>
154                     <div id="selectTable"><a href="javascript:addForm('INIT')">[% 'Yes' | $T8 %]</a></div>
155                     <div id="inputText"></div>
156                   </td>
157                 </tr>
158                 <tr>
159                   <td>
160                     <div id="selectEmployee"></div>
161                   </td>
162                 </tr>
163                 <tr>
164                   <td>
165                     <div id="selectDate"></div>
166                   </td>
167                 </tr>
168               </table>
169               <input type="hidden" name="einschraenkungen" id="einschraenkungen" value="">
170             </td>
171           </tr>
172           </tr>
173           <tr>
174             <td colspan="6">
175               <input type="submit" class="submit" value="[% 'submit' | $T8 %]">
176               <input type="reset" class="submit" value="[% 'reset' | $T8 %]" onClick="javascript:resetAll();">
177             </td>
178             <td>
179             </td>
180           </tr>
181         </table>
182       </td>
183     </tr>
184   </table>
185 </form>