Git Repository Public Repository

namibia

URLs

Copy to Clipboard

Diff Revisions 6abb42 ... vs da65b1 ... for public/js/app/brochure-workspace/register.js

Diff revisions: vs.
  @@ -38,7 +38,7 @@
38 38 // {"value":"Turnover > R3,000,000", "label":"Turnover > R3,000,000"}
39 39 // ]);
40 40 App.DataStore.loadSelectListData('permissions', true, 'User', 'Permissions.SelectList');
41 - //App.DataStore.loadSelectListData('countries', true, 'Location', 'Country.SelectList');
41 + App.DataStore.loadSelectListData('countries', true, 'Location', 'Country.SelectList');
42 42 //App.DataStore.loadSelectListData('groups', true, 'Company', 'Group.SelectList');
43 43 //App.DataStore.loadSelectListData('foundmethods', true, 'Company', 'FoundMethod.SelectList');
44 44
  @@ -331,72 +331,72 @@
331 331 //
332 332 //
333 333 //// Adresses and billing contact
334 - //'country' : {
335 - // type : 'select',
336 - // id : 'country',
337 - // title : 'Country',
338 - // dataStoreId : 'countries',
339 - // value : '',
340 - // onChange : function () {
341 - // if (!App.DataStore.getItem('BuildSelect:country', false))
342 - // {
343 - // App.DataStore.loadSelectListData(
344 - // 'regions', false, 'Location', 'Region.SelectList', null,
345 - // {"Filter": {
346 - // "country" : $(this).val()
347 - // }}
348 - // );
349 - // App.DataStore.setData('cities', []);
350 - // if ($('#sameAsBusinessAddress').prop('checked'))
351 - // {
352 - // $('#billingCountry').selectpicker('val', $('#country').val());
353 - // }
354 - // }
355 - // }
356 - //},
357 - //'region' : {
358 - // type : 'select',
359 - // id : 'region',
360 - // title : 'Region',
361 - // dataStoreId : 'regions',
362 - // value : '',
363 - // onChange : function () {
364 - // if (!App.DataStore.getItem('BuildSelect:region', false))
365 - // {
366 - // App.DataStore.loadSelectListData(
367 - // 'cities', false, 'Location', 'Town.SelectList', null,
368 - // {"Filter": {
369 - // "region" : $(this).val()
370 - // }}
371 - // );
372 - // if ($('#sameAsBusinessAddress').prop('checked'))
373 - // {
374 - // $('#billingRegion').selectpicker('val', $('#region').val());
375 - // }
376 - // }
377 - // }
378 - //},
379 - //'city' : {
380 - // type : 'select',
381 - // id : 'city',
382 - // title : 'Town',
383 - // dataStoreId : 'cities',
384 - // value : ''
385 - //},
386 - //'street' : {
387 - // type : 'input',
388 - // id : 'street',
389 - // title : 'Street',
390 - // value : '',
391 - // maxlength : 75
392 - //},
393 - //'postalCode' : {
394 - // type : 'input',
395 - // id : 'postalCode',
396 - // title : 'Code',
397 - // value : '',
398 - // maxlength : 10
399 - //},
334 + 'country' : {
335 + type : 'select',
336 + id : 'country',
337 + title : 'Country',
338 + dataStoreId : 'countries',
339 + value : '',
340 + onChange : function () {
341 + if (!App.DataStore.getItem('BuildSelect:country', false))
342 + {
343 + App.DataStore.loadSelectListData(
344 + 'regions', false, 'Location', 'Region.SelectList', null,
345 + {"Filter": {
346 + "country" : $(this).val()
347 + }}
348 + );
349 + App.DataStore.setData('cities', []);
350 + if ($('#sameAsBusinessAddress').prop('checked'))
351 + {
352 + $('#billingCountry').selectpicker('val', $('#country').val());
353 + }
354 + }
355 + }
356 + },
357 + 'region' : {
358 + type : 'select',
359 + id : 'region',
360 + title : 'Region',
361 + dataStoreId : 'regions',
362 + value : '',
363 + onChange : function () {
364 + if (!App.DataStore.getItem('BuildSelect:region', false))
365 + {
366 + App.DataStore.loadSelectListData(
367 + 'cities', false, 'Location', 'Town.SelectList', null,
368 + {"Filter": {
369 + "region" : $(this).val()
370 + }}
371 + );
372 + if ($('#sameAsBusinessAddress').prop('checked'))
373 + {
374 + $('#billingRegion').selectpicker('val', $('#region').val());
375 + }
376 + }
377 + }
378 + },
379 + 'city' : {
380 + type : 'select',
381 + id : 'city',
382 + title : 'Town',
383 + dataStoreId : 'cities',
384 + value : ''
385 + },
386 + 'street' : {
387 + type : 'input',
388 + id : 'street',
389 + title : 'Street',
390 + value : '',
391 + maxlength : 75
392 + },
393 + 'postalCode' : {
394 + type : 'input',
395 + id : 'postalCode',
396 + title : 'Code',
397 + value : '',
398 + maxlength : 10
399 + },
400 400 //'sameAsBusinessAddress' : {
401 401 // type : 'checkbox',
402 402 // id : 'sameAsBusinessAddress',
  @@ -720,11 +720,11 @@
720 720 //companyRegistrationNumber: {companyReg: true},
721 721 //vatNumber: {digits: true},
722 722
723 - //country: {required: true},
724 - //region: {required: true},
725 - //city: {required: true},
726 - //street: {required: true},
727 - //postalCode: {required: true, digits: true},
723 + country: {required: true},
724 + region: {required: true},
725 + city: {required: true},
726 + street: {required: true},
727 + postalCode: {required: true, digits: true},
728 728 //billingCountry: {required: true},
729 729 //billingRegion: {required: true},
730 730 //billingCity: {required: true},
  @@ -793,15 +793,15 @@
793 793 "firstName","familyName","permissions","email","confirmEmail",
794 794 "pin","confirmPin","idNumber","dateOfBirth","mobile", "subscribeNewsletter"
795 795 ];
796 - //var companyFields = [
797 - // "dealerType","clientType","group","groupDivision","companyType",
798 - // "businessName","name","companyRegistrationNumber","vatNumber","turmiNumber",
799 - // "dealerStockNumber","turnover","foundMethod","foundMethodDetail",
800 - // "country","region","city","street","postalCode",
801 - // "billingCountry","billingRegion","billingCity","billingStreet","billingPostalCode",
802 - // "docStockCertificate","docAddressProof","docCopyOfId",
803 - // "docCopyOfDirectorId","docCompanyRegistration"
804 - // ];
796 + var companyFields = [
797 + //"dealerType","clientType","group","groupDivision","companyType",
798 + //"businessName","name","companyRegistrationNumber","vatNumber","turmiNumber",
799 + //"dealerStockNumber","turnover","foundMethod","foundMethodDetail",
800 + "country","region","city","street","postalCode",
801 + //"billingCountry","billingRegion","billingCity","billingStreet","billingPostalCode",
802 + //"docStockCertificate","docAddressProof","docCopyOfId",
803 + //"docCopyOfDirectorId","docCompanyRegistration"
804 + ];
805 805 var contactFields = {
806 806 "contactFirstName" : "firstName",
807 807 "contactFamilyName" : "familyName",
  @@ -818,11 +818,11 @@
818 818 };
819 819 for (var field in data)
820 820 {
821 - //if (-1 != companyFields.indexOf(field))
822 - //{
823 - // postData.Company[field] = '' != data[field] ? data[field] : null;
824 - //}
825 - //else
821 + if (-1 != companyFields.indexOf(field))
822 + {
823 + postData.Company[field] = '' != data[field] ? data[field] : null;
824 + }
825 + else
826 826 if (-1 != profileFields.indexOf(field))
827 827 {
828 828 postData.Profile[field] = '' != data[field] ? data[field] : null;