a1831b7e7e22c675e9fc53902bba7b255d134340
[portal/sdk.git] /
1 app.controller("collaborateListController", function ($scope,$http,modalService, $modal,AdminService) { 
2         // Table Data
3     AdminService.getCollaborateList().then(function(data){
4                 
5                 var j = data;
6                 $scope.tableData = JSON.parse(j.data);
7                 //$scope.resetMenu();
8         
9         },function(error){
10                 console.log("failed");
11                 reloadPageOnce();
12         });
13         
14         $scope.viewPerPage = 20;
15     $scope.scrollViewsPerPage = 2;
16     $scope.currentPage = 1;
17     $scope.totalPage;
18     $scope.searchCategory = "";
19     $scope.searchString = "";
20  /*    modalService.showSuccess('','Modal Sample') ; */
21         for(x in $scope.tableData){
22                 if($scope.tableData[x].active_yn=='Y')
23                         $scope.tableData[x].active_yn=true;
24                 else
25                         $scope.tableData[x].active_yn=false;
26         }
27     $scope.openCollaboration = function(chatId){
28         openInNewTab('openCollaboration?chat_id=' + chatId);
29     }
30    
31     $scope.toggleProfileActive = function(profileId) {
32         modalService.popupConfirmWin("Confirm","You are about to change user's active status. Do you want to continue?",
33                         function(){
34                         $http.get("profile/toggleProfileActive?profile_id="+profileId).success(function(){});
35                                         
36         })
37     };
38    
39 });
40
41 function openInNewTab(url) {
42           var win = window.open(url, '_blank');
43           win.focus();
44 };