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>
6 [% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ "_id") %]
8 [% IF !SELF.requirement_spec.project_id %]
9 <p>[% LxERP.t8("This requirement spec is currently not linked to a project.") %]</p>
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 %]
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>
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>
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>
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"><!--
32 $("#[% id_prefix %] INPUT[type=text]").keydown(function(event) {
33 if(event.keyCode == 13) {
34 event.preventDefault();
35 $('#[% id_prefix %]_submit').click();
40 $('[name=project_link_action]').change(function() {
41 $('#[% id_prefix %]_new_project_id').prop('disabled', !$('#[% id_prefix %]_project_link_action_existing').prop('checked'));