GDPdU Export - erste Version
[kivitendo-erp.git] / templates / webpages / record_links / add_filter.html
index 39469f5..b2ee691 100644 (file)
@@ -1,6 +1,6 @@
 [%- USE L -%][%- USE LxERP -%][%- USE JavaScript -%]
 [%- SET style='width: 500px' %]
-<div class="listtop">[%- LxERP.t8("Add link: select records to link with") %]</div>
+<h1>[%- LxERP.t8("Add link: select records to link with") %]</h1>
 
 
 <form method="post" action="controller.pl">
@@ -31,9 +31,9 @@
    <td>[% L.input_tag('vc_name', is_sales ? SELF.object.customer.name : SELF.object.vendor.name, style=style) %]</td>
   </tr>
 
-  <tr>
+  <tr id="record_links_add_filter_project_row">
    <td>[%- LxERP.t8("Project") %]:</td>
-   <td>[% L.select_tag('project_id', PROJECTS, default=SELF.object.globalproject_id, with_empty=1, style=style) %]</td>
+   <td>[% L.select_tag('globalproject_id', PROJECTS, default=SELF.object.globalproject_id, with_empty=1, style=style) %]</td>
   </tr>
 
   <tr>
 <!--
 $(function() {
   $('#record_links_add input[name=vc_name]').focus();
-  $('#record_links_add_filter_link_type').change(function() {
-    var title = $('#record_links_add_filter_link_type').val() == 'requirement_spec' ? kivi.t8('Title') : kivi.t8('Transaction description');
-    $('#record_links_add_filter_title').html(title);
-  });
+  $('#record_links_add_filter_link_type').change(record_links_change_form_to_match_type);
+  record_links_change_form_to_match_type();
 });
 
 function record_links_reset_form() {
@@ -91,5 +89,21 @@ function add_selected_record_links() {
     }
   });
 }
+
+function record_links_change_form_to_match_type() {
+  var type  = $('#record_links_add_filter_link_type').val();
+  var title = type == 'requirement_spec' ? kivi.t8('Title')
+            : type == 'letter'           ? kivi.t8('Subject')
+            :                              kivi.t8('Transaction description');
+
+  if (type == 'letter') {
+    $('#record_links_add_filter_project_row').hide();
+
+  } else {
+    $('#record_links_add_filter_project_row').show();
+  }
+
+  $('#record_links_add_filter_title').html(title);
+}
 -->
 </script>