From e8ac38a63f43c43b30cdf45bd877e39bf0fd41b1 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 13 Mar 2013 17:34:13 +0100 Subject: [PATCH] =?utf8?q?Pflichtenhefttextbl=C3=B6cke:=20Umstellung=20sub?= =?utf8?q?mit=5Fajax=5Fform()?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- js/requirement_spec.js | 12 ------------ .../webpages/requirement_spec_text_block/_form.html | 5 +++-- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/js/requirement_spec.js b/js/requirement_spec.js index cec409777..c4daca447 100644 --- a/js/requirement_spec.js +++ b/js/requirement_spec.js @@ -159,18 +159,6 @@ function standard_text_block_ajax_call(key, opt, other_data) { return true; } -function submit_edit_text_block_form(id_base) { - var id = $('#' + id_base + '_id').val(); - var url = "controller.pl?" + $('#' + id_base + '_form').serialize(); - var data = { - action: 'RequirementSpecTextBlock/ajax_' + (id ? 'update' : 'create'), - id: id, - form_prefix: id_base - }; - $.post(url, data, eval_json_result); - return true; -} - function cancel_edit_text_block_form(id_base) { var id = $('#' + id_base + '_id').val(); $('#' + id_base + '_form').remove(); diff --git a/templates/webpages/requirement_spec_text_block/_form.html b/templates/webpages/requirement_spec_text_block/_form.html index 5637b2f97..8a8a6d354 100644 --- a/templates/webpages/requirement_spec_text_block/_form.html +++ b/templates/webpages/requirement_spec_text_block/_form.html @@ -10,7 +10,8 @@ [%- END %] - [% L.hidden_tag(id_base _ '_id', SELF.text_block.id) %] + [% L.hidden_tag('form_prefix', id_base, id=id_base _ '_form_prefix') %] + [% L.hidden_tag('id', SELF.text_block.id, id=id_base _ '_id') %] [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.text_block.requirement_spec_id) %] [% L.hidden_tag(id_base _ '.output_position', SELF.text_block.output_position) %] [% IF insert_after %] @@ -40,7 +41,7 @@

- [% L.button_tag('submit_edit_text_block_form("' _ id_base _ '")', LxERP.t8('Save')) %] + [%- L.ajax_submit_tag('controller.pl?action=RequirementSpecTextBlock/ajax_' _ (SELF.text_block.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save')) %] [%- LxERP.t8("Cancel") %]

-- 2.20.1