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