1app.controller('adminAuctionCompanyPricingController', ['$scope', '$state', '$stateParams', 'localStorageService', 'permissionsService', 'authenticationService', 'auctionCompaniesService', 2 function ($scope, $state, $stateParams, localStorageService, permissionsService, authenticationService, auctionCompaniesService) { 3 4 $scope.initializePage = function () { 5 // Check to make sure they are logged in as a user 6 var requesteduserRightsRequested = { 7 roles: ['Super Admin'], 8 permissions: ['CanViewAnonymous'] 9 }; 10 permissionsService.isPermitted(requesteduserRightsRequested).then(function (results) { 11 if (!results.data) { 12 popMessage("error", "Not Authorized", "You are not authorized to view this page. Please login to continue."); 13 authenticationService.logout(); 14 $state.go('accountLogin'); 15 } else { 16 17 $scope.getAuctionCompany(); 18 19 20 // Go to the default child if only loading the parent 21 if ($state.current.name == 'adminAuctionCompanyPricing') { 22 $state.go('.tenants'); 23 } 24 25 } 26 }, function (error) { 27 popApiErrorMessage(error); 28 }); 29 30 }; 31 32 $scope.getAuctionCompany = function () { 33 auctionCompaniesService.getAuctionCompanyById($stateParams.auctionCompanyId).then(function (results) { 34 35 if (results.data.auctionCompanies.length > 0) { 36 // Set the auction company information 37 $scope.auctionCompany = results.data.auctionCompanies[0]; 38 $scope.tempAuctionCompany = angular.copy($scope.auctionCompany); 39 40 $scope.pageIsLoaded = true; 41 42 } else { 43 // Show that no auction company was returned 44 popMessage("error", "Not Found", "The auction company profile cannot be found."); 45 } 46 47 // Set that the page is now loaded. 48 $scope.pageIsLoaded = true; 49 50 }, function (error) { 51 popApiErrorMessage(error); 52 }); 53 }; 54 55 56 //initialize variables 57 $scope.pageIsLoaded = false; 58 59 $scope.user = localStorageService.get('AuthData'); 60 $scope.activeChildView = 'tenants'; 61 $scope.auctionCompany = {}; 62 $scope.tempAuctionCompany = {}; 63 64 //initialize Page 65 $scope.initializePage(); 66 } 67]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.