Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bf1c1594

Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt

  • ID bf1c1594a3120dbaaa4cf20cbedf5a2c72d14f58
  • Vorgänger e8ac38a6
  • Nachfolger e3f3d500

Pflichtenheftitems: Umstellung submit_ajax_form()

Unterschiede anzeigen:

js/requirement_spec.js
221 221
  return opt.$trigger.attr('id') != "section-list-empty";
222 222
}
223 223

  
224
function submit_edit_item_form(id_base) {
225
  var id   = $('#' + id_base + '_id').val();
226
  var url  = "controller.pl?" + $('#' + id_base + '_form').serialize();
227
  var data = {
228
    action:      'RequirementSpecItem/ajax_' + (id ? 'update' : 'create'),
229
    id:          id,
230
    form_prefix: id_base
231
  };
232
  $.post(url, data, eval_json_result);
233
  return true;
234
}
235

  
236 224
function cancel_edit_item_form(form_id_base, options) {
237 225
  $('#' + form_id_base + '_form').remove();
238 226
  if (!options)
templates/webpages/requirement_spec_item/_function_block_form.html
9 9
 [%- SET a_options = a_options _ "to_hide_if_empty: '#sub-function-block-container-" _ SELF.item.parent_id _ "'" %]
10 10
[%- END %]
11 11
<form method="post" id="[% id_base %]_form" class="function-block-form">
12
 [% L.hidden_tag(id_base _ '_id',                  SELF.item.id) %]
12
 [% L.hidden_tag('form_prefix',                    id_base,      id=id_base _ '_form_prefix') %]
13
 [% L.hidden_tag('id',                             SELF.item.id, id=id_base _ '_id') %]
13 14
 [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.item.requirement_spec_id) %]
14 15
 [% L.hidden_tag(id_base _ '.parent_id',           SELF.item.parent_id) %]
15 16
 [% IF insert_after %]
......
48 49
 </div>
49 50

  
50 51
 <p>
51
  [% L.button_tag('submit_edit_item_form("' _ id_base _ '")', LxERP.t8('Save')) %]
52
  [% L.ajax_submit_tag('controller.pl?action=RequirementSpecItem/ajax_' _ (SELF.item.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save')) %]
52 53
  <a href="#" onclick="cancel_edit_item_form('[% id_base %]', { [% a_options %] })">[%- LxERP.t8("Cancel") %]</a>
53 54
 </p>
54 55
</form>
templates/webpages/requirement_spec_item/_section_form.html
12 12

  
13 13
 [%- END %]
14 14

  
15
 [% L.hidden_tag(id_base _ '_id',                  SELF.item.id) %]
15
 [% L.hidden_tag('form_prefix',                    id_base       id=id_base _ '_form_prefix') %]
16
 [% L.hidden_tag('id',                             SELF.item.id, id=id_base _ '_id') %]
16 17
 [% L.hidden_tag(id_base _ '.requirement_spec_id', SELF.item.requirement_spec_id) %]
17 18
 [% IF insert_after %]
18 19
  [% L.hidden_tag(id_base _ '.insert_after',       insert_after) %]
......
29 30
 </p>
30 31

  
31 32
 <p>
32
  [% L.button_tag('submit_edit_item_form("' _ id_base _ '")', LxERP.t8('Save')) %]
33
  [% L.ajax_submit_tag('controller.pl?action=RequirementSpecItem/ajax_' _ (SELF.item.id ? 'update' : 'create'), '#' _ id_base _ '_form', LxERP.t8('Save')) %]
33 34
  <a href="#" onclick="cancel_edit_item_form('[% id_base %]', { to_show: '[% hidden %]' })">[%- LxERP.t8("Cancel") %]</a>
34 35
 </p>
35 36
</form>

Auch abrufbar als: Unified diff