epic-s6ts
[kivitendo-erp.git] / templates / webpages / requirement_spec / _project_link_form.html
1 [%- USE LxERP -%][%- USE L -%]
2 [%- SET id_prefix = "project_link_form" %]
3 <form method="post" action="controller.pl" id="[% id_prefix %]"[% UNLESS submit_as == 'post' %] class="edit-project-link-context-menu"[% END %]>
4  <h2>[% LxERP.t8("Edit project link") %]</h2>
5
6  [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ "_id") %]
7
8  [% IF !SELF.requirement_spec.project_id %]
9   <p>[% LxERP.t8("This requirement spec is currently not linked to a project.") %]</p>
10
11  [% ELSE %]
12   <p>[% LxERP.t8("This requirement spec is currently linked to the following project:") %]</p>
13   [% INCLUDE "requirement_spec/_project_link_details.html" requirement_spec=SELF.requirement_spec %]
14  [% END %]
15
16  <table>
17   <tr><td colspan="2">[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_keep", value="keep", label=LxERP.t8("Keep the project link the way it is."), checked="1") %]</td></tr>
18   [% IF SELF.requirement_spec.project_id %]
19    <tr><td colspan="2">[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_none", value="none", label=LxERP.t8("Do not link to a project.")) %]</td></tr>
20   [% END %]
21   <tr><td colspan="2">[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_new", value="new", label=LxERP.t8("Create a new project and link to it.")) %]</td></tr>
22   <tr>
23    <td>[% L.radio_button_tag("project_link_action", id=id_prefix _ "_project_link_action_existing", value="existing", label=LxERP.t8("Link to the following project:")) %]</td>
24    <td>[% L.select_tag("new_project_id", SELF.projects, id=id_prefix _ "_new_project_id", title_key="full_description", disabled="true") %]</td>
25   </tr>
26  </table>
27
28  <p>
29   [% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update_project_link",  "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ "_submit") %]
30   <script type="text/javascript"><!--
31   $(function() {
32     $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
33       if(event.keyCode == 13) {
34         event.preventDefault();
35         $('#[% id_prefix %]_submit').click();
36         return false;
37       }
38     });
39
40     $('[name=project_link_action]').change(function() {
41       $('#[% id_prefix %]_new_project_id').prop('disabled', !$('#[% id_prefix %]_project_link_action_existing').prop('checked'));
42     });
43   });
44 --></script>
45  </p>
46 </form>