Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a78e5571

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID a78e5571e1d44369d292ce0946f954f217f3e909
  • Vorgänger 0af1d584
  • Nachfolger 36e45d3d

EmailJournal: Basisfunktionalität fürs Verlinken und Neu erstellen von Belegen

Unterschiede anzeigen:

js/kivi.EmailJournal.js
3 3

  
4 4
  ns.update_attachment_preview = function() {
5 5

  
6
    var data = $('#attachment_form').serializeArray();
6
    let data = $('#record_action_form').serializeArray();
7 7
    data.push({ name: 'action', value: 'EmailJournal/update_attachment_preview' });
8 8

  
9 9
    $.post("controller.pl", data, kivi.eval_json_result);
10 10
  }
11

  
12
  ns.update_extra_div_selection = function() {
13
    let record_action = $('#record_action').val();
14

  
15
    $('#customer_div').hide();
16
    $('#vendor_div').hide();
17

  
18
    $('#link_sales_quotation_div').hide();
19
    $('#link_sales_order_intake_div').hide();
20
    $('#link_sales_order_div').hide();
21
    $('#link_request_quotation_div').hide();
22
    $('#link_purchase_quotation_intake_div').hide();
23
    $('#link_purchase_order_div').hide();
24

  
25
    $('#placeholder_div').hide();
26

  
27
    // customer vendor
28
    if (record_action.match(/^customer/)) {
29
      $('#customer_div').show();
30
    } else if (record_action.match(/^vendor/)) {
31
      $('#vendor_div').show();
32
    // link
33
    } else if (record_action.match(/^link_/)) {
34
      $('#'+record_action+'_div').show();
35
    // placeholder
36
    } else {
37
      $('#placeholder_div').show();
38
    }
39
  }
40

  
41
  ns.apply_record_action = function() {
42
    let record_action = $('#record_action').val();
43
    if (record_action == '') {
44
      alert(kivi.t8('Please select an action.'));
45
      return;
46
    }
47

  
48
    let data = $('#record_action_form').serializeArray();
49
    data.push({ name: 'action', value: 'EmailJournal/apply_record_action' });
50

  
51
    $.post("controller.pl", data, kivi.eval_json_result);
52
  }
53
});
54

  
55
$(function() {
56
  kivi.EmailJournal.update_attachment_preview();
57
  kivi.EmailJournal.update_extra_div_selection();
11 58
});

Auch abrufbar als: Unified diff