Pflichtenhefte: Basisdaten verwalten, Such- und Listfunktion
[kivitendo-erp.git] / templates / webpages / requirement_spec / form.html
1 [% USE HTML %][% USE L %][% USE LxERP %]
2
3  <form method="post" action="controller.pl">
4   <div class="listtop">[% FORM.title %]</div>
5
6 [%- INCLUDE 'common/flash.html' %]
7
8   <table class="rs_input_field">
9    <tr>
10     <td>[% LxERP.t8("Title") %]</td>
11     <td>[% L.input_tag("requirement_spec.title", SELF.requirement_spec.description) %]</td>
12    </tr>
13
14    <tr>
15     <td>[% LxERP.t8("Requirement Spec Type") %]</td>
16     <td>[% L.select_tag("requirement_spec.type_id",  SELF.types, default=SELF.requirement_spec.type_id, title_key="description") %]</td>
17    </tr>
18
19    <tr>
20     <td>[% LxERP.t8("Requirement Spec Status") %]</td>
21     <td>[% L.select_tag("requirement_spec.status_id",  SELF.statuses, default=SELF.requirement_spec.status_id, title_key="description") %]</td>
22    </tr>
23
24    <tr>
25     <td>[% LxERP.t8("Customer") %]</td>
26     <td>[% L.select_tag("requirement_spec.customer_id",  SELF.customers, default=SELF.requirement_spec.customer_id, title_key="name", id="customer_id") %]</td>
27    </tr>
28
29    <tr>
30     <td>[% LxERP.t8("Hourly Rate") %]</td>
31     <td>[% L.input_tag("requirement_spec.hourly_rate_as_number", SELF.requirement_spec.hourly_rate_as_number, id="hourly_rate") %]</td>
32    </tr>
33
34   </table>
35
36   <p>
37    [% L.hidden_tag("id", SELF.requirement_spec.id) %]
38    [% L.hidden_tag("action", "RequirementSpec/dispatch") %]
39    [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save')) %]
40    [%- IF SELF.requirement_spec.id %]
41     [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?')) %]
42    [%- END %]
43    <a href="[% SELF.url_for(action="list") %]">[% LxERP.t8('Abort') %]</a>
44   </p>
45  </form>
46
47  <script type="text/javascript">
48   <!--
49     function on_customer_changed() {
50       $.ajax({
51         url: 'controller.pl?action=Customer/get_hourly_rate',
52         dataType: "json",
53         data: { id: $("#customer_id").attr('value') },
54         success: function(data) { if (data["hourly_rate"] > 0) $("#hourly_rate").attr("value", data["hourly_rate_formatted"]); }
55       });
56     }
57
58     $(document).ready(function() {
59       $("#customer_id").change(on_customer_changed);
60     });
61   -->
62  </script>