Auswahlliste bei Langtext verbessert
[kivitendo-erp.git] / templates / webpages / io / select_item.html
1 [% USE LxERP %][% USE HTML %][% USE L %][% USE P %]
2 <h1>[% title %]</h1>
3
4  <form method="post" action="[% HTML.escape(script) %]">
5
6   <table width="100%">
7    <tr class="listheading">
8     [%- IF MYCONFIG.item_multiselect %]
9       <th>[% LxERP.t8('Qty') %]</th>
10     [%- ELSE %]
11       <th>&nbsp;</th>
12     [%- END %]
13     <th>[% LxERP.t8('Number') %]</th>
14     <th>[% LxERP.t8('Part Description') %]</th>
15     [%- IF INSTANCE_CONF.get_show_longdescription_select_item %]
16       <th>[% LxERP.t8('Long Description') %]</th>
17     [%- END %]
18     <th>[% LxERP.t8('Other Matches') %]</th>
19     <th>[% LxERP.t8('Price') %]</th>
20     [%- IF IS_PURCHASE %]
21      <th>[% LxERP.t8('ROP') %]</th>
22     [%- END %]
23     <th>[% LxERP.t8('Qty') %]</th>
24     <th>[% LxERP.t8('Unit') %]</th>
25    </tr>
26
27    [%- FOREACH item = ITEM_LIST %]
28    <tr class="listrow[% loop.count % 2 %]">
29     [%- IF MYCONFIG.item_multiselect %]
30       <td>[% L.input_tag('select_qty_' _ HTML.escape(item.id), '', size => 5) %]</td>
31     [%- ELSE %]
32       <td><input name="select_item_id" class="radio" type="radio" value="[% HTML.escape(item.id) %]"[% IF loop.first %] checked[% END %]></td>
33     [%- END %]
34     <td>[% HTML.escape(item.partnumber) %]</td>
35     <td>[% HTML.escape(item.description) %]</td>
36     [%- IF INSTANCE_CONF.get_show_longdescription_select_item %]
37       <td>[% P.restricted_html(item.longdescription) %]</td>
38     [%- END %]
39     <td>[% HTML.escape(item.matches).join('<br>') %]</td>
40     <td align="right">[% LxERP.format_amount(item.display_sellprice, 2) %]</td>
41     [%- IF IS_PURCHASE %]
42      <td align="right">[% LxERP.format_amount(item.rop, '') %]</td>
43     [%- END %]
44     <td align="right">[% LxERP.format_amount(item.onhand, '') %]</td>
45     <td>[% HTML.escape(item.unit) %]</td>
46    </tr>
47    [%- END %]
48
49    <tr><td colspan="8"><hr size="3" noshade></td></tr>
50   </table>
51
52   [% L.hidden_tag('select_item_mode', MODE) %]
53   [% L.hidden_tag('select_item_previous_form', PREVIOUS_FORM) %]
54   [% L.hidden_tag('nextsub', 'item_selected') %]
55
56   [% L.submit_tag('action', LxERP.t8('Continue')) %]
57  </form>
58
59 [%- IF MYCONFIG.item_multiselect %]
60  <script type='text/javascript'>
61    var first_click = 1;;
62    [%- FOREACH item = ITEM_LIST %]
63      [% SET THIS_ID = 'select_qty_' _ HTML.escape(item.id) %]
64      $('#[% THIS_ID %]').click(function(){
65        var qty = '1';
66        if (first_click) {
67          qty = '[% LxERP.format_amount(PRE_ENTERED_QTY, 5) %]';
68        }
69        first_click = 0;
70        if ($('#[% THIS_ID %]').attr('value') == '') {
71          $('#[% THIS_ID %]').attr('value', qty); $('#[% THIS_ID %]').select();
72        }
73      });
74    [%- END %]
75  </script>
76 [%- END %]