Revision 6cbad8aa
Von Sven Schöling vor etwa 12 Jahren hinzugefügt
templates/webpages/common/search_history.html | ||
---|---|---|
1 | 1 |
[%- USE T8 %] |
2 |
[%- USE L %] |
|
2 | 3 |
[% USE HTML %]<style type="text/css">@import url(js/jscalendar/calendar-win2k-1.css);</style> |
3 | 4 |
<script type="text/javascript" src="js/jscalendar/calendar.js"></script> |
4 | 5 |
<script type="text/javascript" src="js/jscalendar/lang/calendar-de.js"></script> |
5 | 6 |
<script type="text/javascript" src="js/jscalendar/calendar-setup.js"></script> |
6 | 7 |
|
8 |
<h1>[% 'history search engine' | $T8 %]</h1> |
|
9 |
|
|
7 | 10 |
<form method="post" action="am.pl"> |
8 | 11 |
|
9 | 12 |
<input type="hidden" name="action" value="show_am_history"> |
10 | 13 |
|
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 %]: </b></td></tr>" |
|
57 |
+ "<tr><td>[% 'from (time)' | $T8 %]: " |
|
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 |
+ " </td><td>[% 'to (time)' | $T8 %]: " |
|
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> </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> |
|
14 |
<table> |
|
15 |
<tr> |
|
16 |
<td>[% '<b>What</b> do you want to look for?' | $T8 %]:</td> |
|
17 |
<td> |
|
18 |
<select name="what2search" id="what2search"> |
|
19 |
<option name="Artikelnummer" value="Artikelnummer" id="Artikelnummer">[% 'Part Number' | $T8 %]</option> |
|
20 |
<option name="Kundennummer" value="Kundennummer" id="Kundennummer">[% 'Customer Number' | $T8 %]</option> |
|
21 |
<option name="Lieferantennummer" value="Lieferantennummer" id="Lieferantennummer">[% 'Vendor Number' | $T8 %]</option> |
|
22 |
<option name="Projektnummer" value="Projektnummer" id="Projektnummer">[% 'Project Number' | $T8 %]</option> |
|
23 |
<option name="Buchungsnummer" value="Buchungsnummer" id="Buchungsnummer">[% 'ID' | $T8 %]</option> |
|
24 |
<option name="Eingangsrechnungnummer" value="Eingangsrechnungnummer" id="Eingangsrechnungnummer">[% 'Incoming invoice number' | $T8 %]</option> |
|
25 |
<option name="Ausgangsrechnungnummer" value="Ausgangsrechnungnummer" id="Ausgangsrechnungnummer">[% 'Sales invoice number' | $T8 %]</option> |
|
26 |
<option name="Mahnungsnummer" value="Mahnungsnummer" id="Mahnungsnummer">[% 'Dunning number' | $T8 %]</option> |
|
27 |
</select> |
|
28 |
</td> |
|
29 |
</tr> |
|
30 |
<tr> |
|
31 |
<td>[% 'What <b>term</b> you are looking for?' | $T8 %]</td> |
|
32 |
<td><input type="text" name="searchid" id="searchid" value="[% searchid | html %]"></td> |
|
33 |
</tr> |
|
34 |
<tr> |
|
35 |
<td valign="top">[% 'Do you want to <b>limit</b> your search?' | $T8 %]</td> |
|
36 |
<td> |
|
37 |
<table> |
|
38 |
<tr> |
|
39 |
<td> |
|
40 |
<div id="initForm"> |
|
41 |
<a id='show_extended_options' href='#'>[% 'Yes' | $T8 %]</a> |
|
42 |
</div> |
|
43 |
<div id="selectTable" style="display:none;"> |
|
44 |
<select id='selectForm'> |
|
135 | 45 |
</select> |
136 |
</td> |
|
137 |
</tr> |
|
138 |
<tr> |
|
139 |
<td> |
|
140 |
[% 'What <b>term</b> you are 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> |
|
46 |
</div> |
|
47 |
<div id="inputHead" style="display:none;"><b>[% 'You\'ve already chosen the following limitations:' | $T8 %]</b></div> |
|
48 |
<div id="inputText" style="display:none;"></div> |
|
49 |
</td> |
|
50 |
</tr> |
|
51 |
<tr> |
|
52 |
<td> |
|
53 |
<div id="selectEmployee" style="display:none;"> |
|
54 |
<b>Mitarbeiter:</b> <input type="text" name="mitarbeiter" id="mitarbeiter"> |
|
55 |
</div> |
|
56 |
</td> |
|
57 |
</tr> |
|
58 |
<tr> |
|
59 |
<td> |
|
60 |
<div id="selectDate" style="display:none;"> |
|
61 |
<b>[% 'Period' | $T8 %]: </b> |
|
62 |
[% 'from (time)' | $T8 %]: [% L.date_tag('fromdate', todate) %] |
|
63 |
[% 'to (time)' | $T8 %]: [% L.date_tag('todate', todate) %] |
|
64 |
</div> |
|
65 |
</td> |
|
66 |
</tr> |
|
67 |
</table> |
|
68 |
<input type="hidden" name="einschraenkungen" id="einschraenkungen" value=""> |
|
69 |
</td> |
|
70 |
</tr> |
|
71 |
</table> |
|
72 |
|
|
73 |
<hr> |
|
74 |
<input type="submit" class="submit" value="[% 'submit' | $T8 %]"> |
|
75 |
<input type="reset" class="submit" value="[% 'reset' | $T8 %]" id='reset_button'> |
|
76 |
|
|
185 | 77 |
</form> |
78 |
|
|
79 |
<script type="text/javascript"> |
|
80 |
<!-- |
|
81 |
var defaults = ['SAVED', 'DELETED', 'ADDED', 'PAYMENT POSTED', 'POSTED', 'POSTED AS NEW', 'SAVED FOR DUNNING', 'DUNNING STARTED', 'PRINTED']; |
|
82 |
var available; |
|
83 |
var selected; |
|
84 |
var translated = { |
|
85 |
'SAVED' : '[% 'SAVED' | $T8 %]', |
|
86 |
'DELETED' : '[% 'DELETED' | $T8 %]', |
|
87 |
'ADDED' : '[% 'ADDED' | $T8 %]', |
|
88 |
'PAYMENT POSTED' : '[% 'PAYMENT POSTED' | $T8 %]', |
|
89 |
'POSTED' : '[% 'POSTED' | $T8 %]', |
|
90 |
'POSTED AS NEW' : '[% 'POSTED AS NEW' | $T8 %]', |
|
91 |
'SAVED FOR DUNNING' : '[% 'SAVED FOR DUNNING' | $T8 %]', |
|
92 |
'DUNNING STARTED' : '[% 'DUNNING STARTED' | $T8 %]', |
|
93 |
'PRINTED' : '[% 'PRINTED' | $T8 %]', |
|
94 |
}; |
|
95 |
|
|
96 |
function addForm(index) { |
|
97 |
$('#inputHead').show(); |
|
98 |
selected.push(available.splice(index, 1)); |
|
99 |
$('#inputText').html($(selected).map(function(){ return translated[this]; }).get().join('<br>')); |
|
100 |
$('#einschraenkungen').val(selected.join(',')); |
|
101 |
|
|
102 |
showForm(); |
|
103 |
} |
|
104 |
|
|
105 |
function showForm() { |
|
106 |
$('#selectForm').empty(); |
|
107 |
$('<option/>').appendTo('#selectForm'); |
|
108 |
$(available).map(function(){ |
|
109 |
$('<option/>').val(this).text(translated[this]).click(function(){ addForm(this) }).appendTo('#selectForm'); |
|
110 |
}); |
|
111 |
} |
|
112 |
|
|
113 |
function resetAll() { |
|
114 |
available = defaults.slice(0); |
|
115 |
selected = []; |
|
116 |
initForm(); |
|
117 |
|
|
118 |
$('#inputForm').empty(); |
|
119 |
$('#inputText').html(''); |
|
120 |
$('#selectTable, #inputHead, #inputText, #selectEmployee, #selectDate').hide(); |
|
121 |
$('#initForm').show(); |
|
122 |
} |
|
123 |
|
|
124 |
function initForm() { |
|
125 |
showForm(); |
|
126 |
|
|
127 |
$('#selectTable, #inputText, #selectEmployee, #selectDate').show(); |
|
128 |
$('#initForm').hide(); |
|
129 |
} |
|
130 |
|
|
131 |
$(function(){ |
|
132 |
resetAll(); |
|
133 |
$('#show_extended_options').click(initForm); |
|
134 |
$('#reset_button').click(resetAll); |
|
135 |
}); |
|
136 |
//--> |
|
137 |
</script> |
|
138 |
|
|
139 |
</body> |
|
140 |
</html> |
Auch abrufbar als: Unified diff
Historiensuchmaschine von date Magic befreit
War ursprünglich Teil von 46bc75c8079099de22ccbc6281b04f42ade67f1a.
Das Javascript hatte noch ein paar Bugs, die sollten damit behoben sein.