PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
ecommerce
/
customer
define([], function() { return function($scope, communication, popup_customer,$dialog,$state,$uibModalStack) { var statuses = [ t('LBL_CUSTOMER_UNREGISTERED'), t('LBL_CUSTOMER_REGISTERED') ]; $scope.gridInstance={}; $scope.add = function() { popup_customer.open().result.then(function(data) { if($state.current.name =='ecommerce.customer.customer.view') $state.go('ecommerce.customer.customer'); communication.removeList('customer'); $scope.gridInstance.instance.reloadData(); }); } $scope.delete = function() { var rows = $scope.gridInstance.selections; if(rows.length > 0) { $dialog.confirm({ title:'', message:window.t('LBL_DELETE_PRODUCTS_CONFIRM_MESSAGE') }).result.then(function() { communication.api('deleteItems', {ids:rows},'ecommerce.customer.customer').then(function() { communication.removeList('customer'); $scope.gridInstance.instance.reloadData(); }); }); } } $scope.RowButtonClickHandler = { edit : function(id) { communication.api('getFormData',{name:'customer', id:id}).then(function(data) { popup_customer.open( { data:data }).result.then(function(data) { if($state.current.name =='ecommerce.customer.customer.view') $state.go('ecommerce.customer.customer'); communication.removeList('customer'); $scope.gridInstance.instance.reloadData(); }, function() { if($state.current.name =='ecommerce.customer.customer.view') $state.go('ecommerce.customer.customer'); }); }) } }; var checkState = function() { if($state.current.name =='ecommerce.customer.customer.view') $scope.RowButtonClickHandler.edit($state.params.customerID); } checkState(); $scope.$on("$stateChangeSuccess", function(event, toState, toParams, fromState, fromParams) { checkState(); if(fromState.name =='ecommerce.customer.customer.view') $uibModalStack.dismissAll(1); }); } });
[+]
..
[-] customer_group.js
[edit]
[-] customer.js
[edit]
[-] address.js
[edit]