Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ce1ca334

Von Werner Hahn vor etwa 7 Jahren hinzugefügt

  • ID ce1ca33441d60e07f4107c626c2396baf428d911
  • Vorgänger 55685c0d
  • Nachfolger 13e28674

Shopmodul: Artikel überarbeitet
Dinge aus Connector ausgelagert, die auch für andere Conectoren
gültigkeit haben
Output des Backgroundjob MassUpload überarbeitet
POD
Typo

Unterschiede anzeigen:

js/kivi.ShopPart.js
1 1
namespace('kivi.ShopPart', function(ns) {
2 2
  var $dialog;
3 3

  
4
  // this is called by sub render, with a certain prerendered html (edit.html,categories.html)
5 4
  ns.shop_part_dialog = function(title, html) {
6 5
    var id            = 'jqueryui_popup_dialog';
7 6
    var dialog_params = {
......
28 27
    $dialog.dialog("close");
29 28
  }
30 29

  
31

  
32
  // save existing shop_part_id with new params from form, calls create_or_update and saves to db
33 30
  ns.save_shop_part = function(shop_part_id) {
34 31
    var form = $('form').serializeArray();
35 32
    form.push( { name: 'action', value: 'ShopPart/update' }
......
41 38
    });
42 39
  }
43 40

  
44
  // add part to a shop
45 41
  ns.add_shop_part = function(part_id,shop_id) {
46 42
    var form = $('form').serializeArray();
47 43
    form.push( { name: 'action', value: 'ShopPart/update' }
......
51 47
    });
52 48
  }
53 49

  
54
  // this is called from tabs/_shop.html, opens edit_window (render)
55 50
  ns.edit_shop_part = function(shop_part_id) {
56 51
    $.post('controller.pl', { action: 'ShopPart/create_or_edit_popup', shop_part_id: shop_part_id }, function(data) {
57 52
      kivi.eval_json_result(data);
58 53
    });
59 54
  }
60 55

  
61
  // does the same as edit_shop_part (existing), but with part_id and shop_id, opens edit window (render)
62 56
  ns.create_shop_part = function(part_id, shop_id) {
63 57
    $.post('controller.pl', { action: 'ShopPart/create_or_edit_popup', part_id: part_id, shop_id: shop_id }, function(data) {
64 58
      kivi.eval_json_result(data);
65 59
    });
66 60
  }
67 61

  
68
  // gets all categories from the webshop
69 62
  ns.get_all_categories = function(shop_part_id) {
70
    //var form = new Array; //$('form').serializeArray();
71
    //form.push( { name: 'action', value: 'ShopPart/get_categories' }
72
    //         , { name: 'shop_part_id', value: shop_part_id }
73
    //);
74 63
    $.post('controller.pl', { action: 'ShopPart/get_categories', shop_part_id: shop_part_id }, function(data) {
75 64
      kivi.eval_json_result(data);
76 65
    });
77
    //$.post('controller.pl', form, function(data) {
78
    //  kivi.eval_json_result(data);
79
    //});
80 66
  }
81
  // write categories in kivi DB not in the shops DB TODO: create new categories in the shops db
67

  
82 68
  ns.save_categories = function(shop_part_id, shop_id) {
83 69
    var form = $('form').serializeArray();
84 70
    form.push( { name: 'action', value: 'ShopPart/save_categories' }
......
108 94
    $('#shop_images').load(url);
109 95
  }
110 96

  
111
  //shows the Name and price in _shop.html. Pricerules not implemented yet, just master_data and pricegroups
112 97
  ns.update_price_n_price_source = function(shop_part_id,price_source) {
113 98
    $.post('controller.pl', { action: 'ShopPart/show_price_n_pricesource', shop_part_id: shop_part_id, pricesource: price_source }, function(data) {
114 99
      kivi.eval_json_result(data);
115 100
    });
116 101
  }
117
  //shows the local and the online stock
102

  
118 103
  ns.update_stock = function(shop_part_id) {
119 104
    $.post('controller.pl', { action: 'ShopPart/show_stock', shop_part_id: shop_part_id }, function(data) {
120 105
      kivi.eval_json_result(data);

Auch abrufbar als: Unified diff