PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
popup
angular.module('ui.popup') .service('popup_customer', ['popup_product_option_combination','popup_product_bulk_price','$file_manager','communication','popup_form','$templateCache','$filter','$sce','popup_address','$dialog', function(popup_product_option_combination,popup_product_bulk_price,$file_manager,communication,popup_form,$templateCache,$filter, $sce,popup_address, $dialog) { this.open = function(opt) { opt = opt || {}; return popup_form.open({ name:'customer', data:opt.data, controller: function($scope) { $scope.data.password = ''; $scope.data.newsletter = $scope.data.newsletter || 0; $scope.data.group_id = $scope.data.group_id || 0; if($scope.data.group != undefined && $scope.data.group.inline_id != undefined) { $scope.data.group_id = $scope.data.group.inline_id; } if($scope.data.status == undefined ) $scope.data.status = 1; $scope.countries = []; communication.getList("country", {}, "ecommerce").then(function(json) { $scope.countries = json; }); $scope.groups = []; communication.getList("customer_group", {}, "ecommerce").then(function(json) { $scope.groups = json; }); $scope.to_trusted = function(html_code) { return $sce.trustAsHtml(html_code); } $scope.editAddress = function(address,index) { popup_address.open({ data: $.extend({},address, {customer_id:$scope.data.id}) }).result.then(function(json) { $scope.data.addresses[index] = angular.copy(json); }); } $scope.addAddress = function(address,index) { popup_address.open({ data: {customer_id:$scope.data.id,id:0} }).result.then(function(json) { $scope.data.addresses.splice(index,0, angular.copy(json)); }); } $scope.deleteAddress = function(address, index) { $dialog.confirm( { message:window.t('LBL_DELETE_CONFIRM_MESSAGE') }).result.then(function() { communication.api("deleteItem", {id:address.id}, "ecommerce.customer.address").then(function(json) { $scope.data.addresses.splice(index,1); }); }); } $scope.filterZoneList = function(index) { if(index == 1) $scope.data.zone_code=''; var country_code = $scope.data.country_code; $scope.filter_zones = []; for(var i in $scope.zones) { if(!$scope.zones[i]) continue; if($scope.zones[i].country_code == country_code) { $scope.filter_zones.push($scope.zones[i]); } } var country_code = ''; if($scope.data != undefined && $scope.data.customer != undefined && $scope.data.customer.country_code != undefined) { country_code = $scope.data.customer.country_code; } } $scope.zones = []; communication.getList("zone", {}, "ecommerce").then(function(json) { $scope.zones = json; $scope.filterZoneList(); }); }, size:'lg', execute_path:'ecommerce.customer.customer', form_name:'CustomerForm' }); } }]);
[+]
..
[-] profile.js
[edit]
[-] pagelist.js
[edit]
[-] order.js
[edit]
[-] customer_group.js
[edit]
[-] module_list.js
[edit]
[-] backgroundeditor.js
[edit]
[-] product.js
[edit]
[-] visualcsseditor.js
[edit]
[-] shipping_rule.js
[edit]
[-] profile_change_password.js
[edit]
[-] review.js
[edit]
[-] contributor_invite.js
[edit]
[-] dbfilter.js
[edit]
[-] tax_class.js
[edit]
[-] special_module_style_editor.js
[edit]
[-] idletimeout.js
[edit]
[-] address.js
[edit]
[-] contributor.js
[edit]
[-] login.js
[edit]
[-] skin.js
[edit]
[-] mail.js
[edit]
[-] discount.js
[edit]
[-] customer.js
[edit]
[-] productgrid.js
[edit]
[-] socialsharebuttonconfig.js
[edit]
[-] news.js
[edit]
[-] color.js
[edit]
[-] palette.js
[edit]
[-] newsgrid.js
[edit]
[-] product_option_combination_grid.js
[edit]
[-] page.js
[edit]
[-] product_option.js
[edit]
[-] tax_rate.js
[edit]
[-] coupons.js
[edit]
[-] zone.js
[edit]
[-] product_bulk_price.js
[edit]
[-] option_set.js
[edit]
[-] product_option_combination.js
[edit]