PATH:
home
/
letacommog
/
letaweb
/
scripts
/
editor
/
ecommerce
/
catalog
define([], function() { return function($scope, communication,popup_news) { $scope.product_categories_list = []; communication.getList('product_categories',{}, 'ecommerce.catalog.category').then(function(json) { $scope.product_categories_list = json; }); $scope.setClass = function() { return ''; } $scope.relativeUrl = window.getRelativeUrl(); $scope.changeOrder = function(item,oldIndex,new_parent) { var items = new_parent.items; if(items == undefined) items = new_parent; var rs =[]; for(var i = 0;i < items.length;i++) { if(items[i].id != undefined) rs.push(items[i].id); } communication.api('changeOrder',{parent_id:new_parent.id || 0, orders:rs},'ecommerce.catalog.category').then(function(data) { communication.removeList('product_categories'); }); } window.news_categoriesAddItemCtrl = function($scope,$modalInstance) { $scope.errors = {}; $scope.data = $scope.data || {}; $scope.ok = function() { communication.api('saveCategory',{parent_id:$scope.parentData.id || 0 ,data:$scope.data},'ecommerce.catalog.category', false).then(function(data) { if(data.success!= undefined && !data.success) return; communication.removeList('product_categories'); $modalInstance.close(data); }, function(data) { $scope.errors = data.message; return data; }); } } window.deleteCategoryCtrl = function($scope,$modalInstance) { $scope.ok = function() { function getAllDeleted(item) { var rs = []; rs.push(item.id); var items = item.items; if(items != undefined) { for(var i in items) { if(!items.hasOwnProperty(i)) continue; var c = getAllDeleted(items[i]); for(var j = 0;j < c.length;j++) { rs.push(c[j]); } } } return rs; } var rs = getAllDeleted($scope.data); if(rs.length) communication.api('deleteCategories',{ids:rs},'ecommerce.catalog.category').then(function(data) { communication.removeList('product_categories'); $modalInstance.close(data); }) else $modalInstance.close(1); } } } });
[+]
..
[-] option_set.js
[edit]
[-] manufacturer.js
[edit]
[-] review.js
[edit]
[-] product.js
[edit]
[-] category.js
[edit]
[-] supplier.js
[edit]
[+]
option_set
[-] option_set - Copy.js
[edit]