From bf1c1594a3120dbaaa4cf20cbedf5a2c72d14f58 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 13 Mar 2013 17:51:44 +0100 Subject: [PATCH] Pflichtenheftitems: Umstellung submit_ajax_form() --- js/requirement_spec.js | 12 ------------ .../requirement_spec_item/_function_block_form.html | 5 +++-- .../requirement_spec_item/_section_form.html | 5 +++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/js/requirement_spec.js b/js/requirement_spec.js index c4daca447..ac96fc2ad 100644 --- a/js/requirement_spec.js +++ b/js/requirement_spec.js @@ -221,18 +221,6 @@ function disable_add_function_block_command(key, opt) { return opt.$trigger.attr('id') != "section-list-empty"; } -function submit_edit_item_form(id_base) { - var id = $('#' + id_base + '_id').val(); - var url = "controller.pl?" + $('#' + id_base + '_form').serialize(); - var data = { - action: 'RequirementSpecItem/ajax_' + (id ? 'update' : 'create'), - id: id, - form_prefix: id_base - }; - $.post(url, data, eval_json_result); - return true; -} - function cancel_edit_item_form(form_id_base, options) { $('#' + form_id_base + '_form').remove(); if (!options) diff --git a/templates/webpages/requirement_spec_item/_function_block_form.html b/templates/webpages/requirement_spec_item/_function_block_form.html index 5869fc96f..cdf25283a 100644 --- a/templates/webpages/requirement_spec_item/_function_block_form.html +++ b/templates/webpages/requirement_spec_item/_function_block_form.html @@ -9,7 +9,8 @@ [%- SET a_options = a_options _ "to_hide_if_empty: '#sub-function-block-container-" _ SELF.item.parent_id _ "'" %] [%- END %]
- [% L.hidden_tag(id_base _ '_id', SELF.item.id) %] + [% L.hidden_tag('form_prefix', id_base, id=id_base _ '_form_prefix') %] + [% L.hidden_tag('id', SELF.item.id, id=id_base _ '_id') %] [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.item.requirement_spec_id) %] [% L.hidden_tag(id_base _ '.parent_id', SELF.item.parent_id) %] [% IF insert_after %] @@ -48,7 +49,7 @@

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

diff --git a/templates/webpages/requirement_spec_item/_section_form.html b/templates/webpages/requirement_spec_item/_section_form.html index 1136fc806..30a5c5b14 100644 --- a/templates/webpages/requirement_spec_item/_section_form.html +++ b/templates/webpages/requirement_spec_item/_section_form.html @@ -12,7 +12,8 @@ [%- END %] - [% L.hidden_tag(id_base _ '_id', SELF.item.id) %] + [% L.hidden_tag('form_prefix', id_base id=id_base _ '_form_prefix') %] + [% L.hidden_tag('id', SELF.item.id, id=id_base _ '_id') %] [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.item.requirement_spec_id) %] [% IF insert_after %] [% L.hidden_tag(id_base _ '.insert_after', insert_after) %] @@ -29,7 +30,7 @@

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

-- 2.20.1