ea70c3652197c232847dc963b90cb8f8c5e8f7b5
[kivitendo-erp.git] / templates / webpages / generic / select_vendor.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 <body onload="[%- onload %]">
4
5  <form name="Form">
6
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
10   <div class="listtop">[% title %]</div>
11
12   <table width="100%">
13    <tr height="5"></tr>
14
15    <tr><td>[% 'Please select a vendor from the list below.' | $T8 %]</td></tr>
16
17    <tr>
18     <td>
19
20      <table>
21       <tr class="listheading">
22        <th class="listheading">&nbsp;</th>
23        [%- FOREACH col = HEADER %]
24        <th nowrap class="listheading"><a href="[% HTML.escape(col.callback) %]">[% col.column_title %]</a></th>
25        [%- END %]
26       </tr>
27
28       [%- FOREACH row = VENDOR %]
29       <tr class="listrow[% loop.count % 2 %]">
30        <td><button type="button" onclick="vendor_selected('[% loop.count %]')">Auswahl</button></td>
31        <td>
32         <input type="hidden" id="id_[% loop.count %]" name="id_[% loop.count %]" value="[% HTML.escape(row.id) %]">
33         <input type="hidden" id="name_[% loop.count %]" name="name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
34         [% HTML.escape(name) %]
35        </td>
36        <td>[% HTML.escape(row.customernumber) %]</td>
37        <td>[% HTML.escape(row.address) %]</td>
38 <!--        <td> -->
39 <!--         <input type="hidden" id="description_[% loop.count %]" name="description_[% loop.count %]" value="[% HTML.escape(row.description) %]"> -->
40 <!--         [% HTML.escape(row.description) %] -->
41 <!--        </td> -->
42       </tr>
43       [%- END %]
44      </table>
45
46     </td>
47    </tr>
48   </table>
49
50  </form>
51
52  <script type="text/javascript">
53   <!--
54       function vendor_selected(selected) {
55         var name = document.getElementsByName("name_" + selected)[0].value
56         var id = document.getElementsByName("id_" + selected)[0].value
57         window.opener.document.getElementsByName(document.Form.input_name.value)[0].value = name;
58         if (document.Form.input_id.value != "") {
59           window.opener.document.getElementsByName(document.Form.input_id.value)[0].value = id;
60         }
61         self.close();
62       }
63       //-->
64  </script>
65
66 </body>