Verknüpfte Belege: beliebige Verknüpfungen hinzufügen können
[kivitendo-erp.git] / templates / webpages / record_links / add_filter.html
1 [%- USE L -%][%- USE LxERP -%][%- USE JavaScript -%]
2 [%- SET style='width: 500px' %]
3 <div class="listtop">[%- LxERP.t8("Add link: select records to link with") %]</div>
4
5
6 <form method="post" action="controller.pl">
7  [% L.hidden_tag('object_model',   SELF.object_model) %]
8  [% L.hidden_tag('object_id',      SELF.object_id) %]
9
10  <table>
11   <tr>
12    <td>[%- LxERP.t8("Link to") %]:</td>
13    <td>[% L.select_tag('link_type', LINK_TYPES, default=DEFAULT_LINK_TYPE, style=style) %]</td>
14   </tr>
15
16   <tr>
17    <td>[%- LxERP.t8("Link direction") %]:</td>
18    <td>[% L.select_tag('link_direction',
19                        [ [ 'from', LxERP.t8("The link target to add has been created from the existing record."), ],
20                          [ 'to',   LxERP.t8("The existing record has been created from the link target to add."), ], ],
21                        style=style) %]</td>
22   </tr>
23
24   <tr>
25    <td>[%- LxERP.t8("Customer/Vendor Number") %]:</td>
26    <td>[% L.input_tag('vc_number', is_sales ? SELF.object.customer.customernumber : SELF.object.vendor.vendornumber, style=style) %]</td>
27   </tr>
28
29   <tr>
30    <td>[%- LxERP.t8("Customer/Vendor Name") %]:</td>
31    <td>[% L.input_tag('vc_name', is_sales ? SELF.object.customer.name : SELF.object.vendor.name, style=style) %]</td>
32   </tr>
33
34   <tr>
35    <td>[%- LxERP.t8("Project") %]:</td>
36    <td>[% L.select_tag('project_id', PROJECTS, default=SELF.object.globalproject_id, with_empty=1, style=style) %]</td>
37   </tr>
38
39   <tr>
40    <td>[%- LxERP.t8("Transaction description") %]:</td>
41    <td>[% L.input_tag('transaction_description', '', style=style) %]</td>
42   </tr>
43  </table>
44
45  <p>
46   [% L.button_tag('filter_record_links()', LxERP.t8("Search")) %]
47   [% L.button_tag('add_selected_record_links()', LxERP.t8("Add links"), id='add_selected_record_links_button', disabled=1) %]
48   <a href="#" onclick="record_links_reset_form();">[%- LxERP.t8("Reset") %]</a>
49   <a href="#" onclick="record_links_cancel();">[% LxERP.t8("Cancel") %]</a>
50  </p>
51
52  <hr>
53
54  <div id="record_list_filtered_list"></div>
55
56 </form>
57
58 <script type="text/javascript">
59 <!--
60 $(function() {
61   $('.jqmWindow input[name=vc_name]').focus();
62 });
63
64 function record_links_reset_form() {
65   $('.jqmWindow form input[type=text]').val('');
66   $('.jqmWindow form select').prop('selectedIndex', 0);
67 }
68
69 function record_links_cancel() {
70   $('.jqmWindow').jqmHide();
71   $('.jqmWindow').remove();
72 }
73
74 function filter_record_links() {
75   var url="controller.pl?action=RecordLinks/ajax_add_list&" + $(".jqmWindow form").serialize();
76   $.ajax({
77     url: url,
78     success: function(new_data) {
79       $("#record_list_filtered_list").html(new_data['html']);
80       $('#add_selected_record_links_button').prop('disabled', new_data['count'] == 0);
81     }
82   });
83 }
84
85 function add_selected_record_links() {
86   var url="controller.pl?action=RecordLinks/ajax_add_do&" + $(".jqmWindow form").serialize();
87   $.ajax({
88     url: url,
89     success: function(new_html) {
90       $('#record_links_list').replaceWith(new_html);
91       record_links_cancel();
92     }
93   });
94 }
95 -->
96 </script>