Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a3efa54b

Von Tamino Steinert vor etwa 1 Jahr hinzugefügt

  • ID a3efa54bb0048d2005d3b71d690ae2ad0f3fba23
  • Vorgänger 26c1edec
  • Nachfolger 23dd3187

EmailJournal: Templates überarbeitet und Verknüpfte Belege hinzugefügt

Unterschiede anzeigen:

js/kivi.EmailJournal.js
11 11
    $.post("controller.pl", data, kivi.eval_json_result);
12 12
  }
13 13

  
14
  ns.update_extra_div_selection = function() {
15
    let record_action = $('#record_action').val();
16
    if (record_action == undefined) { return; }
14
  ns.update_customer_vendor_selection = function() {
15
    let customer_vendor = $('#customer_vendor_selection').val();
17 16

  
18 17
    $('#customer_div').hide();
18
    $('#customer_record_types_div').hide();
19 19
    $('#vendor_div').hide();
20
    $('#vendor_record_types_div').hide();
20 21

  
21
    $('#link_sales_quotation_div').hide();
22
    $('#link_sales_order_intake_div').hide();
23
    $('#link_sales_order_div').hide();
24
    $('#link_request_quotation_div').hide();
25
    $('#link_purchase_quotation_intake_div').hide();
26
    $('#link_purchase_order_div').hide();
27

  
28
    $('#placeholder_div').hide();
29

  
30
    // customer vendor
31
    if (record_action.match(/^customer/)) {
22
    if (customer_vendor == 'customer') {
32 23
      $('#customer_div').show();
33
    } else if (record_action.match(/^vendor/)) {
24
      $('#customer_record_types_div').show();
25
    } else { // if (customer_vendor == 'vendor')
34 26
      $('#vendor_div').show();
35
    // link
36
    } else if (record_action.match(/^link_/)) {
37
      $('#'+record_action+'_div').show();
38
    // placeholder
27
      $('#vendor_record_types_div').show();
28
    }
29
    kivi.EmailJournal.update_record_type_selection(customer_vendor);
30
  }
31

  
32
  ns.update_action_selection = function() {
33
    let record_action = $('#action_selection').val();
34

  
35
    $('#record_type_div').hide();
36
    $('#no_record_type_div').hide();
37

  
38
    if (record_action == 'create_new') {
39
      $('#no_record_type_div').show();
39 40
    } else {
40
      $('#placeholder_div').show();
41
      $('#record_type_div').show();
41 42
    }
42 43
  }
43 44

  
44
  ns.apply_record_action = function() {
45
    let record_action = $('#record_action').val();
46
    if (record_action == '') {
47
      alert(kivi.t8('Please select an action.'));
48
      return;
45
  ns.update_record_type_selection = function(customer_vendor) {
46
    let record_type = $('#' + customer_vendor + '_record_type_selection').val();
47

  
48
    $('.record_type').hide();
49
    if (record_type != '') {
50
      $('#' + record_type + '_div').show();
51
    } else {
52
      $('#record_type_placeholder_div').show();
49 53
    }
54
  }
50 55

  
56
  ns.apply_action_with_attachment = function() {
51 57
    let data = $('#record_action_form').serializeArray();
52 58
    data.push({ name: 'action', value: 'EmailJournal/apply_record_action' });
53 59

  
......
57 63

  
58 64
$(function() {
59 65
  kivi.EmailJournal.update_attachment_preview();
60
  kivi.EmailJournal.update_extra_div_selection();
61 66
});

Auch abrufbar als: Unified diff