Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4cb932ab

Von Moritz Bunkus vor etwa 7 Jahren hinzugefügt

  • ID 4cb932aba73b8d72df10a1c0095228a10692536c
  • Vorgänger 665dd6ea
  • Nachfolger ac434895

ActionBar: Angebote/Aufträge: Lieferadresse via Popup bearbeiten

Unterschiede anzeigen:

js/kivi.SalesPurchase.js
134 134
      $.post('is.pl', data, kivi.eval_json_result);
135 135
    });
136 136
  };
137

  
138
  // Functions dialog with entering shipping addresses.
139
  this.shipto_addresses = [];
140

  
141
  this.copy_shipto_address = function () {
142
    var shipto = this.shipto_addresses[ $('#shipto_to_copy').val() ];
143
    for (var key in shipto)
144
      $('#' + key).val(shipto[key]);
145
  };
146

  
147
  this.clear_shipto_fields = function() {
148
    var shipto = this.shipto_addresses[0];
149
    for (var key in shipto)
150
      $('#' + key).val('');
151
    $('#shiptocp_gender').val('m');
152
  };
153

  
154
  this.clear_shipto_id_before_submit = function() {
155
    var shipto = this.shipto_addresses[0];
156
    for (var key in shipto)
157
      if ((key != 'shiptocp_gender') && ($('#' + key).val() !== '')) {
158
        $('#shipto_id').val('');
159
        break;
160
      }
161
  };
162

  
163
  this.setup_shipto_dialog = function() {
164
    var $dlg = $('#shipto_dialog');
165

  
166
    $('#shipto_dialog [name^="shipto"]').each(function(idx, elt) {
167
      $dlg.data("original-" + $(elt).prop("name"), $(elt).val());
168
    });
169

  
170
    $dlg.data('confirmed', false);
171

  
172
    $('#shiptoname').focus();
173
  };
174

  
175
  this.submit_custom_shipto = function() {
176
    $('#shipto_id').val('');
177
    $('#shipto_dialog').data('confirmed', true);
178
    $('#shipto_dialog').dialog('close');
179
  };
180

  
181
  this.reset_shipto_fields = function() {
182
    var $dlg = $('#shipto_dialog');
183

  
184
    $('#shipto_dialog [name^="shipto"]').each(function(idx, elt) {
185
      $(elt).val($dlg.data("original-" + $(elt).prop("name")));
186
    });
187
  };
188

  
189
  this.finish_shipto_dialog = function() {
190
    if (!$('#shipto_dialog').data('confirmed'))
191
      kivi.SalesPurchase.reset_shipto_fields();
192

  
193
    $('#shipto_dialog').children().remove().appendTo('#shipto_inputs');
194

  
195
    return true;
196
  };
197

  
198
  this.edit_custom_shipto = function() {
199
    $('#shipto_inputs').children().remove().appendTo('#shipto_dialog');
200

  
201
    kivi.popup_dialog({
202
      id:    'shipto_dialog',
203
      dialog: {
204
        height: 600,
205
        title:  kivi.t8('Edit custom shipto'),
206
        open:   kivi.SalesPurchase.setup_shipto_dialog,
207
        close:  kivi.SalesPurchase.finish_shipto_dialog,
208
      }
209
    });
210
  };
137 211
});

Auch abrufbar als: Unified diff