3 <body[% IF onload %] onload="[% onload %]"[% END %]>
7 <input type="hidden" name="input_name" value="[% HTML.escape(input_name) %]">
8 <input type="hidden" name="input_id" value="[% HTML.escape(input_id) %]">
9 <input type="hidden" name="is_vendor" value="[% HTML.escape(is_vendor) %]">
10 <input type="hidden" name="allow_both" value="[% HTML.escape(allow_both) %]">
11 <input type="hidden" name="action_on_cov_selected" value="[% HTML.escape(action_on_cov_selected) %]">
15 <th class="listtop">[% title %]</th>
22 [% 'Please select a customer from the list below.' | $T8 %]
24 [% 'Please select a vendor from the list below.' | $T8 %]
33 <tr class="listheading">
34 <th class="listheading"> </th>
35 [%- FOREACH row = HEADER %]
36 <th nowrap class="listheading"><a href="[% HTML.escape(row.callback) %]">[% row.column_title %]</a></th>
40 [%- FOREACH row = COVS %]
41 <tr class="listrow[% loop.count % 2 %]">
42 <td valign="top"><button type="button" onclick="cov_selected('[% loop.count %]')">Auswahl</button></td>
43 <td valign="top"><input type="hidden" id="id_[% loop.count %]" name="id_[% loop.count %]" value="[% HTML.escape(row.id) %]">
44 <input type="hidden" id="name_[% loop.count %]" name="name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
45 <input type="hidden" id="customer_is_vendor_[% loop.count %]" name="customer_is_vendor_[% loop.count %]" value="[% HTML.escape(row.customer_is_vendor) %]">
46 [% HTML.escape(row.name) %]</td>
47 <td valign="top">[% HTML.escape(row.address) %]</td>
48 <td valign="top">[% HTML.escape(row.contact) %]</td>
59 <script type="text/javascript">
61 function cov_selected(selected) {
62 var name = document.getElementsByName("name_" + selected)[0].value
63 var id = document.getElementsByName("id_" + selected)[0].value
64 var customer_is_vendor = document.getElementsByName("customer_is_vendor_" + selected)[0].value
65 var cov_name = document.forms[0].input_name.value;
66 window.opener.document.getElementsByName(cov_name)[0].value = name;
67 if (document.forms[0].input_id.value != "") {
68 window.opener.document.getElementsByName(document.forms[0].input_id.value)[0].value = id;
71 var cov_is_vendor = cov_name + "_is_vendor";
72 var input = window.opener.document.getElementsByName(cov_is_vendor)[0];
74 input.value = customer_is_vendor;
78 if (cov_name.substr(0, 2) == "f_") {
80 cov_name = cov_name.substr(2);
82 cov_name = prefix + "old_" + cov_name;
83 var input = window.opener.document.getElementsByName(cov_name)[0];
87 cov_name = prefix + "old" + cov_name;
88 input = window.opener.document.getElementsByName(cov_name)[0];
93 if (document.forms[0].action_on_cov_selected.value != "") {
94 window.opener.document.getElementsByName("action")[0].value = document.forms[0].action_on_cov_selected.value;
95 window.opener.document.forms[0].submit();