Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision e8ac38a6

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID e8ac38a63f43c43b30cdf45bd877e39bf0fd41b1
  • Vorgänger 91dc1ae9
  • Nachfolger bf1c1594

Pflichtenhefttextblöcke: Umstellung submit_ajax_form()

Unterschiede anzeigen:

js/requirement_spec.js
159 159
  return true;
160 160
}
161 161

  
162
function submit_edit_text_block_form(id_base) {
163
  var id   = $('#' + id_base + '_id').val();
164
  var url  = "controller.pl?" + $('#' + id_base + '_form').serialize();
165
  var data = {
166
    action:      'RequirementSpecTextBlock/ajax_' + (id ? 'update' : 'create'),
167
    id:          id,
168
    form_prefix: id_base
169
  };
170
  $.post(url, data, eval_json_result);
171
  return true;
172
}
173

  
174 162
function cancel_edit_text_block_form(id_base) {
175 163
  var id = $('#' + id_base + '_id').val();
176 164
  $('#' + id_base + '_form').remove();
templates/webpages/requirement_spec_text_block/_form.html
10 10
  [%- END %]
11 11
 </h2>
12 12

  
13
 [% L.hidden_tag(id_base _ '_id',                  SELF.text_block.id) %]
13
 [% L.hidden_tag('form_prefix',                    id_base,            id=id_base _ '_form_prefix') %]
14
 [% L.hidden_tag('id',                             SELF.text_block.id, id=id_base _ '_id') %]
14 15
 [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.text_block.requirement_spec_id) %]
15 16
 [% L.hidden_tag(id_base _ '.output_position',     SELF.text_block.output_position) %]
16 17
 [% IF insert_after %]
......
40 41
 </table>
41 42

  
42 43
 <p>
43
  [% L.button_tag('submit_edit_text_block_form("' _ id_base _ '")', LxERP.t8('Save')) %]
44
  [%- L.ajax_submit_tag('controller.pl?action=RequirementSpecTextBlock/ajax_' _ (SELF.text_block.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save')) %]
44 45
  <a href="#" onclick="cancel_edit_text_block_form('[% id_base %]')">[%- LxERP.t8("Cancel") %]</a>
45 46
 </p>
46 47

  

Auch abrufbar als: Unified diff