Roberto Sánchez
2014-01-17 c487a57f5fa692b7f5d1b1b7b4d0ca3839261cff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
(function() {
   'use strict';
   var app = angular.module('securis');
   
   app.controller('LicensesCtrl', [
           '$scope',
           '$http',
           'toaster',
           'Catalogs',
           '$store',
           '$L',
           function($scope, $http, toaster, Catalogs, $store, $L) {
               $scope.currentPack = $store.get('currentPack');
               $scope.packs = [
                               {id: 1,
                                   "organization_name": "BP-Spain",
                                   "application_name": "CurisIntegrity",
                                   "licensetype_code": "CIBS",
                                   "code": "BP-SA-0001",
                                   "licenses": 50,
                                   "lic_available": 23},
                               {id: 2,
                                   "organization_name": "Exxon",
                                   "application_name": "CurisData",
                                   "licensetype_code": "CDL1",
                                   "code": "EX-SA-0001",
                                   "licenses": 1,
                                   "lic_available": 0},
                               {id: 3,
                                   "organization_name": "Repsol S.A. empresa con nombre muy largo",
                                   "application_name": "CurisData",
                                   "licensetype_code": "CDL2",
                                   "code": "RE-SA-0001",
                                   "licenses": 5,
                                   "lic_available": 2},
                               {id: 4,
                                   "organization_name": "BP-Spain",
                                   "application_name": "CurisIntegrity v3.0",
                                   "code": "BP-SA-0002",
                                   "licensetype_code": "CISA",
                                   "licenses": 150,
                                   "lic_available": 13},
                               ];
               $scope.licenses = [
                               {id: 1,
                                   "code": "BP-SA-001-AKSJMS234",
                                   "user_fullname": "Johnny Belmonte",
                                   "user_email": "jb@curisit.net",
                                   "status": 3},
                                   {id: 2,
                                       "code": "BP-SA-001-KAJSDHAJS",
                                       "user_fullname": "Walter Simons",
                                       "user_email": "ws@curisit.net",
                                       "status": 1},
                                   {id: 3,
                                       "code": "BP-SA-001-ASKDGHKA",
                                       "user_fullname": "Frank Belmonte",
                                       "user_email": "fb@curisit.net",
                                       "status": 2},
                                       {id: 4,
                                           "code": "BP-SA-001-BBBGGGG",
                                           "user_fullname": "John Dalton",
                                           "user_email": "jd@curisit.net",
                                           "status": 3},
                                       {id: 5,
                                           "code": "BP-SA-001-AKADNAJANA",
                                           "user_fullname": "Walter Martins",
                                           "user_email": "wm@curisit.net",
                                           "status": 3},
                                       {id: 6,
                                           "code": "BP-SA-001-AKANDAKS",
                                           "user_fullname": "Joe Bolton",
                                           "user_email": "jbol@curisit.net",
                                           "status": 2}
                               ];
               
               
               $scope.ellipsis = function(txt, len) {
                   if (!txt || txt.length <= len) return txt;
                   return txt.substring(0, len) + '...';
               }
               
               $scope.selectPack = function(pack) {
                   console.log('Pack selected: ' + JSON.stringify(pack));
                   $scope.currentPack = pack;
                   $store.put('currentPack', pack);
               }
               
           } ]);
})();