Refactoring: L.button_tag("submit_ajax_form()") zu L.ajax_submit_tag()
[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
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.title, id=id_prefix _ '_title') %]</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", id=id_prefix _ '_type_id') %]</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", id=id_prefix _ '_status_id') %]</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=id_prefix _ '_customer_id',
27                        onchange="basic_settings_customer_changed('#" _ id_prefix _ "_customer_id', '#" _ id_prefix _ "_hourly_rate_as_number')") %]</td>
28   </tr>
29
30   <tr>
31    <td>[% LxERP.t8("Hourly Rate") %]</td>
32    <td>[% L.input_tag(form_prefix _ "hourly_rate_as_number", SELF.requirement_spec.hourly_rate_as_number, id=id_prefix _ '_hourly_rate_as_number') %]</td>
33   </tr>
34
35  </table>
36
37  <p>
38 [% IF submit_as == 'post' %]
39   [% L.hidden_tag("action", "RequirementSpec/dispatch", id=id_prefix _ '_action') %]
40   [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save'), id=id_prefix _ '_action_update') %]
41   [%- IF SELF.requirement_spec.id %]
42    [% L.submit_tag("action_destroy", LxERP.t8('Delete'), confirm=LxERP.t8('Do you really want to delete this object?'), id=id_prefix _ '_action_destroy') %]
43   [%- END %]
44   <a href="[% SELF.url_for(action="list") %]">[% LxERP.t8('Abort') %]</a>
45 [% ELSE %]
46   [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update",  "#" _ id_prefix, LxERP.t8("Save")) %]
47   [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/destroy", "#" _ id_prefix, LxERP.t8("Delete"), confirm=LxERP.t8("Do you really want to delete this object?")) %]
48 [% END %]
49  </p>
50 </form>