326026345954b57c7b56bf636665451db0da6373
[kivitendo-erp.git] / templates / webpages / requirement_spec / _form.html
1 [%- USE LxERP -%][%- USE L -%]
2 [%- DEFAULT id_prefix = 'basic_settings_form'
3             submit_as = 'post'
4 %]
5 <form method="post" action="controller.pl" id="[% id_prefix %]">
6  [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ '_id') %]
7  [% L.hidden_tag("requirement_spec.is_template", SELF.requirement_spec.is_template, id=id_prefix _ '_is_template') %]
8
9  <table class="rs_input_field">
10   <tr>
11    <td>[% LxERP.t8("Title") %]</td>
12    <td>[% L.input_tag("requirement_spec.title", SELF.requirement_spec.title, id=id_prefix _ '_title') %]</td>
13   </tr>
14
15 [%- UNLESS SELF.requirement_spec.is_template %]
16
17   <tr>
18    <td>[% LxERP.t8("Requirement Spec Type") %]</td>
19    <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>
20   </tr>
21
22   <tr>
23    <td>[% LxERP.t8("Requirement Spec Status") %]</td>
24    <td>[% L.select_tag("requirement_spec.status_id",  SELF.statuses, default=SELF.requirement_spec.status_id, title_key="description", id=id_prefix _ '_status_id') %]</td>
25   </tr>
26
27   <tr>
28    <td>[% LxERP.t8("Customer") %]</td>
29    <td>[% L.select_tag("requirement_spec.customer_id",  SELF.customers, default=SELF.requirement_spec.customer_id, title_key="name", id=id_prefix _ '_customer_id',
30                        onchange="kivi.requirement_spec.basic_settings_customer_changed('#" _ id_prefix _ "_customer_id', '#" _ id_prefix _ "_hourly_rate_as_number')") %]</td>
31   </tr>
32
33   <tr>
34    <td>[% LxERP.t8("Hourly Rate") %]</td>
35    <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>
36   </tr>
37
38 [%- END %]
39
40  </table>
41
42 [%- IF SELF.copy_source %]
43  [%- L.hidden_tag('copy_source_id', SELF.copy_source.id) %]
44
45  <p>
46   [%- LxERP.t8("The new requirement spec will be a copy of '#1' for customer '#2'.", SELF.copy_source.title, SELF.copy_source.customer.name) %]
47  </p>
48 [%- END %]
49
50  <p>
51 [% IF submit_as == 'post' %]
52   [% L.hidden_tag("action", "RequirementSpec/dispatch", id=id_prefix _ '_action') %]
53   [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save'), id=id_prefix _ '_action_update') %]
54   <a href="[% SELF.url_for(action="list", is_template=SELF.requirement_spec.is_template) %]">[% LxERP.t8('Abort') %]</a>
55 [% ELSE %]
56   [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update",  "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ '_submit') %]
57   <script type="text/javascript"><!--
58   $(function() {
59     $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
60       if(event.keyCode == 13) {
61         event.preventDefault();
62         $('#[% id_prefix %]_submit').click();
63         return false;
64       }
65     });
66   });
67 --></script>
68 [% END %]
69  </p>
70 </form>