Pflichtenheftzeitschätzung: neuer Menüeintrag "Speichern und geöffnet lassen"
[kivitendo-erp.git] / templates / webpages / requirement_spec / _form.html
index e15d45d..dd760ed 100644 (file)
@@ -2,8 +2,9 @@
 [%- DEFAULT id_prefix = 'basic_settings_form'
             submit_as = 'post'
 %]
-<form method="post" action="controller.pl" id="[% id_prefix %]">
+<form method="post" action="controller.pl" id="[% id_prefix %]"[% UNLESS submit_as == 'post' %] class="edit-basic-settings-context-menu"[% END %]>
  [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ '_id') %]
+ [% L.hidden_tag("requirement_spec.is_template", SELF.requirement_spec.is_template, id=id_prefix _ '_is_template') %]
 
  <table class="rs_input_field">
   <tr>
@@ -11,6 +12,8 @@
    <td>[% L.input_tag("requirement_spec.title", SELF.requirement_spec.title, id=id_prefix _ '_title') %]</td>
   </tr>
 
+[%- UNLESS SELF.requirement_spec.is_template %]
+
   <tr>
    <td>[% LxERP.t8("Requirement Spec Type") %]</td>
    <td>[% L.select_tag("requirement_spec.type_id",  SELF.types, default=SELF.requirement_spec.type_id, title_key="description", id=id_prefix _ '_type_id') %]</td>
@@ -24,7 +27,7 @@
   <tr>
    <td>[% LxERP.t8("Customer") %]</td>
    <td>[% L.select_tag("requirement_spec.customer_id",  SELF.customers, default=SELF.requirement_spec.customer_id, title_key="name", id=id_prefix _ '_customer_id',
-                       onchange="basic_settings_customer_changed('#" _ id_prefix _ "_customer_id', '#" _ id_prefix _ "_hourly_rate_as_number')") %]</td>
+                       onchange="kivi.requirement_spec.basic_settings_customer_changed('#" _ id_prefix _ "_customer_id', '#" _ id_prefix _ "_hourly_rate_as_number')") %]</td>
   </tr>
 
   <tr>
@@ -32,6 +35,8 @@
    <td>[% L.input_tag("requirement_spec.hourly_rate_as_number", SELF.requirement_spec.hourly_rate_as_number, id=id_prefix _ '_hourly_rate_as_number') %]</td>
   </tr>
 
+[%- END %]
+
  </table>
 
 [%- IF SELF.copy_source %]
 [% IF submit_as == 'post' %]
   [% L.hidden_tag("action", "RequirementSpec/dispatch", id=id_prefix _ '_action') %]
   [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save'), id=id_prefix _ '_action_update') %]
-  <a href="[% SELF.url_for(action="list") %]">[% LxERP.t8('Abort') %]</a>
+  <a href="[% SELF.url_for(action="list", is_template=SELF.requirement_spec.is_template) %]">[% LxERP.t8('Abort') %]</a>
 [% ELSE %]
-  [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update",  "#" _ id_prefix, LxERP.t8("Save")) %]
+  [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update",  "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ '_submit') %]
+  <script type="text/javascript"><!--
+  $(function() {
+    $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
+      if(event.keyCode == 13) {
+        event.preventDefault();
+        $('#[% id_prefix %]_submit').click();
+        return false;
+      }
+    });
+  });
+--></script>
 [% END %]
  </p>
 </form>